Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.15 KB | None | 0 0
  1. #include <iostream>
  2. #include <iostream>
  3. #include <Windows.h>
  4. #include "ProcMem.h"
  5.  
  6. void Trigger();
  7.  
  8. ProcMem Mem; // Shortcut
  9.  
  10. // Needs to be updated when counter strike is updated.
  11. const DWORD playerBase = 0xA68A14;
  12. const DWORD entityBase = 0x4A0B0C4;
  13. const DWORD crosshairOffset = 0x23F8;
  14.  
  15. // Does not change on updated, in other words, no need to update these!
  16. const DWORD teamOffset = 0xF0;
  17. const DWORD healthOffset = 0xFC;
  18. const DWORD EntLoopDist = 0x10;
  19. DWORD CSGO;
  20. HWND hWnd = FindWindow(NULL, TEXT("Counter-Strike: Global Offensive"));
  21. bool Hack;
  22.  
  23. int main() {
  24.     Mem.Process("csgo.exe");
  25.  
  26.     if (hWnd == NULL) {
  27.         std::cout << "Game not found!" << std::endl;
  28.     }
  29.     else {
  30.         std::cout << "Game is found! Launching hack!" << std::endl;
  31.         while (true) {
  32.             if (GetAsyncKeyState(VK_INSERT)) {
  33.                 std::cout << "Hack activated" << std::endl;
  34.                 Trigger();
  35.             }
  36.         }
  37.     }
  38. }
  39.  
  40. void Trigger() {   
  41.  
  42.     DWORD ClientDLL = Mem.Module("client.dll"); //Module we are reading memory from
  43.                                                 // our player
  44.     DWORD LocalPlayer = Mem.Read<DWORD>(ClientDLL + playerBase);
  45.     // 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.
  46.     int LocalTeam = Mem.Read<int>(LocalPlayer + teamOffset);
  47.     // our player's crosshair ID, it is used for reading what is in our crosshair
  48.     int CrossHairID = Mem.Read<int>(LocalPlayer + crosshairOffset);
  49.  
  50.     DWORD EnemyInCH = Mem.Read<DWORD>(ClientDLL + entityBase + ((CrossHairID - 1) * EntLoopDist)); // CH = Crosshair.
  51.    
  52.     int EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset); // Enemy in crosshair's
  53.     int EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset); // Enemy in crosshair's team, we need this to compare it to our own player's team)
  54.    
  55.     if (LocalTeam != EnemyTeam && EnemyHealth > 0) {
  56.         // Here you can add a delay before shooting, to make it look legit. This is done using Sleep()
  57.         mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
  58.         // use Sleep() here for shooting several shots with an ak for example. Not usable with pisto
  59.         mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
  60.         // use Sleep() here for a 'cooldown' between shots.
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement