vsantiago113 / ReadWriteMemory

This module can read and write to the memory of any process on Windows.
MIT License
150 stars 36 forks source link

Offsets not working. #6

Open chemicaldawn opened 4 years ago

chemicaldawn commented 4 years ago
from ReadWriteMemory import ReadWriteMemory
import struct

input("Press ENTER to bind to Among Us.exe")
reader = ReadWriteMemory()

process = reader.get_process_by_name('Among Us.exe')
process.open()

y_pos_pointer = process.get_pointer(0x0532C2a0, offsets=[0x30])

while True:
    y_pos = process.read(y_pos_pointer)
    y_pos = struct.unpack('f',struct.pack("I", y_pos))[0]

    print(y_pos)

process.close()

Here is my code. I'm trying to access the address 0x0532C2d0 using the address 0x0532C2a0 and the offset 30. Putting the address in without an offset works, but using an address plus an offset won't.

Here's the pointer in cheat engine. image

shiv213 commented 4 years ago

Having the exact same issue

shiv213 commented 4 years ago

Solved it! @Missingpyxel you need to add the base address (of the DLL which in your case is GameAssembly.dll) to the beginning of the address in the get_pointer function. Example:

memory_pointer = process.get_pointer(0x7A590000+0x0532C2a0, offsets=[0x30])
cradules commented 2 years ago

@shiv213 how did you get the base address?

evanwheelrr commented 1 year ago

@shiv213 how did you get the base address? double click on your pointer and you should see a box on the bottom left with the game name in it.You can than highlight it and the address is to the right aide of it in the box