-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathaobscanregion and aobscanmodule.lua
More file actions
42 lines (38 loc) · 1.26 KB
/
aobscanregion and aobscanmodule.lua
File metadata and controls
42 lines (38 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
--https://forum.cheatengine.org/viewtopic.php?p=5747559#5747559
--[[ SETUP ]]--
function AOBScanAA(script, symbol)
local success,disableInfo = autoAssemble(script)
if not success then return nil, disableInfo end -- disableInfo is error message on failure
local addr = getAddress(symbol)
autoAssemble(script, disableInfo) -- disable script and unregister symbol
return addr, 'success'
end
function AOBScanRegion(bytestr, start, stop)
local script = ([[
[ENABLE]
aobscanregion(luaAOBScanRegionSymbol,%X,%X,%s)
registersymbol(luaAOBScanRegionSymbol)
[DISABLE]
unregistersymbol(luaAOBScanRegionSymbol)
]]):format(getAddress(start), getAddress(stop), bytestr)
return AOBScanAA(script, 'luaAOBScanRegionSymbol')
end
function AOBScanModule(bytestr, module)
local script = ([[
[ENABLE]
aobscanmodule(luaAOBScanModuleSymbol,%s,%s)
registersymbol(luaAOBScanModuleSymbol)
[DISABLE]
unregistersymbol(luaAOBScanModuleSymbol)
]]):format(module, bytestr)
return AOBScanAA(script,'luaAOBScanModuleSymbol')
end
--[[ TESTING ]]--
-- Tutorial step 1 load
--local addr,msg = AOBScanRegion('8B 83 80040000', 0x00423000, 0x00424000)
local addr,msg = AOBScanModule('8B 83 80040000', process)
if addr then
print(('0x%X'):format(addr))
else
print(msg)
end