Advertisement
Guest User

maxownage01 GH main.cpp

a guest
Sep 12th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.44 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include "HackProcess.h"
  4.  
  5. CHackProcess fProcess;
  6.  
  7. //Correct all Offsets
  8. const DWORD Player_Base = 0x00A8013C;
  9.  
  10. #define F6_KEY 0X75
  11.  
  12. bool b_ShotNow = false;
  13. const DWORD dw_attack = 0x02E94458;
  14. const DWORD dw_teamOffset = 0x000000F0;
  15.  
  16. int i_shoot = 5;
  17. int i_DontShoot = 4;
  18.  
  19. int NumOfPlayers = 32;
  20. const DWORD dw_PlayerCount = 0x000000F0;
  21. const DWORD dw_crosshairOffs = 0x00002410;
  22.  
  23. const DWORD dw_entityBase = 0x04A22534;
  24. const DWORD dw_EntityLoopDistance = 0x10;
  25.  
  26. struct MyPlayer
  27. {
  28. DWORD CLocalPlayer;
  29. int Team;
  30. int CrosshairEntityID;
  31.  
  32. void ReadInformation()
  33. {
  34. ReadProcessMemory(fProcess.__HandleProcess(PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
  35. //Team
  36. ReadProcessMemory(fProcess.__HandleProcess(PBYTE*)(CLocalPlayer+dw_crosshairOffs), &CrosshairEntityID, sizeof(DWORD), 0);
  37. //Crosshair
  38. ReadProcessMemory(fProcess.__HandleProcess(PBYTE*)(CLocalPlayer+dw_teamOffset), &Team, sizeof(DWORD), 0);
  39. //Number Of Players
  40. ReadProcessMemory(fProcess.__HandleProcess(PBYTE*)(fProcess.__dwordEngine+dw_PlayerCount), &NumOfPlayers, sizeof(DWORD), 0);
  41. }
  42.  
  43. }Myplayer;
  44.  
  45.  
  46. struct PlayerList
  47. {
  48. DWORD CBaseEntity;
  49. int Team;
  50.  
  51. void ReadInformation(int Player)
  52. {
  53. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_entityBase +)(Player * dw_EntityLoopDistance), &CBaseEntity, sizeof(DWORD), 0);
  54.  
  55. //Team
  56. ReadProcessMemory(fProcess.__HandleProcess(PBYTE*)(CBaseEntity+dw_teamOffset), &Team, sizeof(DWORD), 0);
  57. }
  58.  
  59. }PlayerList[32];
  60.  
  61.  
  62.  
  63. void TriggerBot()
  64. {
  65.  
  66. if(!b_ShotNow)
  67. {
  68.  
  69. WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_DontShoot, sizeof(int), NULL);
  70. b_ShotNow = !b_ShotNow;
  71. }
  72.  
  73. if(MyPlayer.CrosshairEntityID == 0)
  74. return;
  75.  
  76. if(PlayerList[MyPlayer.CrosshairEntityID=1].Team == MyPlater.Team
  77. return;
  78.  
  79.  
  80. if(MyPlayer.CroshairEntityID > NumOfPlayers)
  81. return;
  82.  
  83. if(b_ShotNow)
  84. {
  85. WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_shoot, sizeof(int), NULL);
  86. b_ShotNow = !b_ShotNow;
  87.  
  88. }
  89.  
  90.  
  91. }
  92.  
  93.  
  94.  
  95. int main ()
  96. {
  97. fProcess.RunProcess();
  98. std::cout << "csgo.exe Detected. Triggerbot is activated." << endl;
  99.  
  100.  
  101. while(!GetAsyncKeyState(F6_KEY))
  102. {
  103. MyPlayer.ReadInformation();
  104.  
  105.  
  106.  
  107. for(int i = 0; i < NumOfPlayers; i++)
  108. {
  109.  
  110. PlayerList[i].ReadInformation(i);
  111. }
  112.  
  113. TriggerBot();
  114. }
  115.  
  116. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement