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);
}
}
}