FreeER Grandmaster Cheater Supreme Reputation: 53 Joined: 09 Aug 2013 Posts: 1091
|
Posted: Mon Jan 08, 2018 12:09 pm Post subject: |
|
|
I know this has come up before, not sure if there was a simple solution mentioned at the time however...
AA has aobscanregion so you might be able to use autoassemble to do the job
(disclaimer, untested code)
Code: | -- returns first result or nil
function AOBScanRegion(aob, start, end)
-- temporary symbol name to register (should be unique of course)
local aobscanregionSymbol = 'aobscanregionSymbol'
local script = [[aobscanregion(%s, %s, %s, %s)
registerSymbol(%s)]]
if type(start) == 'number' then start = ('%X'):format(start) end
if type(end) == 'number' then end = ('%X'):format(end) end
script = script:format(aobscanregionSymbol, start, end, aob)
local result = autoAssemble(script)
if not result return nil end
local address = getAddress(aobscanregionSymbol)
unregisterSymbol(aobscanregionSymbol)
return address
end |
otherwise you'd probably need to make use of the memscan class
Code: | -- returns stringlist of results or nil
function AOBScanRegion(aob, start, end)
local ms = createMemscan()
ms.firstScan(soExactValue, vtByteArray, '', aob, '', start,end,'',fsmNotAligned,
'' ,true,true, false, false)
local sl
ms.OnScanDone(function(ms)
local fl = createFoundList(ms)
fl.initialize()
if fl.Count > 0 then
sl = createStringList()
for i=0, fl.Count-1 do
sl.add(fl.Address[i])
end
end
fl.deinitialize()
fl.destroy()
ms.destroy()
end)
ms.WaitTillDone()
return sl
end |
|
|