Stack, Call, and Return
push rax ; rsp -= 8 ; [rsp] = rax
pop rbx ; rbx = [rsp] ; rsp += 8
call func ; push return address, then jmp func
ret ; pop return address into rip
- The stack grows downward (toward lower addresses).
callsaves where to come back to;retreturns there.- Overwriting a saved return address on the stack = classic stack buffer overflow.