From d99bad051641b28a1241f12f3936e599c29cf2ba Mon Sep 17 00:00:00 2001 From: Mylloon Date: Fri, 5 May 2023 16:58:30 +0200 Subject: [PATCH] add moneyreveal cheat --- cheats/moneyreveal.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 cheats/moneyreveal.py diff --git a/cheats/moneyreveal.py b/cheats/moneyreveal.py new file mode 100644 index 0000000..f646380 --- /dev/null +++ b/cheats/moneyreveal.py @@ -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)