Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <iostream>
- #include <Windows.h>
- #include "ProcMem.h"
- void Trigger();
- ProcMem Mem; // Shortcut
- // Needs to be updated when counter strike is updated.
- const DWORD playerBase = 0xA68A14;
- const DWORD entityBase = 0x4A0B0C4;
- const DWORD crosshairOffset = 0x23F8;
- // Does not change on updated, in other words, no need to update these!
- const DWORD teamOffset = 0xF0;
- const DWORD healthOffset = 0xFC;
- const DWORD EntLoopDist = 0x10;
- DWORD CSGO;
- HWND hWnd = FindWindow(NULL, TEXT("Counter-Strike: Global Offensive"));
- bool Hack;
- int main() {
- Mem.Process("csgo.exe");
- if (hWnd == NULL) {
- std::cout << "Game not found!" << std::endl;
- }
- else {
- std::cout << "Game is found! Launching hack!" << std::endl;
- while (true) {
- if (GetAsyncKeyState(VK_INSERT)) {
- std::cout << "Hack activated" << std::endl;
- Trigger();
- }
- }
- }
- }
- void Trigger() {
- DWORD ClientDLL = Mem.Module("client.dll"); //Module we are reading memory from
- // our player
- DWORD LocalPlayer = Mem.Read<DWORD>(ClientDLL + playerBase);
- // our player's team, so we can compare it to the player in our crosshair and shoot if its not our own player's team.
- int LocalTeam = Mem.Read<int>(LocalPlayer + teamOffset);
- // our player's crosshair ID, it is used for reading what is in our crosshair
- int CrossHairID = Mem.Read<int>(LocalPlayer + crosshairOffset);
- DWORD EnemyInCH = Mem.Read<DWORD>(ClientDLL + entityBase + ((CrossHairID - 1) * EntLoopDist)); // CH = Crosshair.
- int EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset); // Enemy in crosshair's
- int EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset); // Enemy in crosshair's team, we need this to compare it to our own player's team)
- if (LocalTeam != EnemyTeam && EnemyHealth > 0) {
- // Here you can add a delay before shooting, to make it look legit. This is done using Sleep()
- mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
- // use Sleep() here for shooting several shots with an ak for example. Not usable with pisto
- mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
- // use Sleep() here for a 'cooldown' between shots.
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement