-
Notifications
You must be signed in to change notification settings - Fork 203
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
Stackpointer subtraction in listings 14-4, 14-5, 14-6 #28
Comments
Thank you for your question. I was able to reproduce the book listings with
So, 0xf90 is decimal 3984, 3984 + 128 = 4112 = 0x1010 so that is how much place we really get if we subtract 0xf90 from You compiled the code with stack protection implicitly turned on. Because of that, we need an extra 8 bytes in stack immediately next to old We subtract a bit more to keep When
In case of stack protection turned off, this function performs no calls (leaf function), and we don't need to keep |
Thanks for explaning this. |
The assembly code for listing 14-4 in listing 14-5 seems a bit wierd. RSP is not subtracted enough (only 0xf90) to hold
char buffer[1024]
.buffer
is partly outside the stack and botha
andb
are completly outside the stack.Same issue with 14-6.
When I compiled and disassembled myself I got some extra bloat at 40055d-40056a and 400588-400597 (maybe you know why?), but RSP is subtracted more than enough (x1020) to hold
buffeer
,a
andb
:The text was updated successfully, but these errors were encountered: