Linux Mach-O Disassembler

旧街凉风 提交于 2019-11-26 15:49:52

问题


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.


回答1:


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:

> ./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.




回答2:


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




回答3:


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




回答4:


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.out in your command line.




回答5:


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.



来源:https://stackoverflow.com/questions/8712352/linux-mach-o-disassembler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!