Capstone disassembly/disassembler framework: Core (Arm, Arm64, BPF, EVM, M68K, M680X, MOS65xx, Mips, PPC, RISCV, Sparc, SystemZ, TMS320C64x, Web Assembly, X86, X86_64, XCore) + bindings. (bloaty 依赖)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
2.6 KiB

How To Compile, install & run Capstone for Linux, Mac OSX, *BSD and Windows
11 years ago
*-*-*-*-*-*
Capstone requires no prerequisite packages, so it is easy to compile & install.
(0) Tailor Capstone to your need.
Out of 5 archtitectures supported by Capstone (Arm, Arm64, Mips, PPC & X86),
if you just need several selected archs, you can choose which ones you want
to compile in by modifying config.mk before going to next steps.
By default, all 5 architectures are compiled.
(1) Compile from source
On *nix (such as MacOSX, Linux, *BSD, Solaris):
- To compile for current platform, run:
$ ./make.sh
11 years ago
- On 64-bit OS, run command below to cross-compile Capstone for 32-bit binary:
11 years ago
$ ./make.sh nix32
11 years ago
(2) Install Capstone on *nix
To install Capstone, run:
11 years ago
$ sudo ./make.sh install
11 years ago
For FreeBSD/OpenBSD, where sudo is unavailable, run:
$ su; ./make.sh install
Users are then required to enter root password to copy Capstone into machine
system directories.
11 years ago
Afterwards, run "./tests/test*" to see the tests disassembling sample code.
NOTE: The core framework installed by "./make.sh install" consist of
following files:
11 years ago
/usr/include/capstone/capstone.h
/usr/include/capstone/x86.h
/usr/include/capstone/arm.h
/usr/include/capstone/arm64.h
/usr/include/capstone/mips.h
/usr/include/capstone/ppc.h
11 years ago
/usr/lib/libcapstone.so (for Linux/*nix), or /usr/lib/libcapstone.dylib (OSX)
/usr/lib/libcapstone.a
11 years ago
(3) Cross-compile Windows from *nix
To cross-compile for Windows, Linux & gcc-mingw-w64-i686 (and also gcc-mingw-w64-x86-64
for 64-bit binaries) are required.
11 years ago
- To cross-compile Windows 32-bit binary, simply run:
$ ./make.sh cross-win32
11 years ago
- To cross-compile Windows 64-bit binary, run:
$ ./make.sh cross-win64
11 years ago
Resulted files "capstone.dll" and "tests/test*.exe" can then be used on Windows machine.
11 years ago
(4) Compile on Windows with Cygwin
11 years ago
To compile under Cygwin gcc-mingw-w64-i686 or x86_64-w64-mingw32 run:
- To compile Windows 32-bit binary under Cygwin, simply run
$ ./make.sh cygwin-mingw32
- To compile Windows 64-bit binary under Cygwin, run
$ ./make.sh cygwin-mingw64
(5) By default, "cc" (default C compiler on the system) is used as compiler.
- To use "clang" compiler instead, run command below:
$ ./make.sh clang
- To use "gcc" compiler instead, run:
$ ./make.sh gcc
11 years ago
(6) Language bindings
So far, Python, Ruby, Ocaml, Java, C# and Go are supported by bindings. Look for
the bindings under directory bindings/, and refer to README file of
corresponding languages.