I need function in python to read a value from a specific memory address on Linux . I've a PID process and memory address '4df0568'. i try using ctypes, ptrace.
sample: a int32 value on adress '4df0568' = 3065
i need a loop function to read this address and return a int value.
note: this is a game memory address
EDIT: this a SoLUTION
pid = 4563
address=0x4df0568 # top of stack (have a look at /proc/{pid}/maps for the interesting addresses)
fd = open(f"/proc/{pid}/mem", "rb")
fd.seek(address)
value = fd.read(4) # read an int32
print(int.from_bytes(value, byteorder='little'))