所以我跟随http://insecure.org/stf/smashstack.html并偶然发现了一些我不太了解的事情:
Dump of assembler code for function main:
0x8000490 <main>: pushl %ebp
0x8000491 <main+1>: movl %esp,%ebp
0x8000493 <main+3>: subl $0x4,%esp
0x8000496 <main+6>: movl $0x0,0xfffffffc(%ebp)
0x800049d <main+13>: pushl $0x3
0x800049f <main+15>: pushl $0x2
0x80004a1 <main+17>: pushl $0x1
0x80004a3 <main+19>: call 0x8000470 <function>
0x80004a8 <main+24>: addl $0xc,%esp
0x80004ab <main+27>: movl $0x1,0xfffffffc(%ebp)
0x80004b2 <main+34>: movl 0xfffffffc(%ebp),%eax
0x80004b5 <main+37>: pushl %eax
0x80004b6 <main+38>: pushl $0x80004f8
0x80004bb <main+43>: call 0x8000378 <printf>
0x80004c0 <main+48>: addl $0x8,%esp
0x80004c3 <main+51>: movl %ebp,%esp
0x80004c5 <main+53>: popl %ebp
0x80004c6 <main+54>: ret
0x80004c7 <main+55>: nop
Run Code Online (Sandbox Code Playgroud)
那就是:"我们可以看到,当调用函数()时,RET将是0x8004a8,我们想跳过0x80004ab的赋值.我们要执行的下一条指令是0x8004b2.一点数学告诉我们距离是8个字节."
我不知道她/他是如何获得8个字节的.我没有看到.我是gdb和汇编程序的新手,但直觉上我会继续计算:0x8004b2 - 0x8004a8 = A(hex)= 10(dec).所以我会说距离是10个字节而不是8个.我错过了什么?
谢谢 :)