Stack Overflow Attack
push ebp //*(++esp) = ebp;
mov ebp esp //ebp = esp;
sub esp N //esp -= N;
...
mov esp ebp //esp = ebp;
pop ebp //ebp = *(esp--)
ret //pop eip //eip = *(esp--)
#memory map
<Higher address>
--------
parameter
--------
return addr
--------
old ebp <- ebp
--------
except handler
--------
local variable
--------
buffer
--------
callee save registers <- esp
--------
<Lower address>
#Reference https://www.tenouk.com/Bufferoverflowc/Bufferoverflow2a.html