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 


Weird behaviour

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

Joined: 27 Sep 2012
Posts: 38

PostPosted: Thu Feb 06, 2014 11:24 pm    Post subject: Weird behaviour Reply with quote

I have two breakpoints in the code, say BP1 and BP2 and I'm using the following lua script to trace how the program goes through these breakpoints:
Code:
function debugger_onBreakpoint()

   print(string.format("EIP: %X", EIP))

   if(EIP == BP1) then
      return 0
   end

   debug_continueFromBreakpoint(co_run)
   return 1
end


So I run it and it says

EIP: BP2
EIP: BP2
EIP: BP2
EIP: BP1

When I manually jump through these breakpoints w/o the script by pressing F9, I stay at BP2 about hundred times before reaching BP1, not 3 times like the script prints.

How this can be explained, am I doing something wrong?

Also, if I add another breakpoint right before BP2, say BP3, my output goes like this:

EIP: BP2
EIP: BP2
EIP: BP3
EIP: BP1

So it seems that the program doesn't reach BP2 for the third time anymore, how's that possible?

By adding an extra BP I'm not changing the program's logic, so it should still hit BP2 3 times.

Can someone please shed a light on all this?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Thu Feb 06, 2014 11:49 pm    Post subject: Reply with quote

are the other BP's in code executed by other threads ?
Also, it could be a time based code. E.g "if timespend<timemax then dostuff;"
Manually pressing f9 might not be fast enough

There can be lots of other reasons as well. E.g the code might be a check if a key is down or not. If you press f9 a key is down, so a different path may have been taken

_________________
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
toffler
Cheater
Reputation: 0

Joined: 27 Sep 2012
Posts: 38

PostPosted: Fri Feb 07, 2014 7:10 am    Post subject: Reply with quote

I see, thank you!
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 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