Guest User

Trigger Bot

a guest
Dec 15th, 2013
113
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include "C:\Users\Cody\Desktop\HackProcess.h"
  4.  
  5. const DWORD Player_Base =  0x9F4008;
  6.  
  7. CHackProcess fProcess;  
  8. using namespace std;  
  9.  
  10. #define F6_KEY 0x75
  11. bool b_ShotNow = false;
  12. const DWORD dw_attack = 0xA4711C;
  13. const DWORD dw_teamOffset = 0xF0;
  14. //console command attack 5=shoot 4=dont
  15. int i_shoot = 5;
  16. int i_DontShoot = 4;
  17. //How many players are on?
  18. int NumOfPlayers = 32;
  19. const DWORD dw_PlayerCount = 0x894B94;
  20. //What am i aiming at?
  21. const DWORD dw_crosshairOffs = 0x2370;
  22. //Other Players info
  23. const DWORD dw_entityBase = 0xA0D5AC;
  24. //Loop distance
  25. const DWORD dw_EntityLoopDistance = 0x10;
  26.  
  27. struct MyPlayer
  28. {
  29.     DWORD CLocalPlayer;
  30.     int Team;
  31.     int CrosshairEntityID;
  32.  
  33.     void ReadInformation()
  34.     {
  35.         ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
  36.         //team
  37.         ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer+dw_teamOffset), &Team, sizeof(int), 0);
  38.         //crosshair mang
  39.         ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer+dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0);
  40.         //num of plays
  41.         ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine+dw_PlayerCount), &NumOfPlayers, sizeof(int), 0);
  42.  
  43.     }
  44.  
  45. }MyPlayer;
  46.  
  47.  
  48. struct PlayerList
  49. {
  50.     DWORD CBaseEntity;
  51.     int Team;
  52.  
  53.     void ReadInformation(int Player)
  54.     {
  55.         ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_entityBase + (Player * dw_EntityLoopDistance)), &CBaseEntity, sizeof(DWORD), 0);
  56.         //What team u on brah
  57.         ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity+dw_teamOffset), &Team, sizeof(int), 0);
  58.     }
  59.  
  60. }PlayerList[32];
  61.  
  62.  
  63. void TriggerBot()
  64. {
  65.     //disable
  66.     if(!b_ShotNow)
  67.     {
  68.         WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_DontShoot, sizeof(int), NULL);
  69.      b_ShotNow = !b_ShotNow;
  70.     }
  71.  
  72.     if(MyPlayer.CrosshairEntityID == 0)
  73.         return;
  74.  
  75.     if(PlayerList[MyPlayer.CrosshairEntityID-1].Team == MyPlayer.Team)
  76.         return;
  77.  
  78.     if(MyPlayer.CrosshairEntityID > NumOfPlayers)
  79.         return;
  80.  
  81.  
  82.         //Attack
  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. int main()
  93. {
  94.     fProcess.RunProcess();
  95.     std::cout << "Found the game yo, enjoy the hax" << std::endl;
  96.  
  97.     while(!GetAsyncKeyState(F6_KEY))
  98.     {
  99.         MyPlayer.ReadInformation();
  100.  
  101.  
  102.         for(int i = 0; i < NumOfPlayers; i++)
  103.         {
  104.             PlayerList[i].ReadInformation(i);
  105.         }
  106.  
  107.         TriggerBot();
  108.     }
  109.  
  110.  
  111.  
  112.  
  113. }
RAW Paste Data