View previous topic :: View next topic |
Author |
Message |
toffler Cheater
Reputation: 0
Joined: 27 Sep 2012 Posts: 38
|
Posted: Thu Feb 06, 2014 11:24 pm Post subject: Weird behaviour |
|
|
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 |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25788 Location: The netherlands
|
Posted: Thu Feb 06, 2014 11:49 pm Post subject: |
|
|
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 |
|
 |
toffler Cheater
Reputation: 0
Joined: 27 Sep 2012 Posts: 38
|
Posted: Fri Feb 07, 2014 7:10 am Post subject: |
|
|
I see, thank you!
|
|
Back to top |
|
 |
|