Advertisement
Guest User

Untitled

a guest
Jul 13th, 2014
686
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.43 KB | None | 0 0
  1. #include <Windows.h>
  2. #include <iostream>
  3. #include "HackProcess.h"
  4.  
  5.  
  6. CHackProcess fProcess;
  7. using namespace std;
  8. bool b_ShotNow = false;
  9. bool b_bHop = false;
  10. int numOfPlayers = 32;
  11. const DWORD Player_Base = 0x53BFC8;
  12. const DWORD dw_jump = 0x569664;
  13. const DWORD m_Flags = 0x34C;
  14. const DWORD dw_teamOffset = 0x98;
  15. const DWORD dw_PlayerCountOff = 0x4EA580;
  16. const DWORD dw_crosshairOffset = 0x14DC;
  17. const DWORD dw_entityBase = 0x5495B4;
  18. const DWORD dw_EntityLoopDistance = 0x10;
  19. const DWORD dw_healthOff = 0x90;
  20.  
  21. #define Fl_ONGROUND 257
  22. #define SPACE_BAR 0x20
  23. #define F6_Key 0x75
  24.  
  25. bool b_true = true;
  26. bool b_false = false;
  27. bool bHopStatus = false;
  28.  
  29. struct MyPlayer_t{
  30. DWORD CLocalPlayer;
  31. int m_fflags;
  32. int Team;
  33. int CrosshairEntityID;
  34. int m_iHealth;
  35. void ReadInformation(){
  36. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &CLocalPlayer, sizeof(DWORD), 0);
  37. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + m_Flags), &m_fflags, sizeof(int), 0);
  38. //TEAM
  39. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_teamOffset), &Team, sizeof(int), 0);
  40. //Whats under the crosshair?
  41. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_crosshairOffset), &CrosshairEntityID, sizeof(int), 0);
  42. //How many players are there?
  43. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordServer + dw_PlayerCountOff), &numOfPlayers, sizeof(int), 0);
  44. //My Health
  45. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CLocalPlayer + dw_healthOff), &m_iHealth, sizeof(int), 0);
  46. }
  47. }MyPlayer;
  48.  
  49. struct PlayerList
  50. {
  51. DWORD CbaseEntity;
  52. int Team;
  53.  
  54. void ReadInformation(int Player){
  55. //Entity Base
  56. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + dw_entityBase + (Player* dw_EntityLoopDistance)), &CbaseEntity, sizeof(DWORD), 0);
  57. //Team Number
  58. ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(CbaseEntity + dw_teamOffset), &Team, sizeof(int), 0);
  59.  
  60. }
  61.  
  62.  
  63. }PlayerList[32];
  64. void Shoot()
  65. {
  66. mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
  67. mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  68. }
  69. void jump()
  70. {
  71. keybd_event(0x39, 0x39, 0, 0);
  72. Sleep(1);
  73. keybd_event(0x39, 0x39, KEYEVENTF_KEYUP, 0);
  74. Sleep(1);
  75. }
  76.  
  77.  
  78.  
  79. void BunnyHop(){
  80. if (GetAsyncKeyState(VK_F5)){
  81.  
  82. b_bHop = !b_bHop;
  83. Sleep(250);
  84. }
  85. if (!b_bHop)
  86. return;
  87. if (GetAsyncKeyState(SPACE_BAR)){
  88. bHopStatus = !bHopStatus;
  89. Sleep(250);
  90.  
  91. }
  92.  
  93. if (!bHopStatus)
  94. return;
  95.  
  96. if (MyPlayer.m_fflags == (Fl_ONGROUND) || MyPlayer.m_fflags == 263)
  97. {
  98. jump();
  99. }
  100.  
  101. }
  102. void TriggerBot(){
  103. if (!b_ShotNow)
  104. b_ShotNow = !b_ShotNow;
  105. if (MyPlayer.CrosshairEntityID == 0)
  106. return;
  107.  
  108. if (MyPlayer.CrosshairEntityID > numOfPlayers)
  109. return;
  110.  
  111. if (PlayerList[MyPlayer.CrosshairEntityID - 1].Team == MyPlayer.Team)
  112. return;
  113.  
  114.  
  115. if (b_ShotNow){
  116. Shoot();
  117. Sleep(1);
  118. b_ShotNow = !b_ShotNow;
  119. }
  120.  
  121. }
  122.  
  123. int main(){
  124.  
  125. fProcess.RunProcess();
  126. cout << "Game Found! Running Multihack..." << endl;
  127. cout << "Coded by Snorflake" << endl;
  128. cout << endl;
  129. cout << endl;
  130. cout << "F6 - Close" << endl;
  131. cout << "F5 - Toggle Bunny hop" << endl;
  132.  
  133. while (!GetAsyncKeyState(F6_Key)){
  134. MyPlayer.ReadInformation();
  135. for (int i = 0; i < numOfPlayers; i++){
  136.  
  137. PlayerList[i].ReadInformation(i);
  138. }
  139. //if (MyPlayer.m_iHealth > 2){
  140. TriggerBot();
  141. BunnyHop();
  142. //}
  143.  
  144.  
  145.  
  146. }
  147.  
  148.  
  149.  
  150.  
  151. return 0;
  152. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement