如何在 Linux 中反汇编二进制可执行文件以获取汇编代码? [英] How to disassemble a binary executable in Linux to get the assembly code?
本文介绍了如何在 Linux 中反汇编二进制可执行文件以获取汇编代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有人告诉我使用反汇编程序.gcc
有内置的东西吗?最简单的方法是什么?
I was told to use a disassembler. Does gcc
have anything built in? What is the easiest way to do this?
推荐答案
我不认为 gcc
有标志,因为它主要是一个编译器,但另一个 GNU 开发工具有.objdump
需要一个 -d
/--disassemble
标志:
I don't think gcc
has a flag for it, since it's primarily a compiler, but another of the GNU development tools does. objdump
takes a -d
/--disassemble
flag:
$ objdump -d /path/to/binary
反汇编如下:
080483b4 <main>:
80483b4: 8d 4c 24 04 lea 0x4(%esp),%ecx
80483b8: 83 e4 f0 and $0xfffffff0,%esp
80483bb: ff 71 fc pushl -0x4(%ecx)
80483be: 55 push %ebp
80483bf: 89 e5 mov %esp,%ebp
80483c1: 51 push %ecx
80483c2: b8 00 00 00 00 mov $0x0,%eax
80483c7: 59 pop %ecx
80483c8: 5d pop %ebp
80483c9: 8d 61 fc lea -0x4(%ecx),%esp
80483cc: c3 ret
80483cd: 90 nop
80483ce: 90 nop
80483cf: 90 nop
这篇关于如何在 Linux 中反汇编二进制可执行文件以获取汇编代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文