This repository has been archived on 2023-09-02. You can view files and clone it, but cannot push or open issues or pull requests.
csh/main.py
2023-03-30 11:26:52 +02:00

47 lines
1 KiB
Python

from time import sleep
from pymem import Pymem
from win32api import GetAsyncKeyState
# offsets
LOCAL_PLAYER = 14596452
FORCE_JUMP = 86756784
HEALTH = 256
FLAGS = 260
def bhop() -> None:
pm = Pymem("csgo.exe")
# Get module address
for module in list(pm.list_modules()):
if module.name == "client.dll":
client = module.lpBaseOfDll
# Hack loop
while True:
# Reduce CPU usage
sleep(0.01)
# Space bar detection
if not GetAsyncKeyState(ord(" ")):
continue
# Get local player
local_player: int = pm.read_uint(client + LOCAL_PLAYER)
if not local_player:
continue
# Check if player is alive
if not pm.read_int(local_player + HEALTH):
continue
# Check if player on ground
if pm.read_uint(local_player+FLAGS) & 1 << 0:
pm.write_uint(client + FORCE_JUMP, 6)
sleep(0.01)
pm.write_uint(client + FORCE_JUMP, 4)
if __name__ == "__main__":
bhop()