Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Linux Mach-O Disassembler

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.

like image 806
Jeff Avatar asked Jan 03 '12 12:01

Jeff


People also ask

How do I find the machine code in Linux?

Assuming that you are on a Linux or BSD platform (based on the fact that you're using as ), you might want to try objdump . objdump is a part of the binutils package on Linux platforms. Yes, this is it!

Which command is used to disassemble code?

The objdump command is generally used to inspect the object files and binary files. It prints the different sections in object files, their virtual memory address, logical memory address, debug information, symbol table, and other pieces of information. Here we'll see how we can use this tool to disassemble the files.

What is Hopper tool?

Hopper is a disassembler which can handle 32-bit or 64-bit programs for both Windows and OSX (other platforms, including iOS/ARM, are in development) with a basic but surprisingly functional decompiler mode. It costs $29 on the App Store or direct from the creator.


1 Answers

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.

like image 155
Brett Hale Avatar answered Sep 24 '22 03:09

Brett Hale