机器级表示
我正在做这个项目,这个特定的部分让我感到困惑。我们得到了这个机器级别的表示,它将读取我必须弄清楚的六个数字。到目前为止,我知道这是一个循环,它将迭代直到到达停止子句。我们不希望它在 0x08048d3a 处调用爆炸:调用 0x80492f3 。有谁知道将生成什么六个数字。非常感谢任何帮助。
0x08048d0b <phase_2+0>: push %ebp
0x08048d0c <phase_2+1>: mov %esp,%ebp
0x08048d0e <phase_2+3>: push %esi
0x08048d0f <phase_2+4>: push %ebx
0x08048d10 <phase_2+5>: sub $0x30,%esp
0x08048d13 <phase_2+8>: lea -0x20(%ebp),%eax
0x08048d16 <phase_2+11>: mov %eax,0x4(%esp)
0x08048d1a <phase_2+15>: mov 0x8(%ebp),%eax
0x08048d1d <phase_2+18>: mov %eax,(%esp)
0x08048d20 <phase_2+21>: call 0x8049335 <read_six_numbers>
0x08048d25 <phase_2+26>: mov $0x2,%ebx
0x08048d2a <phase_2+31>: lea -0x20(%ebp),%esi
0x08048d2d <phase_2+34>: mov -0x8(%esi,%ebx,4),%eax
0x08048d31 <phase_2+38>: add $0x5,%eax
0x08048d34 <phase_2+41>: cmp %eax,-0x4(%esi,%ebx,4)
0x08048d38 <phase_2+45>: je 0x8048d3f <phase_2+52>
0x08048d3a <phase_2+47>: call 0x80492f3 <explode_bomb>
0x08048d3f <phase_2+52>: add $0x1,%ebx
0x08048d42 <phase_2+55>: cmp $0x7,%ebx
0x08048d45 <phase_2+58>: jne 0x8048d2d <phase_2+34>
0x08048d47 <phase_2+60>: add $0x30,%esp
0x08048d4a <phase_2+63>: pop %ebx
0x08048d4b <phase_2+64>: pop %esi
0x08048d4c <phase_2+65>: pop %ebp
0x08048d4d <phase_2+66>: ret
你能具体解释一下这些行发生了什么吗?
0x08048d10 <phase_2+5>: sub $0x30,%esp
0x08048d13 <phase_2+8>: lea -0x20(%ebp),%eax
0x08048d16 <phase_2+11>: mov %eax,0x4(%esp)
0x08048d1a <phase_2+15>: mov 0x8(%ebp),%eax
0x08048d1d <phase_2+18>: mov %eax,(%esp)
谢谢!!
I'm doing this project and this particular portion is confusing me. We are given this machine level representation and it will read six numbers that I have to figure out. So far I know that this is a loop and it will iterate until it reaches it's stop clause. We do not want it to ever make the call to explode at 0x08048d3a : call 0x80492f3 . Does anyone know what six numbers are going to be generated. Any help is greatly appreciated.
0x08048d0b <phase_2+0>: push %ebp
0x08048d0c <phase_2+1>: mov %esp,%ebp
0x08048d0e <phase_2+3>: push %esi
0x08048d0f <phase_2+4>: push %ebx
0x08048d10 <phase_2+5>: sub $0x30,%esp
0x08048d13 <phase_2+8>: lea -0x20(%ebp),%eax
0x08048d16 <phase_2+11>: mov %eax,0x4(%esp)
0x08048d1a <phase_2+15>: mov 0x8(%ebp),%eax
0x08048d1d <phase_2+18>: mov %eax,(%esp)
0x08048d20 <phase_2+21>: call 0x8049335 <read_six_numbers>
0x08048d25 <phase_2+26>: mov $0x2,%ebx
0x08048d2a <phase_2+31>: lea -0x20(%ebp),%esi
0x08048d2d <phase_2+34>: mov -0x8(%esi,%ebx,4),%eax
0x08048d31 <phase_2+38>: add $0x5,%eax
0x08048d34 <phase_2+41>: cmp %eax,-0x4(%esi,%ebx,4)
0x08048d38 <phase_2+45>: je 0x8048d3f <phase_2+52>
0x08048d3a <phase_2+47>: call 0x80492f3 <explode_bomb>
0x08048d3f <phase_2+52>: add $0x1,%ebx
0x08048d42 <phase_2+55>: cmp $0x7,%ebx
0x08048d45 <phase_2+58>: jne 0x8048d2d <phase_2+34>
0x08048d47 <phase_2+60>: add $0x30,%esp
0x08048d4a <phase_2+63>: pop %ebx
0x08048d4b <phase_2+64>: pop %esi
0x08048d4c <phase_2+65>: pop %ebp
0x08048d4d <phase_2+66>: ret
Specifically can you explain what happens at these lines
0x08048d10 <phase_2+5>: sub $0x30,%esp
0x08048d13 <phase_2+8>: lea -0x20(%ebp),%eax
0x08048d16 <phase_2+11>: mov %eax,0x4(%esp)
0x08048d1a <phase_2+15>: mov 0x8(%ebp),%eax
0x08048d1d <phase_2+18>: mov %eax,(%esp)
Thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个 AT&T 语法让我很困惑,但这部分很简单:
This AT&T syntax confuses me, but this part is simple: