Linux Mach-O 反汇编器
是否有任何 Linux 程序可以像 objdump 一样反汇编 OSX 通用 x86/x86_64 fat Mach-O 二进制文件? GNU binutils 的 objdump 支持 ELF 和 Windows PE 文件,但不支持 Mach-O。
Are there any Linux programs that can disassemble an OSX universal x86/x86_64 fat Mach-O binary like objdump? GNU binutils' objdump supports ELF and Windows PE files but not Mach-O.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以使用 Hopper 反汇编 Linux 上的 Mach-O 二进制文件。与 objdump 不同,它有一个非常漂亮的图形用户界面。
You can disassemble Mach-O binaries on Linux with Hopper. Unlike objdump, it has a very nice graphical user interface.
我认为您需要
otool
。它包含在mac osx 命令工具
中。例如,如果您想反汇编a.out
,您只需在命令行中输入otool -tv a.out
即可。I think you need
otool
. It is included inmac osx command tools
. For example, if you want to disassemblea.out
, all you need to do is typingotool -tv a.out
in your command line.对 Mach-O 二进制文件进行逆向工程的著名工具有 otool 、 strings、 nm、 otx 等。这绝对适用于 MAC OSX,我认为它也适用于 Linux 平台。
Few famous tools for reverse engineering the Mach-O binaries are otool , strings, nm, otx etc. This definitely works on the MAC OSX, I think it works on the Linux plaform too.
AFAIK,原生 Darwin 二进制工具是 cctools 包的一部分。它们没有与 GNU binutils 相同的命令行语法或输出。不过,后来的 binutils(即 2.22)支持 Mach-O 格式。您可以预先构建这些工具,并在工具名称中添加“
g
”前缀,如前所述此处。或者,您可以编译 binutils,如下所示:安装将生成一个
bin/
目录,其中实用程序的前缀为x86_64-apple-darwin
。它应该可以很好地处理 i386 Mach-O 格式(和 FAT 二进制文件)。AFAIK, the native Darwin binary tools are part of the cctools package. They don't have the same command line syntax or output as the GNU binutils. Later binutils (i.e., 2.22) supports the Mach-O format however. You can get these prebuilt, with the '
g
' prefix to the tool names, as mentioned here. Alternatively, you can compile binutils, with something like:Installation will yield a
bin/
directory where the utilities are prefixed withx86_64-apple-darwin
. It should handle i386 Mach-O format (and FAT binaries) fine.关于 Jeff 的回应:
bintuils 不包括对 mach o 的链接支持(ld/gld),甚至在当前的 2.23 版本中也不包括,这确实令人失望,但并不奇怪。不幸的是,当你制造操作系统并重新发明“实际上不需要重新发明”的东西时,就会发生这种情况。每个人都有不同的优先事项。我还没有从一些人那里听到a.out vs elf 的结局。
想要尝试在 OSX 上运行 ELF 二进制文件吗? https://stackoverflow.com/a/2613170/1867574
With regards to Jeff's response:
bintuils does not include linking support (ld/gld) for mach o not even in the current 2.23 release which is really disappointing but not surprising. That unfortunately is what happens when you make an OS, and reinvent things "that really don't need to be reinvented." Everyone has different priorities. I still haven't heard the end of a.out vs elf from some people.
care to try to run ELF binaries on OSX? https://stackoverflow.com/a/2613170/1867574