1 Framework Model
Call Command:
1) The address A of the next instruction in the EIP is stored at the top of the stack;
2) Set the EIP to point to the code where the program is called.
RET directive: Restore address A to the EIP
This changes the invocation of the function to the sequential execution of the instruction flow.
2 Framework Formation
Initial stack
1) Call XXX (function), when performing call, Cs:eip the original value to the call next instruction, the value is saved to the top of the stack, and then cs:eip the value, point to the entry address of XXX.
CS:EIP is pressed stack
2) Enter XXX
First instruction: PUSHL%EBP
Base address stack for superior functions
Second instruction: Movl%esp,%EBP
Creates a new function call stack in the original stack's address space
General operations in the body of a function, which may be stacked, stacked
3) Exit XXX
MOVL%ebp,%esp
POPL%EBP
After executing this command, EBP points to the original address
Ret
Cs:eip out the Stack
How the operating system works--the stack frame of the function