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 


find next access script

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine Lua Scripting
View previous topic :: View next topic  
Author Message
pellik
Advanced Cheater
Reputation: 0

Joined: 14 Jun 2013
Posts: 93

PostPosted: Thu Jul 04, 2013 11:04 pm    Post subject: find next access script Reply with quote

This little script has been saving me some time when exploring games. I didn't see anything like it during my 5 second search, so my apologies if there is already a way to do this easily.

Code:
if not OriginAddress then OriginAddress = 0 end
if not WatchMem then WatchMem = 0 end
DeleteOrgBreak = 1
Skip = 0
OriginAddress = 0

function debugger_onBreakpoint()
         if OriginAddress == 0 then
            OriginAddress = EIP
            WatchMem = (EBP - 0x38) -- Memory Address To Watch (can be static)
            debug_setBreakpoint(WatchMem,1,bptAccess)
            if DeleteOrgBreak == 1 then
               debug_removeBreakpoint(OriginAddress)
            end
            debug_continueFromBreakpoint(0)
         elseif Skip > 0 then
            Skip = Skip - 1
            debug_continueFromBreakpoint(0)
         else
             debug_removeBreakpoint(WatchMem)
             --debug_continueFromBreakpoint(0) --uncomment to auto-resume
         end
end

So to use it you find where your value is being written to memory and change the line
Code:
WatchMem = (EBP - 0x38)
to reflect whatever you're interested in (so ESP if your value is getting pushed onto the stack, etc.). Then you just execute and set a breakpoint somewhere after your value has been written (or else it will break on write one line after your instruction...).

If DeleteOrgBreak is 1 then the script will unset your initial breakpoint (just to save time if you were going to delete it anyway).

Skip will iterate past an access Skip number of times.

One last note, the access breakpoint breaks on the line after the access, so you will need to scroll up one line.
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 Lua Scripting 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