-
Notifications
You must be signed in to change notification settings - Fork 91
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
Support calls with unaligned stack on x86 #39
Comments
I tried following the above steps:
It seems to be working for me. |
Fixing alignment for hook functions isn't that simple. (1) Fixed alignment must be back to the original before returning to the caller. (2) Hook functions get incorrect arguments when alignment is fixed and the arguments are passed on the stack. On the other hand, fixing alignment for prehook is simple as you did.
I would do it as follows.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As far as I can see, on x86, this library assumes that target functions will always be called with
%rsp
properly aligned.However, some of the functions I'd like to hook are called with
%rsp
unaligned. If transit function is not used, it jumps to the hook function and the stack is still unaligned. This may cause issues.It gets even worse when the transit procedure is used, as it contains
movdqa
instructions which immediately segfault.From what I can see, to support this, one needs to:
Is this right?
The text was updated successfully, but these errors were encountered: