-
-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to hook the end of a function #27
Comments
You can hook any address.
|
|
So, if the function have multi ret point, we must hook every address. |
I encountered a problem when hook the end of a function. The hook seems have side effect. After hook, the begin of main function was modified: We can discover that ret instruction(C3) and following 4 bytes in main was modified to "e9 72 B6 02 00"。As the result, the program failed to start. |
You shouldn’t hook the ret, you should hook a few bytes before. You can also pt.inject your asm and patch in a jump instead of using hook.
|
Use the -v flag to see exactly what patchkit changed.
|
OK,I understand. Thanks very much! |
Currently, we can hook the begin of a function。How to hook the end of a function? So that we can check the return value of the function, or execute some code after the function end.
The text was updated successfully, but these errors were encountered: