Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. #include "ProcMem.h" // Memory reading
  2.  
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7.  
  8. {
  9. // Variables
  10. int PlayerBase;
  11. int CrosshairOffset;
  12. int EntityBase;
  13. ProcMem Mem; // Shortcut
  14. Mem.Process("csgo.exe"); // Choosing the process
  15.  
  16. DWORD ClientDLL = Mem.Module("client.dll"); //Module we are reading memory from
  17.  
  18. // Needs to be updated when counter strike is updated.
  19. const DWORD playerBase = 0xA68A14;
  20. const DWORD entityBase = 0x4A0B0C4;
  21. const DWORD crosshairOffset = 0x23F8;
  22.  
  23. // Does not change on updated, in other words, no need to update these!
  24. const DWORD teamOffset = 0xF0;
  25. const DWORD healthOffset = 0xFC;
  26. const DWORD EntLoopDist = 0x10;
  27.  
  28. // our player
  29. DWORD LocalPlayer = Mem.Read<DWORD>(ClientDLL + PlayerBase);
  30.  
  31. // 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.
  32. int LocalTeam = Mem.Read<int>(LocalPlayer + teamOffset);
  33.  
  34. // our player's crosshair ID, it is used for reading what is in our crosshair
  35. int CrossHairID = Mem.Read<int>(LocalPlayer + CrosshairOffset);
  36.  
  37. void Trigger();
  38. {
  39. DWORD EnemyInCH = Mem.Read<DWORD>(ClientDLL + EntityBase + ((CrossHairID - 1) * EntLoopDist)); // CH = Crosshair.
  40. int EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset); // Enemy in crosshair's
  41. int EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset); // Enemy in crosshair's team, we need this to compare it to our own player's team)
  42. if (LocalTeam != EnemyTeam && EnemyHealth > 0)
  43. {
  44. // Here you can add a delay before shooting, to make it look legit. This is done using Sleep()
  45. mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
  46. // use Sleep() here for shooting several shots with an ak for example. Not usable with pisto
  47. mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
  48. // use Sleep() here for a 'cooldown' between shots.
  49. }
  50.  
  51.  
  52. if (LocalTeam != EnemyTeam)
  53. {
  54. // shoot
  55. }
  56.  
  57. if (EnemyHealth > 0)
  58. {
  59. // shoot
  60. }
  61.  
  62. if (LocalTeam != EnemyTeam && EnemyHealth > 0)
  63. {
  64. // Shoot
  65. }
  66.  
  67. }
  68.  
  69.  
  70. {
  71. while(true)
  72. {
  73. Trigger();
  74. Sleep(10000); // Add a Sleep() here for less cpu usage.
  75. }
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement