#1
|
|||
|
|||
Problem with Return Address
I got an application which calls a MFC function.
That MFC function calls another MFC function. Now my problem: As you know, when a call is executed, the return address is pushed on the stack. But not in this case: When that MFC function calls the other MFC function, 0 is pushed on the stack as return address instead of the real return address. The result of this is that when that call returns, the app crashes. So how can this happen? Notice: That application is protected. In the protected version of the app that problem does not seem to occur. However, I've unpacked that app by hand and now I got this problem. Thx |
#2
|
||||
|
||||
Which protection was it? As any app that uses CALL to jump into MFC is guaranteed to have a valid return address as it's pushed onto the stack by the hardware. What you are most likely seeing is that the app itself is doing the PUSH and then JMPing into MFC. Maybe it pushes the address of some protection function onto the stack, and once the protection is removed, the result is zero, hence the crash?
|
#3
|
|||
|
|||
Sorry, everything is ok:
Inside that call there's a pointer pointing to the return address. However, there's an AND [pointer],0 executed which causes that the return address is "removed" However, it's still a bit strange, cause the return address is duplicated on the stack. You can say that it is stored twice. But when we come to the RET of the call, the stack points to the old return address which was removed with the AND I mentioned above.... However, thx for your reply |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[NOOB QUESTION] how can i edit a function to return 1 in IDA pro? | Mendax47 | General Discussion | 6 | 08-22-2021 09:38 |
How do I know what information return this address? | byvs | General Discussion | 5 | 11-20-2015 20:57 |
Can we hook some func in another process then change return address? | Teerayoot | General Discussion | 5 | 09-21-2004 11:12 |
Softice - how do I return to calling code? | sync | General Discussion | 16 | 08-22-2002 20:02 |