add moneyreveal cheat

This commit is contained in:
Mylloon 2023-05-05 16:58:30 +02:00
parent 1b3712ec24
commit d99bad0516
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

40
cheats/moneyreveal.py Normal file
View file

@ -0,0 +1,40 @@
from hack import Hack
from re import search
class Moneyreveal(Hack):
def __init__(self, **kwargs) -> None:
super().__init__(**kwargs)
self.__adress = self.__get_address(self.pm)
self.__default = 0x75
def __get_address(self, mem) -> int:
client = 0
clientModule = b""
for internal_module in list(mem.list_modules()):
if internal_module.name == "client.dll":
client = internal_module.lpBaseOfDll
clientModule = mem.read_bytes(client, internal_module.SizeOfImage)
break
offset = search(rb".\x0C\x5B\x5F\xB8\xFB\xFF\xFF\xFF", clientModule)
if offset is not None:
print(offset.start())
return client + offset.start()
else:
raise Exception("Offset not found for Money Reveal")
def moneyreveal(self) -> None:
"""
For this one, we're not using regular self.find_module and offsets
methods because we regexing client.dll for a specific chunk of memory.
Once we have what we want, we can change values.
Moreover, change persists across game, so we only write once.
"""
# Get module address
self.pm.write_uchar(self.__adress, 0xEB)
def moneyreveal_unload(self):
# Reset to default value
self.pm.write_uchar(self.__adress, self.__default)