load offset in cheat class
This commit is contained in:
parent
b542f38c9c
commit
85c29fe9a7
1 changed files with 15 additions and 7 deletions
22
main.py
22
main.py
|
@ -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):
|
||||
|
|
Reference in a new issue