Guest User

Untitled

a guest
Dec 9th, 2014
1,508
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.36 KB | None | 0 0
  1. #include "ProcMem.h"
  2. ProcMem Mem;
  3.  
  4. // Needs to be updated when counter strike is updated.
  5. const DWORD playerBase = 0xA68A14;
  6. const DWORD entityBase = 0x4A0B0C4;
  7. const DWORD crosshairOffset = 0x23F8;
  8. // Does not change on updated, in other words, no need to update these!
  9. const DWORD teamOffset = 0xF0;
  10. const DWORD healthOffset = 0xFC;
  11. const DWORD EntLoopDist = 0x10;
  12. DWORD ClientDll;
  13. DWORD localPlayer;
  14. int CrossHairID;
  15. int localTeam;
  16.  
  17. void FuckThemAll();
  18.  
  19. int main()
  20. {
  21.     Mem.GetProcess("csgo.exe");
  22.     ClientDll = Mem.Module("client.dll");
  23.     localPlayer = Mem.Read<DWORD>(ClientDll + playerBase);
  24.     localTeam = Mem.Read<int>(localPlayer + teamOffset);
  25.     CrossHairID = Mem.Read<int>(localPlayer + crosshairOffset);
  26.     while(true)
  27.     {
  28.         FuckThemAll();
  29.         Sleep(250);
  30.     }
  31.     return 0;
  32. }
  33.  
  34. void FuckThemAll()
  35. {
  36.     DWORD EnemyInCH = Mem.Read<DWORD>(ClientDll + entityBase + ((CrossHairID - 1) * EntLoopDist)); // CH = Crosshair.
  37.     int EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset); // Enemy in crosshair's
  38.     int EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset); // Enemy in crosshair's team, we need this to compare it to our own player's team)
  39.     if (localTeam != EnemyTeam && EnemyHealth > 0)
  40.     {
  41.         printf("triggered");
  42.         mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
  43.         mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment