Linux Mach-O 反汇编器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/8712352/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-06 03:53:47  来源:igfitidea点击:

Linux Mach-O Disassembler

linuxdisassemblymach-oobjdump

提问by Jeff

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.

是否有任何 Linux 程序可以反汇编像 objdump 这样的 OSX 通用 x86/x86_64 胖 Mach-O 二进制文件?GNU binutils 的 objdump 支持 ELF 和 Windows PE 文件,但不支持 Mach-O。

采纳答案by Brett Hale

AFAIK, the native Darwin binary tools are part of the cctoolspackage. 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:

AFAIK,原生 Darwin 二进制工具是cctools包的一部分。它们没有与GNU binutils相同的命令行语法或输出。然而,后来的 binutils(即 2.22)支持 Mach-O 格式。你可以得到这些预置的,与“ g”前缀的工具名称,提到这里。或者,您可以编译 binutils,例如:

> ./configure --prefix=$CROSSTOOLDIR --target=x86_64-apple-darwin \
--enable-64-bit-bfd --disable-nls --disable-werror

Installation will yield a bin/directory where the utilities are prefixed with x86_64-apple-darwin. It should handle i386 Mach-O format (and FAT binaries) fine.

安装将产生一个bin/目录,其中实用程序以x86_64-apple-darwin. 它应该可以很好地处理 i386 Mach-O 格式(和 FAT 二进制文件)。

回答by Anil

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.

对 Mach-O 二进制文件进行逆向工程的著名工具很少有otool、strings、nm、otx 等。这绝对适用于 MAC OSX,我认为它也适用于 Linux 平台。

回答by Paige Thompson

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.

bintuils 不包括对 mach o 的链接支持 (ld/gld),即使在当前的 2.23 版本中也不包括这确实令人失望但并不奇怪。不幸的是,当您制作操作系统并重新发明“真正不需要重新发明的东西”时,就会发生这种情况。每个人都有不同的优先事项。我还没有从某些人那里听到 a.out vs elf 的结局。

care to try to run ELF binaries on OSX? https://stackoverflow.com/a/2613170/1867574

小心尝试在 OSX 上运行 ELF 二进制文件?https://stackoverflow.com/a/2613170/1867574

回答by 0xced

You can disassemble Mach-O binaries on Linux with Hopper. Unlike objdump, it has a very nice graphical user interface.

您可以使用Hopper在 Linux 上反汇编 Mach-O 二进制文件。与 objdump 不同,它有一个非常漂亮的图形用户界面。

回答by Douglas Su

I think you need otool. It is included in mac osx command tools. For example, if you want to disassemble a.out, all you need to do is typing otool -tv a.outin your command line.

我认为你需要otool. 它包含在mac osx command tools. 例如,如果您想反汇编a.out,您需要做的就是otool -tv a.out在命令行中输入。