Advertisement
Guest User

Untitled

a guest
Jul 30th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. #include "ProcMem.h"
  2. #include <iostream>
  3. #include <Windows.h>
  4. ProcMem Mem;
  5.  
  6. DWORD ClientDLL;
  7.  
  8. //dynamic
  9. const DWORD playerBase = 0x00A323E4;
  10. const DWORD entityBase = 0x04A4FCA4;
  11. //static
  12. const DWORD dw_m_fFlags = 0x100;
  13. const DWORD crosshairOffset = 0xAA44;
  14. const DWORD teamOffset = 0xF0;
  15. const DWORD healthOffset = 0xFC;
  16. const DWORD EntLoopDist = 0x10;
  17.  
  18. DWORD LocalPlayer;
  19. int LocalTeam;
  20. int CrossHairID;
  21. DWORD EnemyInCH;
  22. int EnemyHealth;
  23. int EnemyTeam;
  24. int m_fFlags;
  25.  
  26. bool triggerEnabled = false;
  27.  
  28. void ShowOptions()
  29. {
  30. std::cout << std::boolalpha;//makes it print true/false instead of 1/0
  31. std::cout << "Trigger = " << triggerEnabled << std::endl;
  32. }
  33.  
  34. void Toggle()
  35. {
  36. if (GetAsyncKeyState(VK_F2))
  37. {
  38. triggerEnabled = !triggerEnabled;
  39. Sleep(100);
  40. system("cls");//clears console for the options, won't refresh if we wont do this
  41. ShowOptions();
  42. }
  43. }
  44.  
  45. void Trigger()
  46. {
  47. LocalPlayer = Mem.Read<DWORD>(ClientDLL + playerBase);
  48. LocalTeam = Mem.Read<int>(LocalPlayer + teamOffset);
  49. CrossHairID = Mem.Read<int>(LocalPlayer + crosshairOffset);
  50. EnemyInCH = Mem.Read<DWORD>(ClientDLL + entityBase + ((CrossHairID - 1) * EntLoopDist));
  51. EnemyHealth = Mem.Read<int>(EnemyInCH + healthOffset);
  52. EnemyTeam = Mem.Read<int>(EnemyInCH + teamOffset);
  53. if (LocalTeam != EnemyTeam && EnemyHealth > 0 && triggerEnabled)
  54. {
  55. //You can add sleep here for a delay
  56. mouse_event(MOUSEEVENTF_LEFTDOWN, NULL, NULL, NULL, NULL);
  57. mouse_event(MOUSEEVENTF_LEFTUP, NULL, NULL, NULL, NULL);
  58. }
  59. }
  60.  
  61. void Bhop()
  62. {
  63. #define BunnyKey9 0x39
  64. #define BunnyKey9_sc 0x0A
  65.  
  66. m_fFlags = Mem.Read<int>(LocalPlayer + dw_m_fFlags);
  67. if (GetAsyncKeyState(VK_SPACE) & 0x8000 && m_fFlags == 257)
  68. {
  69. std::cout << "poop" << std::endl;
  70. keybd_event(BunnyKey9, BunnyKey9_sc, 0, 0);
  71. Sleep(100);
  72. keybd_event(BunnyKey9, BunnyKey9_sc, KEYEVENTF_KEYUP, 0);
  73. }
  74. }
  75.  
  76. int main()
  77. {
  78. Mem.Process("csgo.exe");
  79. ClientDLL = Mem.Module("client.dll");
  80. ShowOptions();
  81. while (true)
  82. {
  83. Bhop();
  84. Toggle();
  85. Trigger();
  86. Sleep(1);
  87. }
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement