load offset in cheat class

This commit is contained in:
Mylloon 2023-03-30 13:03:32 +02:00
parent b542f38c9c
commit 85c29fe9a7
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

22
main.py
View file

@ -8,16 +8,27 @@ from win32api import GetAsyncKeyState
class Hack():
def __init__(self) -> None:
# Loading offsets
self.offsets = self._find_offsets()
self.cheats_list = [func for func in dir(self)
# Function
if callable(getattr(self, func))
# User defined
if not (func.startswith("__") and func.endswith("__"))
# Blacklist
if func not in ["_find_process", "find_module"]]
if func not in ["_find_offsets",
"_find_process",
"find_module"]]
self.pm = self._find_process(True)
def _find_offsets(self) -> dict[str, int]:
hazedumper_data = get(
"https://raw.githubusercontent.com/frk1/hazedumper/master/csgo.min.json")
serial_data = loads(hazedumper_data.text)
return serial_data["signatures"] | serial_data["netvars"]
def _find_process(self, verbose: bool = False) -> Pymem:
"""Find game process"""
process_found = False
@ -50,7 +61,9 @@ class Hack():
raise MemoryError
def bhop(self) -> None:
# Aliases
mem = self.pm
offset = self.offsets
# Get module address
client = self.find_module("client")
@ -81,15 +94,10 @@ class Hack():
if __name__ == "__main__":
# Loading offsets
hazedumper_data = get(
"https://raw.githubusercontent.com/frk1/hazedumper/master/csgo.min.json")
serial_data = loads(hazedumper_data.text)
offset = serial_data["signatures"] | serial_data["netvars"]
# Cheat
c = Hack()
# Cheat list
print("Enter 0 to exit.")
print("Available cheats:")
for idx, cheat in enumerate(c.cheats_list):