Solved Bunnyhop fail

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Teuvin

now I am become Death
Dank Tier VIP
Trump Tier Donator
Dec 8, 2016
403
10,388
65
Well guys I've been working of this fucking bunnyhop for a while now if you are on discord then you know how many fucking times I tried to make this work but I finally give up, I understood the logic behind it everything but this shit is just fucking me so if someone could help me I would DEEPLY appreciate it.

This fucking shit just keepings throwing "press any key to continue" at me.

main.cpp
C++:
// ConsoleApplication28.cpp : Defines the entry point for the console application.
//
#include <Windows.h>
#include <iostream>
#include "hackprocess.h"

bool bunnyhopstatus = false;
bool b_true = true;
bool b_false = false;
hackprocess hack;
struct Myplayer
{
	DWORD CLocalPlayer;
	int m_fflags;
	void readinformation() {
		ReadProcessMemory(hack.css_handle, (PBYTE*)(hack.client_adress + hack.Playerbase), &CLocalPlayer, sizeof(CLocalPlayer), 0);
		ReadProcessMemory(hack.css_handle, (PBYTE*)(hack.client_adress + hack.OffSetJump), &m_fflags, sizeof(int), 0);
	}
}MyPlayer;

void bunnyhop() {
	if (GetAsyncKeyState(0x20)) {
		bunnyhopstatus = !bunnyhopstatus;
		Sleep(450);
	}
	if (!bunnyhopstatus) {
		return;
	}
	if (MyPlayer.m_fflags == 257) {
		WriteProcessMemory(hack.css_handle, (PBYTE*)(hack.client_adress + hack.jump_adress), &b_true, sizeof(bool), 0);
	}
	else if (MyPlayer.m_fflags != 257) {
		WriteProcessMemory(hack.css_handle, (PBYTE*)(hack.client_adress + hack.jump_adress), &b_false, sizeof(bool), 0);
	}
}

int main()
{
	
	if (hack.runprocess()) {
		hack.client_adress = hack.GetModuleNamePointer("client.dll", hack.pid);
		if (hack.client_adress < 0)
		{
			std::cout << "Error" << std::endl;
		}
		else
		{
			while (!GetAsyncKeyState(0x57)) {
				MyPlayer.readinformation();
				bunnyhop();
			}
		}
		
							}
}

hackprocess.h
C++:
#pragma once
#include <TlHelp32.h>

class hackprocess {
public:
	HWND css_hwnd;
	DWORD pid;
	HANDLE css_handle;
	DWORD Playerbase = 0x4E3934;
	DWORD OffSetJump = 0x348;
	DWORD jump_adress = 0x4F3B3C;
	DWORD client_adress = 0x0;

	bool runprocess(){
		css_hwnd = FindWindowA(NULL,"Counter-strike Source");
		if (css_hwnd == NULL) {
			std::cout << "Please make sure CSS is open" << std::endl;
			return false;
		}
		else {
			GetWindowThreadProcessId(css_hwnd, &pid);
			if (pid < 0) {
				std::cout << "Couldn't get process ID" << std::endl;
				return false;
			}
			else {
				css_handle = OpenProcess(PROCESS_ALL_ACCESS, false, pid);
				if (css_handle == NULL) {
					std::cout << "Coudln't open process with all rights, run the program as ADMIN" << std::endl;
					std::getchar();
					return false;
				}
				else {
					return true;
				}
			}
		}
	}

	DWORD GetModuleNamePointer(LPSTR LPSTRModuleName, DWORD __DwordProcessId)
	{
		MODULEENTRY32 lpModuleEntry = { 0 };
		HANDLE hSnapShot = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, __DwordProcessId);
		if (!hSnapShot)
			return NULL;
		lpModuleEntry.dwSize = sizeof(lpModuleEntry);
		BOOL __RunModule = Module32First(hSnapShot, &lpModuleEntry);
		while (__RunModule)
		{
			if (!strcmp(lpModuleEntry.szModule, LPSTRModuleName))
			{
				CloseHandle(hSnapShot);
				return (DWORD)lpModuleEntry.modBaseAddr;
			}
			__RunModule = Module32Next(hSnapShot, &lpModuleEntry);
		}
		CloseHandle(hSnapShot);
		return NULL;
	}
};
extern hackprocess hack;
 
Last edited:

Broihon

edgy 12 y/o
Escobar Tier VIP
Fleep Tier Donator
Dec 22, 2013
1,746
40,528
316
Well guys I've been working of this fucking bunnyhop for a while now if you are on discord then you know how many fucking times I tried to make this work but I finally give up, I understood the logic behind it everything but this shit is just fucking me so if someone could help me I would DEEPLY appreciate it.

This fucking shit just keepings throwing "press any key to continue" at me.

//codenz
readinformation should look like this:
C++:
void readinformation() {
	ReadProcessMemory(hack.css_handle, (PBYTE*)(hack.client_adress + hack.Playerbase), &CLocalPlayer, sizeof(CLocalPlayer), 0); //get playerbase
	ReadProcessMemory(hack.css_handle, (PBYTE*)(CLocalPlayer + hack.OffSetJump), &m_fflags, sizeof(int), 0); //get flag value which is in the playerbase struct
}
bunnhop should look like this:
C++:
void bunnyhop() {
	if (GetAsyncKeyState(0x20) & 1) { //prevents spamming this a few hundred times per second, check the reference on msdn
		bunnyhopstatus = !bunnyhopstatus;
		//useless sleep removed
	}

	if (!bunnyhopstatus) {
		return;
	}

	if (MyPlayer.m_fflags == 257) {
		WriteProcessMemory(hack.css_handle, (PBYTE*)(CLocalPlayer  + hack.jump_adress), &b_true, sizeof(bool), 0); //same as in readinformation (i guess), why not use SendInput or something similar?
	}
	else if (MyPlayer.m_fflags != 257) {
		WriteProcessMemory(hack.css_handle, (PBYTE*)(CLocalPlayer  + hack.jump_adress), &b_false, sizeof(bool), 0); //same as in readinformation (i guess), why not use SendInput or something similar?
	}
}
Tba: change values of b_true/b_false as Oneshot said. And using the W key to close the program really isn't a good idea :^)
 
Last edited:

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
C++:
css_hwnd = FindWindowA(NULL,"Counter-strike Source");
Isn't Strike supposed to be capital?
Nevermind... Findwindow does not perform a case sensitive search...

Either way, is any other error getting thrown before you get "Press any key to continue..."??
 

r4z0r

Coder
Meme Tier VIP
Jul 21, 2016
246
2,678
13
I'm not 100% sure but when you create a console application with getasynckey you can have some problems (I had when I was creating my first trainer) so just give it a try: create a new thread to do everything, just make sure to have a main while so the application won't close, I have no other ideas, your code seems fine
 

Oneshot

Meme Tier VIP
Apr 4, 2015
232
190
13
In Source games 5 = true and 4 = false. so don't use true and false use 5 and 4 :) and you should use cout to check if you have the right adress to the flags and the jump adress . check the addresses in cheat engine so you can see whats happening at those places when you jump. Then you will get a better understanding how it works. you can debug instead of using cout but you can do either way.
 

Traxin

Escobar Tier VIP
Dank Tier Donator
Aug 3, 2015
1,041
25,378
154
C++:
while (!GetAsyncKeyState(0x57)) {
                MyPlayer.readinformation();
                bunnyhop();
            }
0x57 is W right? As soon as you hit the W key one time your program will close btw, but I don't think this is the issue as to why it doesn't work.
Sounds like Oneshot might've hit the nail on the head though.
 
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