(off topic) anyone know how to make ce auto assembly repeatly scan and replace the aob until no more scan result found (i need this for unity game) thank you :D
ps. this is what i'm using right now, which is really slow as hell (30 sec. ~ 1 min. total time and it make my cheat engine hang a bit) and want to know the proper method http://i.imgur.com/SbQMwbU.png
You may try simulate auto-assembler (aa) with lua.
Here a framework:
{$lua}
function run(enable,skip)-- has to be global function
if skip==true then return end -- skip when syntaxcheck, ie. when pressing script window 'OK' to save the script.
local ok,script = true,''
if enable==true then -- simulate [ENABLE] section
print('enable')
if ok then -- scan #1
local aob = AOBScan('12 34 56 78 ff ff','-X') -- lua aobscan can set protection flag
if aob~= nil then
for i=0,aob.Count-1 do
script = script .. string.format([[
%s+02:
db 00 00
%s+08:
db 00 00
]],aob[i],aob[i]) -- put more to match %s if need
end
aob.Destroy() -- clean up
else
ok = false -- stop further execution for no scan result
end
end -- scan #1
if ok then -- scan #2
local aob = AOBScan('12 34 56 78 ff ff','-X) -- lua aobscan can set protection flag
if aob~= nil then
for i=0,aob.Count-1 do
script = script .. string.format([[
%s+02:
db 00 00
]],aob[i]) -- put more to match %s if need
end
aob.Destroy() -- clean up
else
ok = false -- stop further execution for no scan result
end
end -- scan #2
-- etc.
else -- simulate [DISABLE] section
print('disable')
return true --- RETURN HERE since no script need to execute
end
-- actually execute the aa script
ok = ok and script:len()>0 and autoAssemble(script) -- return true only everything 'ok' ;)
-- signal error by assert if script failed
return assert(ok)
end
{$asm}
[ENABLE]
{$lua}
return run(true,syntaxcheck) -- luacall won't work
{$asm}
[DISABLE]
{$lua}
return run(false,syntaxcheck)
{$asm}
If the original aa is more complicated, eg. involve a few more scan and using readmem etc., the lua may has to changed respectively
================
not really offtopic,
KH script need not follow exactly CE AA Script.
May be KH script include some variant of aobscan,
eg. AOBScanOne to only return 1st match,
while AOBScanMany to apply the script for each result?
But it may have problem if more than 2 AOBScanMany in one script,
since it is undefined to interact with respective results,
if result1 = {1,2,3},result2={a,b,c}
eg. should result1 pair up with nearest result2,
script(1,a)
script(2,b)
script(3,c)
or should result1 cross-product with result2?
script(1,a),script(2,a),script(3,a)
script(1,b),script(2,b),script(3,b)
script(1,c),script(2,c),script(3,c)
Or, just only allow one AOBScanMany in one script.
No +karma or thanks post please,
we shall exchange appreciation via telepathy ;)