Joined: 01 Oct 2008
|Posted: Wed Nov 12, 2014 3:18 pm Post subject: Extended AOBScan with address range
|local function AOBScanEx(aob,p,a,n,s,e,pb)
local p,a,n,s,e = p or '*X*W',a or fsmNotAligned,n or '0',s or 0x0,e or 0xffffffffffffffff
local ms = pb and createMemScan(pb) or createMemScan()
local fl = createFoundList(ms)
local result = nil
if fl ~= nil and fl.getCount() > 0 then
result = createStringlist()
for i=1,fl.getCount() do result.add(fl.getAddress(i-1)) end
This extend the original AOBScan (non bytes table version) with optional starting address, ending address and progress bar. It create a MemScan and a FoundList object and destroy after scanning, and return a string_list object, same as the original AOBScan.
After the AOBScanEx definition, with this assignment,
|local AOBScan = AOBScanEx |
your code using original AOBScan should behave the same. The original global AOBScan is still there, but only will be called in scope where the local AOBScan not applied.
It is convenient to scan in a known memory range, eg the 2M PSX working ram on a emu.