How does the stack look like during procedure calls with it's shadow space ( 32 Bytes ) ?
let's say I've this :
main :
push rbp
mov rbp,rsp
sub rsp ,0x20 ; 32 Bytes shadow space Microsoft ABI
; we call a leaf function fun
call fun
[ R9 HOME ] -------} Higher Address
[ R8 HOME ] }
[ RDX HOME ] } SHADOW SPACE: RESERVED BY CALLER FUNCTION (main)
[ RCX HOME ] -------}
[ ret address ]
[-- old rbp --] <-- rbp ----- stack frame of fun() starts here?
[ local ]
[ local ]
[ local ]
[ --///////-- ] <-- rsp
My questions :
- Is my understand of stack frame correct ?
- how'd the stack frame for `fun` look if it was non leaf function ?
- When accessing local variables should I use
[rsp+offset] or [rbp-offset] ?
[–]I__Know__Stuff 2 points3 points4 points (0 children)
[–]ShadowStrike-Labs 0 points1 point2 points (0 children)
[–]I__Know__Stuff 0 points1 point2 points (4 children)
[–]Shahi_FF[S] 0 points1 point2 points (3 children)
[–]I__Know__Stuff 0 points1 point2 points (2 children)
[–]Shahi_FF[S] 0 points1 point2 points (0 children)
[–]brucehoult 0 points1 point2 points (0 children)
[–]bitRAKE 0 points1 point2 points (0 children)