Pwn_4 Function Call

main(){

F1(arg1,arg2)

printf();  //这个printf 的地址就称为返回地址 return address

}

push arg2

push arg1

call F1

image

在执行F1函数之前,首先要将返回地址入栈,然后进入函数。

image


mov esp,ebp

pop ebp

ret

非常关键的一张图 溢出后向下覆盖,覆盖返回地址ret addr

函数执行完 EBP和ESP相等

imagemov esp,ebp

imagepop EBP

RET 到返回地址中继续执行

原文地址:https://www.cnblogs.com/rookieDanny/p/8453333.html