0

我在反汇编这段代码时遇到了很大的困难。我了解该函数需要 3 个输入、1 个十进制和 2 个字符。我得出的结论是小数点是 7,尽管我不完全确定这是正确的。我知道我必须在某处使用跳转表,我相信它在 0x08048d50,我想再次验证和更正,但我不确定如何输入命令?

Dump of assembler code for function phase_3:
0x08048cfa <+0>:    push   %ebp
0x08048cfb <+1>:    mov    %esp,%ebp
0x08048cfd <+3>:    sub    $0x38,%esp
=>  0x08048d00 <+6>:    movl   $0x0,-0xc(%ebp)
0x08048d07 <+13>:   lea    -0x12(%ebp),%eax
0x08048d0a <+16>:   mov    %eax,0x10(%esp)
0x08048d0e <+20>:   lea    -0x13(%ebp),%eax
0x08048d11 <+23>:   mov    %eax,0xc(%esp)
0x08048d15 <+27>:   lea    -0x10(%ebp),%eax
0x08048d18 <+30>:   mov    %eax,0x8(%esp)
0x08048d1c <+34>:   movl   $0x804a7ff,0x4(%esp)
0x08048d24 <+42>:   mov    0x8(%ebp),%eax
0x08048d27 <+45>:   mov    %eax,(%esp)
0x08048d2a <+48>:   call   0x8048960 <__isoc99_sscanf@plt>
0x08048d2f <+53>:   mov    %eax,-0xc(%ebp)
0x08048d32 <+56>:   cmpl   $0x2,-0xc(%ebp)
0x08048d36 <+60>:   jg     0x8048d3d <phase_3+67>
0x08048d38 <+62>:   call   0x8049675 <explode_bomb>
0x08048d3d <+67>:   mov    -0x10(%ebp),%eax
0x08048d40 <+70>:   cmp    $0x7,%eax
0x08048d43 <+73>:   ja     0x8048e56 <phase_3+348>
0x08048d49 <+79>:   mov    0x804a808(,%eax,4),%eax
0x08048d50 <+86>:   jmp    *%eax
0x08048d52 <+88>:   movb   $0x6d,-0x11(%ebp)
0x08048d56 <+92>:   movzbl -0x12(%ebp),%eax
0x08048d5a <+96>:   movsbl %al,%eax
0x08048d5d <+99>:   lea    0x20(%eax),%edx
0x08048d60 <+102>:  movsbl -0x11(%ebp),%eax
0x08048d64 <+106>:  cmp    %eax,%edx
0x08048d66 <+108>:  je     0x8048e61 <phase_3+359>
0x08048d6c <+114>:  call   0x8049675 <explode_bomb>
0x08048d71 <+119>:  jmp    0x8048e61 <phase_3+359>
0x08048d76 <+124>:  movb   $0x68,-0x11(%ebp)
0x08048d7a <+128>:  movzbl -0x12(%ebp),%eax
0x08048d7e <+132>:  movsbl %al,%eax
0x08048d81 <+135>:  lea    0x20(%eax),%edx
0x08048d84 <+138>:  movsbl -0x11(%ebp),%eax
---Type <return> to continue, or q <return> to quit---
0x08048d88 <+142>:  cmp    %eax,%edx
0x08048d8a <+144>:  je     0x8048e64 <phase_3+362>
0x08048d90 <+150>:  call   0x8049675 <explode_bomb>
0x08048d95 <+155>:  jmp    0x8048e64 <phase_3+362>
0x08048d9a <+160>:  movb   $0x63,-0x11(%ebp)
0x08048d9e <+164>:  movzbl -0x12(%ebp),%eax
0x08048da2 <+168>:  movsbl %al,%eax
0x08048da5 <+171>:  lea    0x20(%eax),%edx
0x08048da8 <+174>:  movsbl -0x11(%ebp),%eax
0x08048dac <+178>:  cmp    %eax,%edx
0x08048dae <+180>:  je     0x8048e67 <phase_3+365>
0x08048db4 <+186>:  call   0x8049675 <explode_bomb>
0x08048db9 <+191>:  jmp    0x8048e67 <phase_3+365>
0x08048dbe <+196>:  movb   $0x6f,-0x11(%ebp)
0x08048dc2 <+200>:  movzbl -0x12(%ebp),%eax
0x08048dc6 <+204>:  movsbl %al,%eax
0x08048dc9 <+207>:  lea    0x20(%eax),%edx
0x08048dcc <+210>:  movsbl -0x11(%ebp),%eax
0x08048dd0 <+214>:  cmp    %eax,%edx
0x08048dd2 <+216>:  je     0x8048e6a <phase_3+368>
0x08048dd8 <+222>:  call   0x8049675 <explode_bomb>
0x08048ddd <+227>:  jmp    0x8048e6a <phase_3+368>
0x08048de2 <+232>:  movb   $0x6d,-0x11(%ebp)
0x08048de6 <+236>:  movzbl -0x12(%ebp),%eax
0x08048dea <+240>:  movsbl %al,%eax
0x08048ded <+243>:  lea    0x20(%eax),%edx
0x08048df0 <+246>:  movsbl -0x11(%ebp),%eax
0x08048df4 <+250>:  cmp    %eax,%edx
0x08048df6 <+252>:  je     0x8048e6d <phase_3+371>
0x08048df8 <+254>:  call   0x8049675 <explode_bomb>
0x08048dfd <+259>:  jmp    0x8048e6d <phase_3+371>
0x08048dff <+261>:  movb   $0x76,-0x11(%ebp)
0x08048e03 <+265>:  movzbl -0x12(%ebp),%eax
0x08048e07 <+269>:  movsbl %al,%eax
0x08048e0a <+272>:  lea    0x20(%eax),%edx
0x08048e0d <+275>:  movsbl -0x11(%ebp),%eax
0x08048e11 <+279>:  cmp    %eax,%edx
0x08048e13 <+281>:  je     0x8048e70 <phase_3+374>
---Type <return> to continue, or q <return> to quit---
0x08048e15 <+283>:  call   0x8049675 <explode_bomb>
0x08048e1a <+288>:  jmp    0x8048e70 <phase_3+374>
0x08048e1c <+290>:  movb   $0x70,-0x11(%ebp)
0x08048e20 <+294>:  movzbl -0x12(%ebp),%eax
0x08048e24 <+298>:  movsbl %al,%eax
0x08048e27 <+301>:  lea    0x20(%eax),%edx
0x08048e2a <+304>:  movsbl -0x11(%ebp),%eax
0x08048e2e <+308>:  cmp    %eax,%edx
0x08048e30 <+310>:  je     0x8048e73 <phase_3+377>
0x08048e32 <+312>:  call   0x8049675 <explode_bomb>
0x08048e37 <+317>:  jmp    0x8048e73 <phase_3+377>
0x08048e39 <+319>:  movb   $0x6f,-0x11(%ebp)
0x08048e3d <+323>:  movzbl -0x12(%ebp),%eax
0x08048e41 <+327>:  movsbl %al,%eax
0x08048e44 <+330>:  lea    0x20(%eax),%edx
0x08048e47 <+333>:  movsbl -0x11(%ebp),%eax
0x08048e4b <+337>:  cmp    %eax,%edx
0x08048e4d <+339>:  je     0x8048e76 <phase_3+380>
0x08048e4f <+341>:  call   0x8049675 <explode_bomb>
0x08048e54 <+346>:  jmp    0x8048e76 <phase_3+380>
0x08048e56 <+348>:  movb   $0x69,-0x11(%ebp)
0x08048e5a <+352>:  call   0x8049675 <explode_bomb>
0x08048e5f <+357>:  jmp    0x8048e77 <phase_3+381>
0x08048e61 <+359>:  nop
0x08048e62 <+360>:  jmp    0x8048e77 <phase_3+381>
0x08048e64 <+362>:  nop
0x08048e65 <+363>:  jmp    0x8048e77 <phase_3+381>
0x08048e67 <+365>:  nop
0x08048e68 <+366>:  jmp    0x8048e77 <phase_3+381>
0x08048e6a <+368>:  nop
0x08048e6b <+369>:  jmp    0x8048e77 <phase_3+381>
0x08048e6d <+371>:  nop
0x08048e6e <+372>:  jmp    0x8048e77 <phase_3+381>
0x08048e70 <+374>:  nop
0x08048e71 <+375>:  jmp    0x8048e77 <phase_3+381>
0x08048e73 <+377>:  nop
0x08048e74 <+378>:  jmp    0x8048e77 <phase_3+381>
0x08048e76 <+380>:  nop
4

1 回答 1

0
0x08048d49 <+79>:   mov    0x804a808(,%eax,4),%eax

这个语法说:移动0x804a808+4*%eax%eax. 这应该可以帮助您弄清楚下一行中的跳转地址是什么。

于 2013-10-14T01:56:42.327 回答