Pymem
Pymem copied to clipboard
Undoing memory changes
Hey, I'm trying to write some bytes to the memory of a game but after that undo the changes, how could I go about that? Currently doing
address = assembly.lpBaseOfDll + re.search(rb'\x80\xBB.....\x74\x09\x80\xBB.....', assemblyModule).start()
game.write_bytes(address, b"\x90\x90\x90\x90\x90\x90\x90\x90\x90", 9)
game.close_process()
Should I like
print(game.read_bytes(address, 9))
to get the original bytes and then just
game.write_bytes(address, b"\whatever the print above gave me", 9)
or is that the wrong way of approaching it
You can simply save result of 'address' to another temp variable, then override it with your code and at the end write temp variable into process.