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 


Extended AOBScan with address range

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials
View previous topic :: View next topic  
Author Message
panraven
Grandmaster Cheater
Reputation: 54

Joined: 01 Oct 2008
Posts: 941

PostPosted: Wed Nov 12, 2014 3:18 pm    Post subject: Extended AOBScan with address range Reply with quote

Code:
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)
  ms.firstScan(soExactValue,vtByteArray,nil,aob,nil,s,e,p,a,n,true,false,false,false)
  ms.waitTillDone()
  fl.initialize()
  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
  end
  fl.destroy()
  ms.destroy()
  return result
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,
Code:
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.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Tutorials -> LUA Tutorials 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 cannot download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites