Solved Bhop hack SendInput not working

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Vaah

Newbie
Apr 3, 2016
2
32
0
Hello,

so I've followed Fleep's bhop hack tutorial and made a few changes / tried to:
-I made it bhop when holding space
-I tried getting it to bhop by pressing a key to jump

So far everything works except Counter Strike Source doesn't really accept the input or ignores it..
Anyways, the player doesn't jump (not even once), but in console for example i see the key (p) spammed whenever i press space and am standing on the ground.

Any help is appreciated, here's the code:
C++:
#include <Windows.h>
#include <iostream>
#include <time.h>
#include "HackProcess.h"

CHackProcess fProcess;
using namespace std;

const DWORD Player_Base = 0x4C6708;
//const DWORD dw_jump = 
//SendKeys.Send("{SPACE BAR}");

const DWORD dw_JumpOffset = 0x350;


#define FL_ONGROUND 257
#define SPACE_BAR 0x20

#define F6_KEY 0x75

bool b_true = true;
bool b_false = false;
bool BunnyHopStatus = false;

struct MyPlayer_t
{
	DWORD ClocalPlayer;
	int m_fFlags;
	void ReadInformation()
	{
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(fProcess.__dwordClient + Player_Base), &ClocalPlayer, sizeof(DWORD), 0);
		ReadProcessMemory(fProcess.__HandleProcess, (PBYTE*)(ClocalPlayer + dw_JumpOffset), &m_fFlags, sizeof(int), 0);
	}
}MyPlayer;

void BunnyHop()
{
	INPUT pKey;
	pKey.type = INPUT_KEYBOARD;
    pKey.ki.wScan = 0; // hardware scan code for key
    pKey.ki.time = 0;
    pKey.ki.dwExtraInfo = 0;

	while(GetAsyncKeyState(SPACE_BAR))
	{
		if(MyPlayer.m_fFlags == FL_ONGROUND)
		{
			pKey.ki.wVk = 0x50; // virtual-key code for the "p" key
			pKey.ki.dwFlags = 0; // 0 for key press
			SendInput(1, &pKey, sizeof(INPUT));
			Sleep(5);
			pKey.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
			SendInput(1, &pKey, sizeof(INPUT));

			cout << "player on ground" << endl;
			//Sleep(5000);
		}

	}

}




int main()
{
	fProcess.RunProcess();
	cout << "Game Found! Running Bunny Hop..." << endl;
	

	while(!GetAsyncKeyState(F6_KEY))
	{
		MyPlayer.ReadInformation();
		BunnyHop();	
	}



}
 

Rake

Cesspool Admin
Administrator
Jan 21, 2014
12,187
78,998
2,399
The point was to avoid writing to the memory to stay just that little bit more undetectable.
So your problem is here:

C++:
 while(GetAsyncKeyState(SPACE_BAR))
    {
        if(MyPlayer.m_fFlags == FL_ONGROUND) //<----------------Problem here
        {
            pKey.ki.wVk = 0x50; // virtual-key code for the "p" key
            pKey.ki.dwFlags = 0; // 0 for key press
            SendInput(1, &pKey, sizeof(INPUT));
            Sleep(5);
            pKey.ki.dwFlags = KEYEVENTF_KEYUP; // KEYEVENTF_KEYUP for key release
            SendInput(1, &pKey, sizeof(INPUT));
 
            cout << "player on ground" << endl;
            //Sleep(5000);
        }
 
    }
While you're pressing space bar, it never calls ReadInformation on your local player, therefore MyPlayer.m_fFlags never gets updated in the next loop.

One way to fix this is to call ReadInformation in your loop GetASyncKeySTate loop
 

Vaah

Newbie
Apr 3, 2016
2
32
0
The point was to avoid writing to the memory to stay just that little bit more undetectable.
 

Nristo

Newbie
Nov 30, 2013
1
1,908
0
I had the same problem with SendInput however I decided to use sendmessgae instead and it works really well.

This is what I use to accomplish the bunnyhop.

C++:
gamewin_ = FindWindow(0, "Counter-Strike: Global Offensive");

		
if (myplayer.getjumpstatus() == onground)
{
	SendMessage(gamewin_, WM_KEYDOWN, VK_SPACE, 0x390000);
	Sleep(1);
	SendMessage(gamewin_, WM_KEYUP, VK_SPACE, 0x390000);
}
give that a go, it should work for you.
 
Last edited:

mambda

headass
Escobar Tier VIP
Trump Tier Donator
Jun 25, 2014
2,298
37,938
269
The point was to avoid writing to the memory to stay just that little bit more undetectable.
You're already using ReadProcessMemory, so you already have a handle to the game, so using WPM wouldn't have any other effect on your cheats detectability, because a handle is already opened.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods