x86 code execution after call/return/jmp etc?

后端 未结 3 2037
死守一世寂寞
死守一世寂寞 2021-01-24 09:26

I hope this question isn\'t to stupid cause it may seem obvious. As I\'m doing a little research on Buffer overflows I stumble over a simple question:

After going to a n

3条回答
  •  暖寄归人
    2021-01-24 10:13

    The call instruction saves (onto the stack) the address to the instruction after it onto the stack. After that, it simply jumps. It doesn't explicitly tell the cpu to look for a return instruction, since that will be handled by popping (from the stack) the return address that call saved in the first place. This allows for multiple calls and returns, or to put it simply, nested calls.

提交回复
热议问题