Closed MonteyMontey closed 4 years ago
Could you share a screenshot of Cheat Engine with that address on it? The address seem to be incorrect but I could be wrong.
That's how the addresses for my value look now:
What version of the game are you using? Can you send me the steam url of the game? I want to download the game to do some troubleshooting.
That game has a 32bit and a 64bit version? I ask to see if you are using the 64bit version and if you could try the 32bit version.
Or maybe change the "read_buffer = ctypes.c_uint()" to "read_buffer = ctypes.c_ulong()" in the function below and then give that a try.
def read(self, lp_base_address: int) -> Any:
"""
Read data from the process's memory.
:param lp_base_address: The process's pointer
:return: The data from the process's memory if succeed if not raises an exception.
"""
try:
read_buffer = ctypes.c_uint()
It's not on steam unfortunately but you can download it for free at Uplay . I'm trying to read the speed at the back of the car if that matters.
For this version of the game, there's only one version as far as I'm concerned and I tried your suggested change but now I get ctypes.ArgumentError: argument 5: <class 'TypeError'>: wrong type
instead.
@MonteyMontey show exactly the part of the code you are using to help you, in case you have already solved it, please close the PR
I am also using this module for my BOT, however I had to make a modification to get the pointers correctly, this is how I fixed it:
def get_pointer_modified(self, lp_base_address: hex, offsets: List[hex] = ()) -> int:
"""
Get the pointer of a given address.
:param lp_base_address: The address from where you want to get the pointer.
:param offsets: a list of offets.
:return: The pointer of a give address.
"""
if not offsets:
return lp_base_address
else:
for offset in offsets:
lp_base_address = self.read(lp_base_address) + int(offset)
return lp_base_address
You can take a look at my fork if you need to read / write text strings to memory.
Thanks, I used Pymem instead, so I didn't try it any further. I closed the issue.
I used Cheat Engine to find the memory address for a 4 bytes value of a process on Windows. The address was 262F337041C but when I do process.get_pointer(0x262F337041C) I get:
ctypes.ArgumentError: argument 2: <class 'OverflowError'>: int too long to convert
. Any idea why this is happening?