AT&T组装说明

时间:2018-09-19 12:10:53

标签: assembly att

我需要解决此功课。我的一些观察是:rsp是保留128个字节的堆栈指针。我想我需要输入一个char数组。但是函数中还使用了rdi和rsi。似乎有多个参数(指针和变量)时,我无法确定所需的参数数量。有人可以提供一些有关如何解释以下功能的帮助或指导吗?

Dump of assembler code for function:
0x0000000000401317 <+0>:    sub    $0x128,%rsp
0x000000000040131e <+7>:    mov    %rdi,%rsi
0x0000000000401321 <+10>:   movw   $0x11b4,0x34(%rsp)
0x0000000000401328 <+17>:   mov    $0xcc8dc178,%eax
0x000000000040132d <+22>:   mov    %rax,0x40(%rsp)
0x0000000000401332 <+27>:   movb   $0xa,0x36(%rsp)
0x0000000000401337 <+32>:   movw   $0xc7c,0x2c(%rsp)
0x000000000040133e <+39>:   movq   $0x0,0x38(%rsp)
0x0000000000401347 <+48>:   movl   $0x3591e97,0x30(%rsp)
0x000000000040134f <+56>:   lea    0x20(%rsp),%rdi
0x0000000000401354 <+61>:   callq  0x400ca0 <strcpy@plt>
0x0000000000401359 <+66>:   mov    0x40(%rsp),%rdx
0x000000000040135e <+71>:   mov    $0xcc8dc178,%eax
0x0000000000401363 <+76>:   cmp    %rax,%rdx
0x0000000000401366 <+79>:   je     0x40136d <function+86>
0x0000000000401368 <+81>:   callq  0x401b11 <bomb_bomb>
0x000000000040136d <+86>:   mov    0x38(%rsp),%rax
0x0000000000401372 <+91>:   test   %rax,%rax
0x0000000000401375 <+94>:   je     0x40137c <function+101>
0x0000000000401377 <+96>:   callq  0x401b11 <bomb_bomb>
0x000000000040137c <+101>:  movzbl 0x36(%rsp),%eax
0x0000000000401381 <+106>:  cmp    $0x47,%al
0x0000000000401383 <+108>:  je     0x40138a <function+115>
0x0000000000401385 <+110>:  callq  0x401b11 <bomb_bomb>
0x000000000040138a <+115>:  movzwl 0x2c(%rsp),%eax
0x000000000040138f <+120>:  cmp    $0x3a6b,%ax
0x0000000000401393 <+124>:  je     0x40139a <function+131>
0x0000000000401395 <+126>:  callq  0x401b11 <bomb_bomb>
0x000000000040139a <+131>:  movzwl 0x34(%rsp),%eax
0x000000000040139f <+136>:  mov    0x30(%rsp),%edx
0x00000000004013a3 <+140>:  movzwl %ax,%eax
0x00000000004013a6 <+143>:  shl    $0xf,%eax
0x00000000004013a9 <+146>:  add    %edx,%eax
0x00000000004013ab <+148>:  cmp    $0x4bd3b570,%eax
0x00000000004013b0 <+153>:  sete   %al
0x00000000004013b3 <+156>:  movzbl %al,%eax
0x00000000004013b6 <+159>:  add    $0x128,%rsp
0x00000000004013bd <+166>:  retq   

0000000000400ca0 <strcpy@plt>:
400ca0: ff 25 8a 33 20 00       jmpq   *0x20338a(%rip)            # 604030 <_GLOBAL_OFFSET_TABLE_+0x30>
400ca6: 68 03 00 00 00          pushq  $0x3
400cab: e9 b0 ff ff ff          jmpq   400c60   <_init+0x20>

0 个答案:

没有答案