- Status
- Offline
- Joined
- Jan 10, 2020
- Messages
- 14
- Reaction score
- 2
- #include <Windows.h> //All KeyState func and a lot more
- #include <iostream> //Shit ton of things
- #include "ProcMem.h" //Set up permissions, creates byte array, allowing us to read memory
- #define PRESSED 0x8000 //Determines key press(highest bit)
- #define SPACE 0x20 //Virtual Key Code 'SPACE'
- #define KEY9 0x39 //Virtual Key Code '9' (not to confuse with keypad 9)
- #define KEY9SC 0x0A //Scan Code *You usually don't need this, but CS:GO uses DirectInput so we need to use this*
- ProcMem Mem; //Creates object of ProcMem class
- void endProgram(); //Declaring some funcs
- //Changes when CS:GO updates:
- const DWORD playerBase = 0xA6B91C; //OUTDATED OFFSET *client.dll*
- //Does not change when CS:GO updates:
- const DWORD healthOffset = 0xFC; //*client.dll*
- const DWORD m_fFlags = 0x100; //*client.dll*
- const DWORD EntLoopDist = 0x10; //Distance between entities in Entity array *You don't need this, BHOP only uses our player info*
- struct PlayerLocal_t //Struct to hold our player's data
- {
- int Flags; //State of our player *Is he jumping, crouching....*
- int Health; //Health
- DWORD ClientDLL; //Module to read from
- DWORD LocalPlayer; //Get our player's information
- void ReadInfo() //Func to read memory
- {
- Mem.Process("csgo.exe"); //Set process name
- ClientDLL = Mem.Module("client.dll"); //Module to read from
- LocalPlayer = Mem.Read<DWORD>(ClientDLL + playerBase); //Get our player's information
- Flags = Mem.Read<int>(LocalPlayer + m_fFlags); //Get flag state
- Health = Mem.Read<int>(LocalPlayer + healthOffset); //Get health
- }
- }PlayerLocal;
- BOOL findWindow(LPCSTR Window) //Func to find our CS:GO window
- {
- HWND hWnds = FindWindow(NULL, TEXT(Window));
- if (hWnds == NULL)
- return false;
- else
- return true;
- }
- BOOL compareWnd(char AWnd[323]) //Func to compare active window with CS:GO window
- {
- char wnd_title[256];
- HWND hwnd = GetForegroundWindow();
- GetWindowText(hwnd, wnd_title, sizeof(wnd_title));
- if (strcmp(wnd_title, AWnd) == 0)
- return true;
- else
- return false;
- }
- BOOL keyState(int vKey, int vState) //I don't like writing GetAsyncKeyState every time ;)
- {
- return GetAsyncKeyState(vKey) & vState;
- }
- void sendKeys() //Func to send KEY9 to active window
- {
- keybd_event(KEY9, KEY9SC, 0, 0);
- Sleep(10); //Delay to diminush number of times key is sent and diminush CPU usage
- keybd_event(KEY9, KEY9SC, KEYEVENTF_KEYUP, 0);
- }
- void endProgram() //Func to end program *Makes code cleaner*
- {
- std::cout << "Exiting... " << std::endl;
- Sleep(1500);
- exit(0);
- }
- void searchWindow() //Will search for CS:GO window
- {
- Sleep(100);
- std::cout << "by jkfauvel" << std::endl;
- std::cout << "------------------------------------------------------------------ " << std::endl;
- std::cout << "Searching for process...";
- Sleep(200);
- LPCSTR Wnd = "Counter-Strike: Global Offensive"; //Check if there is a window named as stated
- if (!findWindow(Wnd)) //If window is not found then print 'something' and call EndProgram() func
- {
- Sleep(1500);
- std::cout << " PROCESS: Process Not Found! " << std::endl;
- Sleep(2000);
- endProgram();
- }
- else if (findWindow(Wnd)) //If windows is found then continue with the code
- {
- Sleep(300);
- std::cout << " PROCESS: Process Found! " << std::endl;
- Sleep(1500);
- }
- }
- void optionsList() //List of BHOP options
- {
- std::cout << "------------------------------------------------------------------ " << std::endl;
- std::cout << "Set your jump hotkey to Keyboard 9 'NOT KEYPAD 9' (Game options) " << std::endl;
- std::cout << "Press END to exit " << std::endl;
- std::cout << "Hold SPACE to Bunnyhop " << std::endl;
- std::cout << "------------------------------------------------------------------ " << std::endl;
- }
- void bhop() //Func to determine if sendKeys() func will be called *essentially func to BHOP*
- {
- PlayerLocal.ReadInfo(); //Read player's info
- char wndCsgo[33] = "Counter-Strike: Global Offensive"; //Set the window we want to compare
- /*Check if player is on ground *257 is on ground 256 is on air*;
- *Check if player's health is more or equal to 1 *1 means dead for some reason*;
- *Call compareWnd() to compare active window with that of CS:GO;
- *Check if space is held
- */
- if (PlayerLocal.Flags == 257 && PlayerLocal.Health >= 1 && compareWnd(wndCsgo) && keyState(SPACE, PRESSED))
- sendKeys(); //Call sendKeys() func
- }
- int main() //main() func *tie all of the program*
- {
- searchWindow();
- optionsList(); //"Load options list *Call optionsList() func*"
- while (true) //Infinite loop
- {
- bhop();
- if (keyState(0x23, PRESSED)) //0x23 = ENDK
- endProgram();
- Sleep(1);
- }
Offsets not NEW
Last edited: