来自CSAPP 的 buflab 的一个问题。我被要求输入一些足够长的利用代码来破坏堆栈。在第 2 阶段,我需要首先更改名为global_value的全局变量的值,然后调用名为bang的函数。但是,它只有在我将 bang 的地址压入堆栈然后返回时才有效。
#codes before set the value of global_value
movl $0x12345678,%eax /* 0x12345678 is the address of bang */
push %eax
ret
如果我使用直接跳转
#codes before set the value of global_value
jmp 0x12345678
然后我在 gdb 的 0x5abcdefg 之类的地方完全迷失了。任何人都可以帮忙吗?这与模式的寻址有什么关系吗?