This commit is contained in:
Mylloon 2023-03-30 13:00:39 +02:00
parent 49412e3eb8
commit b542f38c9c
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
2 changed files with 24 additions and 23 deletions

View file

@ -1 +1 @@
[Get latest offset](https://github.com/frk1/hazedumper/blob/master/csgo.json) # CSGOHACKS

45
main.py
View file

@ -8,17 +8,17 @@ from win32api import GetAsyncKeyState
class Hack(): class Hack():
def __init__(self) -> None: def __init__(self) -> None:
self.running = False
self.cheats_list = [func for func in dir(self) self.cheats_list = [func for func in dir(self)
# Function # Function
if callable(getattr(self, func)) if callable(getattr(self, func))
# User defined # User defined
if not (func.startswith("__") and func.endswith("__")) if not (func.startswith("__") and func.endswith("__"))
# Blacklist # Blacklist
if func not in ["find_process"]] if func not in ["_find_process", "find_module"]]
def find_process(self, verbose: bool = False) -> Pymem: self.pm = self._find_process(True)
def _find_process(self, verbose: bool = False) -> Pymem:
"""Find game process""" """Find game process"""
process_found = False process_found = False
print("Looking for process...") if verbose else None print("Looking for process...") if verbose else None
@ -38,24 +38,25 @@ class Hack():
return pm return pm
exit(1) exit(1)
def bhop(self) -> None: def find_module(self, module: str):
# Offsets found = None
LOCAL_PLAYER = offset["dwLocalPlayer"] for internal_module in list(self.pm.list_modules()):
HEALTH = offset["m_iHealth"] if internal_module.name == module + ".dll":
FLAGS = offset["m_fFlags"] found = internal_module.lpBaseOfDll
FORCE_JUMP = offset["dwForceJump"]
pm = self.find_process(True) if found:
return found
else:
raise MemoryError
def bhop(self) -> None:
mem = self.pm
# Get module address # Get module address
client = None client = self.find_module("client")
for module in list(pm.list_modules()):
if module.name == "client.dll":
client = module.lpBaseOfDll
# Hack loop # Hack loop
self.running = True while True:
while self.running:
# Reduce CPU usage # Reduce CPU usage
sleep(0.01) sleep(0.01)
@ -64,19 +65,19 @@ class Hack():
continue continue
# Get local player # Get local player
local_player = pm.read_uint(client + LOCAL_PLAYER) local_player = mem.read_uint(client + offset["dwLocalPlayer"])
if not local_player: if not local_player:
continue continue
# Check if player is alive # Check if player is alive
if not pm.read_int(local_player + HEALTH): if not mem.read_int(local_player + offset["m_iHealth"]):
continue continue
# Check if player on ground # Check if player on ground
if pm.read_uint(local_player+FLAGS) & (1 << 0): if mem.read_uint(local_player + offset["m_fFlags"]) & (1 << 0):
pm.write_uint(client + FORCE_JUMP, 5) mem.write_uint(client + offset["dwForceJump"], 5)
sleep(0.01) sleep(0.01)
pm.write_uint(client + FORCE_JUMP, 4) mem.write_uint(client + offset["dwForceJump"], 4)
if __name__ == "__main__": if __name__ == "__main__":