qb-0 / pyMeow

Python Game Hacking Library

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add function for array of bytes scan

NyshMy opened this issue · comments

aob scan

commented

Done.
093a841

Sorry to revive an old topic. I've been trying to use aob_scan_range for awhile to no prevail. I keep getting an out of memory error (my python is 64bit). I've looked at the cheatsheet for awhile and was wondering if you could post an example. I would greatly appreciate it

commented

The "issue" with aob_scan_range which you got is that the range scan currently doesn't checks for page memory allocations. So you need to make sure that you define a range between memory pages. You can check memory regions on Cheat Engine with Memory View -> View -> Memory Regions:
Bildschirmfoto vom 2022-11-06 12-05-00
So in this process you could use a range between 0x00400000 and 0x00401000 for example.
This will be automated in the future.

POC for the current range scan:

import pyMeow as pm

bytebuf = [0x0, 0x0, 0x0, 0xAB, 0xC0, 0x10, 0x20, 0x40, 0xF8, 0xD0]
pattern = "00 00 AB C0 10 20"
proc = pm.open_process(processName="notepad.exe", debug=True)
address = pm.allocate_memory(proc, 100)
pm.w_bytes(proc, address, bytebuf)

scan = pm.aob_scan_range(proc, pattern, address, address + 100, relative=True)
if scan:
    print(scan[0])

Make sure to reinstall the current release btw. I've made a small aob scan update which wasn't documented 👀