読者です 読者をやめる 読者になる 読者になる

How to disassemble MacOSX binary(O-Mach) on Linux

binutils mac

f:id:syohex:20150713165520p:plain

Download Binutils

Download Binutils

% curl -LO http://ftp.jaist.ac.jp/pub/GNU/binutils/binutils-2.25.tar.bz2

Configuration

Change --prefix as you like.

% tar xf binutils-2.25.tar.bz2
% cd binutils-2.25
% mkdir build
% cd build
% ../configure --prefix=/opt/mac --target=x86_64-apple-darwin --enable-64-bit-bfd --disable-nls

Build and Install

% make
% sudo make install

Set PATH environment variable to the --prefix directory. In this case, export PATH=/opt/mac/bin:$PATH

Disassemble

% x86_64-apple-darwin-objdump -d peco |less