Joined: 17 Feb 2008 Posts: 524 Location: Inside the Intel CET shadow stack
Posted: Sun Feb 14, 2010 7:58 am Post subject: [ASM] Detouring extern
I'm trying to write a speed hack that detours extern calls to GetTickCount. I'm still learning when it comes to ASM (who isn't?) and I'd like to know if there are any ramifications of replacing an extern call (15 FF <address>) with a standard call (E8 <address>).
Obviously the length difference means I need to pad something out with a NOP. I can't see any reason why it would matter, but which side of the call should I put the NOP?
e.g.
0xE8 <address> 0x90
or
0x90 0xE8 <address> _________________
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: 17 Feb 2008 Posts: 524 Location: Inside the Intel CET shadow stack
Posted: Sun Feb 14, 2010 6:17 pm Post subject:
I suppose I could just use a jump for the detour, though wouldn't a call be easier since I can just stick a retn on the end of my proc and execution flow will carry on where I left off? I wasn't aware I could do the same with a jmp unless I was putting my detour in somewhere that had multiple lines of code - I just want to replace a single call. _________________
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.
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