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 


Tracing a jump

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

Joined: 08 Dec 2009
Posts: 119
Location: In a box

PostPosted: Sat May 31, 2014 11:10 pm    Post subject: Tracing a jump Reply with quote

I've come across some assembly code that is jumped to and I would like to figure out what address the jump is occurring from. Normally I would use Dissect Code or if it was a call I would use break and trace but I noticed that when I breakpoint the address being jumped to, the address stored in EAX is the address being jumped to. I'm assuming the code is something like
Code:
jmp eax

or some other jump command but how do I find the original address that has this jump?
Back to top
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Sat May 31, 2014 11:36 pm    Post subject: Reply with quote

Set a breakpoint, then use the stack trace in the debugger to see where the function was called from.
_________________
A nagy kapu mellett, mindig van egy kis kapu.
----------------------
Come on...
Back to top
View user's profile Send private message
The0neThe0nly
Expert Cheater
Reputation: 0

Joined: 08 Dec 2009
Posts: 119
Location: In a box

PostPosted: Sat May 31, 2014 11:53 pm    Post subject: Reply with quote

I've tried this, but the function I get is rather large and I can't find any jump. I tried scanning for any opcodes that had an eax in it but I didn't find anything that jumped to eax.

Last edited by The0neThe0nly on Sun Jun 01, 2014 11:41 am; edited 1 time in total
Back to top
View user's profile Send private message
Polynomial
Grandmaster Cheater
Reputation: 5

Joined: 17 Feb 2008
Posts: 524
Location: Inside the Intel CET shadow stack

PostPosted: Sun Jun 01, 2014 6:38 am    Post subject: Reply with quote

Do you know for sure that it's a jump? Could be a call. Check the stack to see if there's a return address somewhere near the top.

You could also load the binary into IDA and check the call site to see if it can find any xrefs, as often the indirect calls can be spotted by constant refs in .data which are then used in other code.

For example, I've seen this "trick" a few times:

Code:

xor eax, eax
add eax, [.data+0402C]
jmp eax


A pain in the ass to find via debugger, but static analysis from IDA will spot it immediately.

_________________
It's not fun unless every exploit mitigation is enabled.
Please do not reply to my posts with LLM-generated slop; I consider it to be an insult to my time.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 472

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

PostPosted: Sun Jun 01, 2014 8:19 am    Post subject: Reply with quote

I'm on a mobile phone so can't post a full example but look into this feature if you're on a 32 bit os:
Code:

The following routines describe last branch recording. These functions only work when kernelmode debugging is used and using windows XP (vista and later work less effective or not at all because the operating system interferes. Might also be intel specific. A dbvm upgrade in the future might make this work for windows vista and later) debug_setLastBranchRecording(boolean): When set the Kernel debugger will try to record the last branch(es) taken before a breakpoint happens debug_getMaxLastBranchRecord() : Returns the maximum branch record your cpu can store (-1 if none) debug_getLastBranchRecord(index): Returns the value of the Last Branch Record at the given index (when handling a bp)

_________________
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