0

I want to read the memory pointer of Rust (game) I want to read the health values, now I did find the right pointers I think but my code will not work for some reason. I tryed multiple languages but noting works for me, the only thing that works is cheat engine but I dont want to used that because its super detectable and I dont even want to cheat:))). I want to make a funny bot but there for I need the health values, I cant get without cheat engine.

These is one of the errors I got I think I am really close for this to work but I am stuck at this for dayyyyy:(((((.

This is the error:

Traceback (most recent call last):
  File "C:\Users\Desktop\pls work.py", line 7, in <module>
    healthpointer = process.get_pointer(baseaddress, offsets=[0xB0, 0xB20, 0x224])
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\ReadWriteMemory\__init__.py", line 77, in get_pointer
    temp_address = self.read(lp_base_address)
  File "C:\Users\AppData\Local\Programs\Python\Python310\lib\site-packages\ReadWriteMemory\__init__.py", line 100, in read
    ctypes.windll.kernel32.ReadProcessMemory(self.handle, lp_base_address, lp_buffer,
ctypes.ArgumentError: argument 2: <class 'OverflowError'>: int too long to convert

This is my code:

from ReadWriteMemory import ReadWriteMemory

rwm = ReadWriteMemory()
process = rwm.get_process_by_name("RustClient.exe")
process.open()
baseaddress = 0x7FF78DED0000+0x305CAE8
healthpointer = process.get_pointer(baseaddress, offsets=[0xB0, 0xB20, 0x224])

while 1:
    value = process.read(healthpointer)
    print(value)

I hope someone who know what there doing can help me, I am really noob at coding btw:) and sorry for my bad english its not my main language.

  • Maybe your Python is 32bit and your game is 64bit... – CherryDT Nov 30 '21 at 18:24
  • 3
    and 0x7FF78DED0000 is about 18 terabytes into your memory. – JeffUK Nov 30 '21 at 18:25
  • @JeffUK What does that mean, this is the prefert memory address where the game is running. – Mistercat Nov 30 '21 at 19:41
  • @CherryDT My Python is running on 64bit and my game to, so I don't think that is the problem – Mistercat Nov 30 '21 at 19:42
  • @JeffUK ...into the 16 exabytes of **virtual** memory, yes... therefore not relevant – CherryDT Nov 30 '21 at 19:51
  • @CherryDT Can i change that or is that inposible? – Mistercat Nov 30 '21 at 19:53
  • @Mistercat OK then the issue is that the package you used, `ReadWriteMemory`, doesn't support 64-bit targets. [Seems it's a known issue](https://github.com/vsantiago113/ReadWriteMemory/issues/4). The person who opened (and closed) the GitHub issue said they are using `PyMem` now, maybe you want to try that instead. – CherryDT Nov 30 '21 at 19:53

1 Answers1

0

ReadWriteMemory read a 32-bits and ur game is a 64-bits

u have to use PYMem

from pymem import Pymem
from pymem.process import module_from_name

def main():
    # Health offsets
    # piture : [https://ibb.co/z2fN3Pz][2]
    health_offsets = [0xB8, 0x0, 0x58, 0x90, 0x98, 0x1F4]

    # Initialize Pymem with the process name
    pm = Pymem('RotMG Exalt.exe')

    # piture : [https://ibb.co/Q84Q9g2][2]
    # "GameAssembly.dll"+03C338C8
    game_module = module_from_name(pm.process_handle, 'GameAssembly.dll').lpBaseOfDll

    def GetPointer(base, offsets):
        """
        Follows a series of pointers to get a value from memory.
        """
        addr = pm.read_longlong(base+0x03C338C8) # here was the problem "int too long"
        for i in offsets:
            if i != offsets[-1]:
                addr = pm.read_longlong(addr + i)
        return pm.read_int(addr + offsets[-1]) # Here its read 4-bytes

    # Continuously print the player's health
    while True:
        try:
            health = GetPointer(game_module, health_offsets)
            print(health)
        except Exception as e:
            print(f'Error: {e}')

if __name__ == '__main__':
    main()
user11717481
  • 1
  • 9
  • 15
  • 25
CodPlay
  • 1
  • 1