Advertisement
Guest User

Untitled

a guest
Feb 4th, 2014
195
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.04 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include "HackProcess.h"
  4. #include <math.h>
  5. #include <vector>
  6. #include <algorithm>
  7.  
  8. CHackProcess fProcess;
  9. using namespace std;
  10.  
  11. const DWORD Player_Base = 0x10222AC;
  12.  
  13. #define F6_KEY 0x75
  14. bool b_ShotNow = false;
  15. const DWORD dw_attack = 0x104EC08;
  16. const DWORD dw_teamOffset = 0xAC;
  17.  
  18. const DWORD dw_pos = 0x360;
  19.  
  20. const DWORD dw_angRotation = 0x4629AC;
  21.  
  22. int i_shoot = 5;
  23. int i_DontShoot = 4;
  24. const DWORD dw_health = 0xA4;
  25.  
  26. int NumOfPlayers = 32;
  27. const DWORD dw_PlayerCount = 0x5CF0DC;
  28. const DWORD dw_crosshairOffs = 0x1754;
  29.  
  30. const DWORD dw_entityBase = 0x102F924;
  31. const DWORD dw_EntityLoopDistance = 0x10;
  32.  
  33.  
  34.  
  35.  
  36.  
  37. struct TargetList_t{
  38.  
  39. float Distance;
  40. float AimbotAngle[3];
  41.  
  42. TargetList_t(){
  43.  
  44. }
  45.  
  46. TargetList_t(float aimbotAngle[], float myCoords[], float enemyCoords[]){
  47.  
  48.  
  49. AimbotAngle[0] = aimbotAngle[0];
  50. AimbotAngle[1] = aimbotAngle[1];
  51. AimbotAngle[2] = aimbotAngle[2];
  52.  
  53. }
  54. };
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. struct MyPlayer{
  66. DWORD CLocalPlayer;
  67. int Team;
  68. int CrosshairEntityID;
  69. float Position[3];
  70.  
  71. void ReadInformation(){
  72. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
  73.  
  74. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_teamOffset), &Team, sizeof(int), 0);
  75.  
  76. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffs), &CrosshairEntityID, sizeof(int), 0);
  77.  
  78. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_pos), &Position, sizeof(float[3]), 0);
  79. }
  80. }MyPlayer;
  81.  
  82.  
  83.  
  84.  
  85. struct PlayerList{
  86.  
  87. DWORD CBaseEntity;
  88. int Team;
  89. float Position[3];
  90. float AimbotAngle[3];
  91.  
  92. void ReadInformation(int Player){
  93.  
  94. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_entityBase + (Player*dw_EntityLoopDistance )), &CBaseEntity, sizeof(DWORD), 0);
  95.  
  96. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + dw_teamOffset), &Team, sizeof(int), 0);
  97.  
  98.  
  99. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CBaseEntity + dw_pos), &Position, sizeof(float[3]), 0);
  100.  
  101. Position[2] = Position[2]-20;
  102.  
  103. }
  104.  
  105. }PlayerList[32];
  106.  
  107.  
  108. void CalcAngle(float *src, float *dst, float *angles){
  109.  
  110. double delta[3] = {(src[0]-dst[0]),(src[1]-dst[1]),(src[2]-dst[2])};
  111. double hyp = sqrt(delta[0]*delta[0] + delta[1]*delta[1]);
  112. angles[0] = (float) ((asinf(delta[2]/hyp) * 57.295779513082f));
  113. angles[1] = (float) ((atanf(delta[1]/delta[0]) * 57.295779513082f));
  114. angles[2] = 0;
  115.  
  116. if(delta[0] >= 0.0){
  117. angles[1] += 180.0f;
  118. }
  119.  
  120. }
  121.  
  122. void Aimbot(int target){
  123.  
  124.  
  125. TargetList_t * TargetList = new TargetList_t[32];
  126.  
  127. PlayerList[target].ReadInformation(target);
  128.  
  129.  
  130. CalcAngle(MyPlayer.Position, PlayerList[target].Position, PlayerList[target].AimbotAngle);
  131.  
  132. TargetList[0] = TargetList_t(PlayerList[target].AimbotAngle, MyPlayer.Position, PlayerList[target].Position);
  133.  
  134. WriteProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordEngine + dw_angRotation), TargetList[0].AimbotAngle, 12, 0);
  135.  
  136. delete TargetList;
  137.  
  138.  
  139.  
  140. }
  141.  
  142.  
  143. void TriggerBot(){
  144. if(!b_ShotNow){
  145. WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_DontShoot, sizeof(int), NULL);
  146. b_ShotNow = !b_ShotNow;
  147. }
  148.  
  149. if(MyPlayer.CrosshairEntityID == 0){
  150. return;
  151. }
  152.  
  153. if(PlayerList[MyPlayer.CrosshairEntityID-1].Team == MyPlayer.Team)
  154. return;
  155.  
  156. if(MyPlayer.CrosshairEntityID > 32)
  157. return;
  158.  
  159. if(b_ShotNow){
  160. Aimbot(MyPlayer.CrosshairEntityID-1);
  161. WriteProcessMemory(fProcess.__HandleProcess, (int*)(fProcess.__dwordClient + dw_attack), &i_shoot, sizeof(int), NULL);
  162. b_ShotNow = !b_ShotNow;
  163.  
  164.  
  165.  
  166. }
  167. }
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175. int main(){
  176. fProcess.RunProcess();
  177. std::cout << "Game Found! Triggerboat Activated" << std::endl;
  178.  
  179. while(!GetAsyncKeyState(F6_KEY)){
  180. try
  181. {
  182. MyPlayer.ReadInformation();
  183.  
  184. for(int c = 0; c < 32; c++){
  185. PlayerList[c].ReadInformation(c);
  186. }
  187. TriggerBot();
  188. }
  189. catch (int e)
  190. {
  191. cout << "Error: " << e << '\n';
  192. }
  193.  
  194. }
  195. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement