Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


How does lua's aob specify a module to search?

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
yazigegeda
Expert Cheater
Reputation: 0

Joined: 22 Jan 2019
Posts: 183

PostPosted: Wed Apr 03, 2019 5:06 pm    Post subject: How does lua's aob specify a module to search? Reply with quote

The aob of the ceaa script can specify the module search. Can the aob of lua not specify the module search?
Back to top
View user's profile Send private message
FreeER
Grandmaster Cheater Supreme
Reputation: 53

Joined: 09 Aug 2013
Posts: 1091

PostPosted: Thu Apr 04, 2019 8:04 am    Post subject: Reply with quote

no there's not a lua function that restricts it to a module, though you can use autoAssemble to build and assemble an AA script that registers a symbol and use aobscanmodule or aobscanregion in lua that way.

Code:

--[[ 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


There's also the memscan object that has all the same options as the gui including read/write/executable flags

_________________
https://github.com/FreeER/ has a few CE related repos


Last edited by FreeER on Thu Apr 04, 2019 8:13 am; edited 1 time in total
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25830
Location: The netherlands

PostPosted: Thu Apr 04, 2019 8:12 am    Post subject: Reply with quote

aobscan is just a memscan call in one line
memscan can be given a range to scan, so if you give it the range of a module it'll be the same

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites