2010-11-07 33 views
0

转储的汇编代码:确定后汇编代码的输出功能阶段_1

0x08048bcc <phase_1+0>: push %ebp 
0x08048bcd <phase_1+1>: mov %esp,%ebp 
0x08048bcf <phase_1+3>: sub $0x10,%esp 
0x08048bd2 <phase_1+6>: push $0x8049808 
0x08048bd7 <phase_1+11>:  pushl 0x8(%ebp) 
0x08048bda <phase_1+14>:  call 0x8048f9c(strings_not_equal) 
0x08048bdf <phase_1+19>:  add $0x10,%esp 
0x08048be2 <phase_1+22>:  test %eax,%eax 
0x08048be4 <phase_1+24>:  je  0x8048beb(phase_1+31) 
0x08048be6 <phase_1+26>:  call 0x804951c(explode_bomb) 
0x08048beb <phase_1+31>:  leave 
0x08048bec <phase_1+32>:  ret 

的汇编代码转储功能strings_not_equal:

0x08048f9c <strings_not_equal+0>:  push %ebp 
0x08048f9d <strings_not_equal+1>:  mov %esp,%ebp 
0x08048f9f <strings_not_equal+3>:  push %edi 
0x08048fa0 <strings_not_equal+4>:  push %esi 
0x08048fa1 <strings_not_equal+5>:  push %ebx 
0x08048fa2 <strings_not_equal+6>:  mov 0x8(%ebp),%esi 
0x08048fa5 <strings_not_equal+9>:  mov 0xc(%ebp),%edi 
0x08048fa8 <strings_not_equal+12>:  push %esi 
0x08048fa9 <strings_not_equal+13>:  call 0x8048f83(string_length) 
0x08048fae <strings_not_equal+18>:  mov %eax,%ebx 
0x08048fb0 <strings_not_equal+20>:  push %edi 
0x08048fb1 <strings_not_equal+21>:  call 0x8048f83 (string_length) 
0x08048fb6 <strings_not_equal+26>:  add $0x8,%esp 
0x08048fb9 <strings_not_equal+29>:  mov $0x1,%edx 
0x08048fbe <strings_not_equal+34>:  cmp %eax,%ebx 
0x08048fc0 <strings_not_equal+36>:  jne 0x8048fe6 (strings_not_equal+74) 
0x08048fc2 <strings_not_equal+38>:  jmp 0x8048fcb (strings_not_equal+47) 
0x08048fc4 <strings_not_equal+40>:  mov $0x1,%edx 
0x08048fc9 <strings_not_equal+45>:  jmp 0x8048fe6 (strings_not_equal+74) 
0x08048fcb <strings_not_equal+47>:  mov %esi,%edx 
0x08048fcd <strings_not_equal+49>:  mov %edi,%ecx 
0x08048fcf <strings_not_equal+51>:  cmpb $0x0,(%esi) 
0x08048fd2 <strings_not_equal+54>:  je  0x8048fe1 (strings_not_equal+69) 
0x08048fd4 <strings_not_equal+56>:  mov (%edx),%al 
0x08048fd6 <strings_not_equal+58>:  cmp (%ecx),%al 
0x08048fd8 <strings_not_equal+60>:  jne 0x8048fc4 (strings_not_equal+40) 
0x08048fda <strings_not_equal+62>:  inc %edx 
0x08048fdb <strings_not_equal+63>:  inc %ecx 
0x08048fdc <strings_not_equal+64>:  cmpb $0x0,(%edx) 
0x08048fdf <strings_not_equal+67>:  jne 0x8048fd4 (strings_not_equal+56) 
0x08048fe1 <strings_not_equal+69>:  mov $0x0,%edx 
0x08048fe6 <strings_not_equal+74>:  mov %edx,%eax 
0x08048fe8 <strings_not_equal+76>:  lea 0xfffffff4(%ebp),%esp 
0x08048feb <strings_not_equal+79>:  pop %ebx 
0x08048fec <strings_not_equal+80>:  pop %esi 
0x08048fed <strings_not_equal+81>:  pop %edi 
0x08048fee <strings_not_equal+82>:  leave 
0x08048fef <strings_not_equal+83>:  ret 
+0

你到目前为止尝试过什么?你困惑了什么具体问题? http://tinyurl.com/so-hints – 2010-11-08 08:43:56

回答

4

首先,你应该标记这是家庭作业或至少在问题中提到它(我认为“家庭作业”现在可能被认为是不受欢迎的meta标签 - 我不确定)。我在大学时完成了这项任务,事实上我认为我的笔记本电脑上仍然有这个任务。你应该真正地预先考虑这个问题,因为一般来说,如果对作业问题提供直接和准确的答案,他们就会皱眉。人们非常乐意提供帮助,但透明度很好。

回答您的实际问题:您发布的代码没有输出。它不打印任何东西。 phase_1所做的就是调用一个字符串比较函数,然后如果没有输入正确的密码就会“爆炸”。

我猜你是这个问题的意思是“strings_not_equal函数在它的比较中使用什么字符串?”由于整个任务的重点是使用调试器和反向工程技术来确定每个阶段的密码,所以我会将其作为练习留给读者。

+0

我差点把他的功课搞砸了,谢谢指出那个;)。 – 2010-11-07 03:28:07

+0

@JensMühlenhof:哈,当然。对于我为这项任务(来自我的教授的服务器)提供的讲义,我感到好奇[这里是一份副本](http://robert.narnia.homeunix.com/Fall2009/301/bomblab.pdf)。这是我的最爱之一! – eldarerathis 2010-11-07 03:30:38

+0

我不知道如何使用调试器来找出答案... – Brian 2010-11-07 03:47:09