我陷入了二元炸弹任务的第五阶段。我试图弄清楚循环是什么,所以我可以找出我需要的两个输入。任何帮助表示赞赏!这是汇编代码:
Dump of assembler code for function phase_5:
0x08048edc <+0>: push %ebp
0x08048edd <+1>: mov %esp,%ebp
0x08048edf <+3>: push %esi
0x08048ee0 <+4>: push %ebx
0x08048ee1 <+5>: sub $0x20,%esp
0x08048ee4 <+8>: lea -0x10(%ebp),%eax
0x08048ee7 <+11>: mov %eax,0xc(%esp)
0x08048eeb <+15>: lea -0xc(%ebp),%eax
0x08048eee <+18>: mov %eax,0x8(%esp)
0x08048ef2 <+22>: movl $0x804a5ac,0x4(%esp)
0x08048efa <+30>: mov 0x8(%ebp),%eax
0x08048efd <+33>: mov %eax,(%esp)
0x08048f00 <+36>: call 0x8048894 <__isoc99_sscanf@plt>
0x08048f05 <+41>: cmp $0x1,%eax
0x08048f08 <+44>: jg 0x8048f0f <phase_5+51>
0x08048f0a <+46>: call 0x8049351 <explode_bomb>
0x08048f0f <+51>: mov -0xc(%ebp),%eax
0x08048f12 <+54>: and $0xf,%eax
0x08048f15 <+57>: mov %eax,-0xc(%ebp)
0x08048f18 <+60>: cmp $0xf,%eax
0x08048f1b <+63>: je 0x8048f46 <phase_5+106>
0x08048f1d <+65>: mov $0x0,%ecx
0x08048f22 <+70>: mov $0x0,%edx
0x08048f27 <+75>: mov $0x804a500,%ebx
0x08048f2c <+80>: add $0x1,%edx
0x08048f2f <+83>: mov (%ebx,%eax,4),%eax
0x08048f32 <+86>: add %eax,%ecx
0x08048f34 <+88>: cmp $0xf,%eax
0x08048f37 <+91>: jne 0x8048f2c <phase_5+80>
0x08048f39 <+93>: mov %eax,-0xc(%ebp)
0x08048f3c <+96>: cmp $0xf,%edx
0x08048f3f <+99>: jne 0x8048f46 <phase_5+106>
0x08048f41 <+101>: cmp %ecx,-0x10(%ebp)
0x08048f44 <+104>: je 0x8048f4b <phase_5+111>
=> 0x08048f46 <+106>: call 0x8049351 <explode_bomb>
0x08048f4b <+111>: add $0x20,%esp
0x08048f4e <+114>: pop %ebx
0x08048f4f <+115>: pop %esi
0x08048f50 <+116>: pop %ebp
0x08048f51 <+117>: ret
我的输入必须是两位小数,具体取决于x/s 0x804a5ac
在线&lt; + 22&gt;的结果。
在线&lt; + 60&gt;,有一个比较确保我的第一个输入不是15.(根据第一条评论编辑此行)
似乎循环迫使我运行15次,计数器为%edx on line&lt; + 80&gt ;.