【发布时间】:2010-06-16 16:56:37
【问题描述】:
我一直在尝试复制本文aleph one中的缓冲区溢出示例3
我这样做是为了练习我正在参加的计算机安全课程中的一个项目,所以我非常需要你的帮助。我一直在跟随这个例子,边做边执行任务。我的问题是我的计算机中gdb 转储的汇编代码(我在VM Ware 上运行的debian linux 映像上执行此操作)与本文中的示例不同。有些结构让我感到困惑。
这是文章中的那个......
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
如您所见,两者之间存在差异。我很困惑,我无法完全理解我电脑上的汇编代码。我想知道两者的区别。
pushl 与 push、mov vs movl 等有何不同...
0xhexavalue(%register) 是什么意思?
对不起,如果我问了很多,但我非常需要你的帮助。
更新:
为什么函数'function'的参数被翻译成不同的汇编代码:
从文章中,我相信函数的参数 1、2 和 3 被压入堆栈..
在我的计算机中,参数被移动到寄存器“esp”,并带有一些偏移量。
它们有什么不同吗?谢谢
非常感谢您的帮助...
【问题讨论】: