Posted: Sat May 31, 2014 11:10 pm Post subject: Tracing a jump
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?
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
Joined: 17 Feb 2008 Posts: 524 Location: Inside the Intel CET shadow stack
Posted: Sun Jun 01, 2014 6:38 am Post subject:
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.
Joined: 09 May 2003 Posts: 25869 Location: The netherlands
Posted: Sun Jun 01, 2014 8:19 am Post subject:
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
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