Guide bunnyhope code

emiprohitman56

Newbie
Newbie
Newbie
Newbie
Status
Offline
Joined
Jan 10, 2020
Messages
14
Reaction score
2
  1. #include <Windows.h> //All KeyState func and a lot more
  2. #include <iostream> //Shit ton of things
  3. #include "ProcMem.h" //Set up permissions, creates byte array, allowing us to read memory

  4. #define PRESSED 0x8000 //Determines key press(highest bit)
  5. #define SPACE 0x20 //Virtual Key Code 'SPACE'
  6. #define KEY9 0x39 //Virtual Key Code '9' (not to confuse with keypad 9)
  7. #define KEY9SC 0x0A //Scan Code *You usually don't need this, but CS:GO uses DirectInput so we need to use this*

  8. ProcMem Mem; //Creates object of ProcMem class

  9. void endProgram(); //Declaring some funcs

  10. //Changes when CS:GO updates:
  11. const DWORD playerBase = 0xA6B91C; //OUTDATED OFFSET *client.dll*

  12. //Does not change when CS:GO updates:
  13. const DWORD healthOffset = 0xFC; //*client.dll*
  14. const DWORD m_fFlags = 0x100; //*client.dll*

  15. const DWORD EntLoopDist = 0x10; //Distance between entities in Entity array *You don't need this, BHOP only uses our player info*

  16. struct PlayerLocal_t //Struct to hold our player's data
  17. {
  18. int Flags; //State of our player *Is he jumping, crouching....*
  19. int Health; //Health
  20. DWORD ClientDLL; //Module to read from
  21. DWORD LocalPlayer; //Get our player's information
  22. void ReadInfo() //Func to read memory
  23. {
  24. Mem.Process("csgo.exe"); //Set process name
  25. ClientDLL = Mem.Module("client.dll"); //Module to read from
  26. LocalPlayer = Mem.Read<DWORD>(ClientDLL + playerBase); //Get our player's information
  27. Flags = Mem.Read<int>(LocalPlayer + m_fFlags); //Get flag state
  28. Health = Mem.Read<int>(LocalPlayer + healthOffset); //Get health
  29. }
  30. }PlayerLocal;

  31. BOOL findWindow(LPCSTR Window) //Func to find our CS:GO window
  32. {
  33. HWND hWnds = FindWindow(NULL, TEXT(Window));
  34. if (hWnds == NULL)
  35. return false;
  36. else
  37. return true;
  38. }

  39. BOOL compareWnd(char AWnd[323]) //Func to compare active window with CS:GO window
  40. {
  41. char wnd_title[256];
  42. HWND hwnd = GetForegroundWindow();
  43. GetWindowText(hwnd, wnd_title, sizeof(wnd_title));
  44. if (strcmp(wnd_title, AWnd) == 0)
  45. return true;
  46. else
  47. return false;
  48. }

  49. BOOL keyState(int vKey, int vState) //I don't like writing GetAsyncKeyState every time ;)
  50. {
  51. return GetAsyncKeyState(vKey) & vState;
  52. }

  53. void sendKeys() //Func to send KEY9 to active window
  54. {
  55. keybd_event(KEY9, KEY9SC, 0, 0);
  56. Sleep(10); //Delay to diminush number of times key is sent and diminush CPU usage
  57. keybd_event(KEY9, KEY9SC, KEYEVENTF_KEYUP, 0);
  58. }

  59. void endProgram() //Func to end program *Makes code cleaner*
  60. {
  61. std::cout << "Exiting... " << std::endl;
  62. Sleep(1500);
  63. exit(0);
  64. }

  65. void searchWindow() //Will search for CS:GO window
  66. {
  67. Sleep(100);
  68. std::cout << "by jkfauvel" << std::endl;
  69. std::cout << "------------------------------------------------------------------ " << std::endl;
  70. std::cout << "Searching for process...";
  71. Sleep(200);
  72. LPCSTR Wnd = "Counter-Strike: Global Offensive"; //Check if there is a window named as stated

  73. if (!findWindow(Wnd)) //If window is not found then print 'something' and call EndProgram() func
  74. {
  75. Sleep(1500);
  76. std::cout << " PROCESS: Process Not Found! " << std::endl;
  77. Sleep(2000);
  78. endProgram();
  79. }
  80. else if (findWindow(Wnd)) //If windows is found then continue with the code
  81. {
  82. Sleep(300);
  83. std::cout << " PROCESS: Process Found! " << std::endl;
  84. Sleep(1500);
  85. }
  86. }

  87. void optionsList() //List of BHOP options
  88. {
  89. std::cout << "------------------------------------------------------------------ " << std::endl;
  90. std::cout << "Set your jump hotkey to Keyboard 9 'NOT KEYPAD 9' (Game options) " << std::endl;
  91. std::cout << "Press END to exit " << std::endl;
  92. std::cout << "Hold SPACE to Bunnyhop " << std::endl;
  93. std::cout << "------------------------------------------------------------------ " << std::endl;
  94. }

  95. void bhop() //Func to determine if sendKeys() func will be called *essentially func to BHOP*
  96. {
  97. PlayerLocal.ReadInfo(); //Read player's info
  98. char wndCsgo[33] = "Counter-Strike: Global Offensive"; //Set the window we want to compare

  99. /*Check if player is on ground *257 is on ground 256 is on air*;
  100. *Check if player's health is more or equal to 1 *1 means dead for some reason*;
  101. *Call compareWnd() to compare active window with that of CS:GO;
  102. *Check if space is held
  103. */
  104. if (PlayerLocal.Flags == 257 && PlayerLocal.Health >= 1 && compareWnd(wndCsgo) && keyState(SPACE, PRESSED))
  105. sendKeys(); //Call sendKeys() func
  106. }

  107. int main() //main() func *tie all of the program*
  108. {
  109. searchWindow();
  110. optionsList(); //"Load options list *Call optionsList() func*"
  111. while (true) //Infinite loop
  112. {
  113. bhop();
  114. if (keyState(0x23, PRESSED)) //0x23 = ENDK
  115. endProgram();
  116. Sleep(1);
  117. }
Thank for watch my post
Offsets not NEW
 
Last edited:
Top