Help with Bhop hack

Posts 1–11 of 11 · Page 1 of 1
Help with Bhop hack
I'm trying to make a bhop hack that works better than say an ahk script. All I can seem to find info on, is checking if the player is on the ground then sending a jump input. Not sure what I'm doing wrong but mine works like an ahk script, where it just seems to be spamming jump constantly and doesn't actually give good bhops. You have to strafe and everything. I want it to make it as easy as possible to bhop without writing to memory. (since I've read that'll make it detected a lot easier.)

Also it gets stuck. Like it jumps even when you're not pressing the jump key.

Any help would be fantastic.

Anyway here's my code:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System****;
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;

namespace bhop
{
	class Program
	{
		[DllImport("kernel32.dll")]
		public static extern int OpenProcess(uint dwDesiredAccess, bool bInheritHandle, int dwProcessId);
		[DllImport("kernel32.dll")]
		public static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] buffer, int size, int lpNumberOfBytesRead);
		[DllImport("user32.dll")]
		static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, UIntPtr dwExtraInfo);
		[DllImport("user32.dll")]
		public static extern short GetAsyncKeyState(int vKey);
		[DllImport("user32.dll")]
		static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);

		static int BaseAdressClientDLL = 0;
		static int pHandle = 0;

		const int _localPlayer = 0x00A7D4CC;
		const int _entityList = 0x04A98154;
		const int _mflags = 0x00000100;
		const int FL_ONGROUND = 257;


		static void Main(string[] args)
		{

			bool FoundCSGO = false;
			while (true)
			{
				if (FoundCSGO == false)
				{
					foreach (Process Proc in Process.GetProcesses())
					{
						if (Proc.ProcessName.Equals("csgo"))
						{
							pHandle = OpenProcess(0x001F0FFF, false, Proc.Id);
							foreach (ProcessModule Module in Proc.Modules)
							{
								if (Module.ModuleName.Equals("client.dll"))
								{
									BaseAdressClientDLL = (int)Module.BaseAddress;
									int LocalPlayer = readInt(BaseAdressClientDLL + _localPlayer);
									int jump = readInt(LocalPlayer + _mflags);
									FoundCSGO = true;
								}
							}
						}
					}
				}
				else
				{
					int LocalPlayer = readInt(BaseAdressClientDLL + _localPlayer);
					int jump = readInt(LocalPlayer + _mflags);
					if (GetAsyncKeyState(0x20) != 0 && jump != 1)
					{
						keybd_event(0x20, 0x39, 0, 0);
						keybd_event(0x20, 0x39, 0x2, 0);
						Thread.Sleep(5);
					}
				}
			}
		}
		public static int readInt(int address)
		{
			byte[] buffer = new byte[4];
			ReadProcessMemory(pHandle, address, buffer, 4, 0);
			return BitConverter.ToInt32(buffer, 0);
		}
	}
}
Code:
 [DllImport("user32.dll")]
        private static extern void mouse_event(
        UInt32 dwFlags,
        UInt32 dx,
        UInt32 dy,
        UInt32 dwData,
        IntPtr dwExtraInfo
        );

        [DllImport("User32.Dll")]
        public static extern long SetCursorPos(int x, int y);

        [DllImport("User32.Dll")]
        public static extern bool ClientToScreen(IntPtr hWnd, ref POINT point);

        [StructLayout(LayoutKind.Sequential)]
        public struct POINT
        {
            public int x;
            public int y;
        }
Code:
 if (GetAsyncKeyState(0x20) != 0)
                    {
                        int LocalPlayer = readInt(BaseAdressClientDLL + 0xA7D4CC);
                        int Ground = readInt(LocalPlayer + 0x100);
                        if (Ground > 0 && Ground == 257)
                        {
                            const UInt32 MOUSEEVENTF_RIGHTDOWN = 0x0020;
                            const UInt32 MOUSEEVENTF_RIGHTUP = 0x0040;

                            int cursorLocation = 0;
                            int cursornLocation = 0;

                            UInt32 x = Convert.ToUInt32(cursorLocation);
                            UInt32 y = Convert.ToUInt32(cursornLocation);

                            mouse_event(MOUSEEVENTF_RIGHTDOWN, x, y, 0, new IntPtr());
                            mouse_event(MOUSEEVENTF_RIGHTUP, x, y, 0, new IntPtr());
                        }
                    }
Bind your middlemousebutton to jump in cs go
Quote Originally Posted by fullweeb View Post
I'm trying to make a bhop hack that works better than say an ahk script. All I can seem to find info on, is checking if the player is on the ground then sending a jump input. Not sure what I'm doing wrong but mine works like an ahk script, where it just seems to be spamming jump constantly and doesn't actually give good bhops. You have to strafe and everything. I want it to make it as easy as possible to bhop without writing to memory. (since I've read that'll make it detected a lot easier.)

Also it gets stuck. Like it jumps even when you're not pressing the jump key.

Any help would be fantastic.

Anyway here's my code:

Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System****;
using System.Diagnostics;
using System.Numerics;
using System.Runtime.InteropServices;

namespace bhop
{
	class Program
	{
		[DllImport("kernel32.dll")]
		public static extern int OpenProcess(uint dwDesiredAccess, bool bInheritHandle, int dwProcessId);
		[DllImport("kernel32.dll")]
		public static extern bool ReadProcessMemory(int hProcess, int lpBaseAddress, byte[] buffer, int size, int lpNumberOfBytesRead);
		[DllImport("user32.dll")]
		static extern void mouse_event(uint dwFlags, uint dx, uint dy, uint dwData, UIntPtr dwExtraInfo);
		[DllImport("user32.dll")]
		public static extern short GetAsyncKeyState(int vKey);
		[DllImport("user32.dll")]
		static extern void keybd_event(byte bVk, byte bScan, uint dwFlags, int dwExtraInfo);

		static int BaseAdressClientDLL = 0;
		static int pHandle = 0;

		const int _localPlayer = 0x00A7D4CC;
		const int _entityList = 0x04A98154;
		const int _mflags = 0x00000100;
		const int FL_ONGROUND = 257;


		static void Main(string[] args)
		{

			bool FoundCSGO = false;
			while (true)
			{
				if (FoundCSGO == false)
				{
					foreach (Process Proc in Process.GetProcesses())
					{
						if (Proc.ProcessName.Equals("csgo"))
						{
							pHandle = OpenProcess(0x001F0FFF, false, Proc.Id);
							foreach (ProcessModule Module in Proc.Modules)
							{
								if (Module.ModuleName.Equals("client.dll"))
								{
									BaseAdressClientDLL = (int)Module.BaseAddress;
									int LocalPlayer = readInt(BaseAdressClientDLL + _localPlayer);
									int jump = readInt(LocalPlayer + _mflags);
									FoundCSGO = true;
								}
							}
						}
					}
				}
				else
				{
					int LocalPlayer = readInt(BaseAdressClientDLL + _localPlayer);
					int jump = readInt(LocalPlayer + _mflags);
					if (GetAsyncKeyState(0x20) != 0 && jump != 1)
					{
						keybd_event(0x20, 0x39, 0, 0);
						keybd_event(0x20, 0x39, 0x2, 0);
						Thread.Sleep(5);
					}
				}
			}
		}
		public static int readInt(int address)
		{
			byte[] buffer = new byte[4];
			ReadProcessMemory(pHandle, address, buffer, 4, 0);
			return BitConverter.ToInt32(buffer, 0);
		}
	}
}
You should read the Player's flags as a BYTE.

It's 1 if you are on the ground, and zero if you are in the air.

You are currently jumping if it's zero, which means if you are in the air.

A simple switch of operators would fix your issue.

Check if the Player's flags ( jump ) is 1, and if so, jump.
Quote Originally Posted by WasserEsser View Post
You should read the Player's flags as a BYTE.

It's 1 if you are on the ground, and zero if you are in the air.

You are currently jumping if it's zero, which means if you are in the air.

A simple switch of operators would fix your issue.

Check if the Player's flags ( jump ) is 1, and if so, jump.
hmm, I tried looking for some source to reference to see what you mean, and I've had no luck.

Mind giving me an example?

Here's what I have currently:
Code:
if (GetAsyncKeyState(0x20) != 0)
{
	int LocalPlayer = readInt(BaseAdressClientDLL + 0x00A7D4CC);
	int Ground = readInt(LocalPlayer + 0x100);
	if (Ground > 0 && Ground == 257)
	{
	        keybd_event(0x20, 0x39, 0, 0);
		Thread.Sleep(1);
		keybd_event(0x20, 0x39, 0x2, 0);
	}
}
Quote Originally Posted by fullweeb View Post
hmm, I tried looking for some source to reference to see what you mean, and I've had no luck.

Mind giving me an example?

Here's what I have currently:
Code:
if (GetAsyncKeyState(0x20) != 0)
{
	int LocalPlayer = readInt(BaseAdressClientDLL + 0x00A7D4CC);
	int Ground = readInt(LocalPlayer + 0x100);
	if (Ground > 0 && Ground == 257)
	{
	        keybd_event(0x20, 0x39, 0, 0);
		Thread.Sleep(1);
		keybd_event(0x20, 0x39, 0x2, 0);
	}
}
Code:
if (GetAsyncKeyState(0x20) != 0)
{
	int LocalPlayer = readInt(BaseAdressClientDLL + 0x00A7D4CC);
	byte Ground = readByte(LocalPlayer + 0x100);
	if ( Ground & ( 1 << 0 ) ) // or if ( Ground ) or if ( Ground == 1 )
	{
	        keybd_event(0x20, 0x39, 0, 0);
		Thread.Sleep(1);
		keybd_event(0x20, 0x39, 0x2, 0);
	}
}
Quote Originally Posted by WasserEsser View Post
Code:
if (GetAsyncKeyState(0x20) != 0)
{
	int LocalPlayer = readInt(BaseAdressClientDLL + 0x00A7D4CC);
	byte Ground = readByte(LocalPlayer + 0x100);
	if ( Ground & ( 1 << 0 ) ) // or if ( Ground ) or if ( Ground == 1 )
	{
	        keybd_event(0x20, 0x39, 0, 0);
		Thread.Sleep(1);
		keybd_event(0x20, 0x39, 0x2, 0);
	}
}
How would I make this readByte method?

For instance, the readInt method looks like this:
Code:
public static int readInt(int address)
		{
			byte[] buffer = new byte[4];
			ReadProcessMemory(pHandle, address, buffer, 4, 0);
			return BitConverter.ToInt32(buffer, 0);
		}
I tried making a readByte method in a similar fashion but can't quite get it. Sorry for the noob questions haha.
Quote Originally Posted by fullweeb View Post
How would I make this readByte method?

For instance, the readInt method looks like this:
Code:
public static int readInt(int address)
		{
			byte[] buffer = new byte[4];
			ReadProcessMemory(pHandle, address, buffer, 4, 0);
			return BitConverter.ToInt32(buffer, 0);
		}
I tried making a readByte method in a similar fashion but can't quite get it. Sorry for the noob questions haha.
Code:
        public static byte ReadByte(int address)
        {
            byte[] array = new byte[1];
            ReadProcessMemory(pHandle, address, array, 1, 0);
            return array[0];
        }
Something like this should work.
Quote Originally Posted by Jasmine View Post
Code:
        public static byte ReadByte(int address)
        {
            byte[] array = new byte[1];
            ReadProcessMemory(pHandle, address, array, 1, 0);
            return array[0];
        }
Something like this should work.
Tried it out and it's behaving the same way. Jumps once, then either doesn't jump at all or jumps after a few seconds. Once in a while it'll jump a little bit after I land. Either way, it's not bhopping.

- - - Updated - - -

Ok, I fixed it and got it working now. Thanks for all your help, everyone.

For those interested, what I did was make it send keyboard inputs for a different key that was bound to jump in game, and unbound space to jump in-game. For some reason, it doesn't work if you have it the way i did.
Quote Originally Posted by fullweeb View Post
Tried it out and it's behaving the same way. Jumps once, then either doesn't jump at all or jumps after a few seconds. Once in a while it'll jump a little bit after I land. Either way, it's not bhopping.

- - - Updated - - -

Ok, I fixed it and got it working now. Thanks for all your help, everyone.

For those interested, what I did was make it send keyboard inputs for a different key that was bound to jump in game, and unbound space to jump in-game. For some reason, it doesn't work if you have it the way i did.
that sounds like the bug polymeme bhop has...
Quote Originally Posted by fullweeb View Post
Tried it out and it's behaving the same way. Jumps once, then either doesn't jump at all or jumps after a few seconds. Once in a while it'll jump a little bit after I land. Either way, it's not bhopping.

- - - Updated - - -

Ok, I fixed it and got it working now. Thanks for all your help, everyone.

For those interested, what I did was make it send keyboard inputs for a different key that was bound to jump in game, and unbound space to jump in-game. For some reason, it doesn't work if you have it the way i did.
Quote Originally Posted by chenjunhua View Post
that sounds like the bug polymeme bhop has...
It's an obvious bug.

If you check for your spacebar to be pressed, and if it is and if you are on the ground, you press it again and release it.

How should the check if you press the spacebar work now?

If you use keybd_event, you cant use the same key you use to check if its pressed to jump.
Been over a week since last update/bump, assuming solved.

/Closed.
Posts 1–11 of 11 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Talk with us