如何反汇编在C上制作的对象程序?

时间:2010-08-26 03:50:46

标签: c linux command-line

如何反汇编在C(linux)上创建的目标程序? 任何人都可以帮我一下命令行。

1 个答案:

答案 0 :(得分:5)

使用objdump

objdump -d -C file.o

示例输出:

     ...
0000015e <add_exclude>:
     15e:       55                      push   %ebp
     15f:       89 e5                   mov    %esp,%ebp
     161:       83 ec 08                sub    $0x8,%esp
     164:       a1 10 00 00 00          mov    0x10,%eax
     169:       3b 05 14 00 00 00       cmp    0x14,%eax
     16f:       7f 54                   jg     1c5 <add_exclude+0x67>
     171:       83 3d 10 00 00 00 00    cmpl   $0x0,0x10
     178:       75 1f                   jne    199 <add_exclude+0x3b>
     17a:       83 ec 0c                sub    $0xc,%esp
     17d:       c7 05 10 00 00 00 40    movl   $0x40,0x10
     184:       00 00 00
     187:       68 00 01 00 00          push   $0x100
     18c:       e8 fc ff ff ff          call   18d <add_exclude+0x2f>
     191:       83 c4 10                add    $0x10,%esp
     ...