Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
Go to file
Travis Finkenauer 65da43d0b1 Declare global arch arrays with contents (next branch) (#1186)
* Declare global arch arrays with contents (#1171)

This eliminates the need for archs_enable() and eliminates the racey
initialization.

This makes the architecture-specific init and option functions
non-static so that they may be called from a different file.

Cherry-picked 853a2870

* Add cs_arch_disallowed_mode_mask global

Cherry-pick 94bce437:
mips: CS_MODE_MIPS32R6 implies CS_MODE_32

Cherry-pick 8998a3a1:
ppc: fix endian check (#1029)
Fixes bug where endianness could not be set for ppc.

Remove `big_endian` field of `cs_struct`.
Added a helper macro `MODE_IS_BIG_ENDIAN()` to check if
`CS_MODE_BIG_ENDIAN` is set.

Refactored `cs_open()` check for valid mode out of arch-specific code
into arch-independent code. Also added a valid mode check to
`cs_option()`.  The checks use a new global array
`cs_arch_disallowed_mode_mask[]`.

* Make global arrays static

Make all_arch uint32_t to guarantee a certain number of bits (with
adequate room for growth).
2018-06-24 21:05:04 +08:00
arch Declare global arch arrays with contents (next branch) (#1186) 2018-06-24 21:05:04 +08:00
bindings Java: pump number of Mips operands to 10. see #1183 2018-06-19 09:36:38 +08:00
contrib fix typo, style 2016-09-28 07:33:14 -07:00
cstool EVM: add missing files 2018-03-31 17:32:22 +08:00
docs fix typo, style 2016-09-28 07:33:14 -07:00
include Extends Mips number of operands (#1183) 2018-06-19 09:33:47 +08:00
msvc Fix MSVC build (#1080) 2018-01-23 11:12:41 +08:00
packages Remove homebrew formula (#1139) 2018-05-18 10:54:42 +08:00
suite Builds a test corpus for fuzzing (#1184) 2018-06-19 09:31:50 +08:00
tests EVM: add missing files 2018-03-31 17:32:22 +08:00
windows provide a validity check to prevent against Integer overflow conditions (#870) 2017-03-13 23:35:29 +08:00
windowsce Added documentation for building for Windows CE. 2016-04-12 09:26:47 +02:00
xcode macOS framework - Added a module map for Swift/Objective-C. (#1057) 2017-11-28 00:46:18 +08:00
.appveyor.yml rename appveyor.yml to .appveyor.yml 2016-03-15 00:01:10 +08:00
.gitattributes Fix language statistics by considering *.inc files to be C files. (#1078) 2018-01-14 20:42:20 +08:00
.gitignore add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
.travis.yml Revert "cleanup travis and use environment variables" 2017-10-09 08:53:16 +08:00
capstone.pc.in fixed hardcoded paths with variables. (#1018) 2017-09-27 09:32:54 +08:00
ChangeLog Java: Support cs_strerror() and cs_regs_access() 2016-11-27 13:59:12 +01:00
CMakeLists.txt Integrate capstone with oss-fuzz (#1150) 2018-06-01 20:47:19 +08:00
COMPILE_CMAKE.TXT add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
COMPILE_MSVC.TXT fix typo, style 2016-09-28 07:33:14 -07:00
COMPILE.TXT add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
config.mk add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
CREDITS.TXT Adds Philippe Antoine (Catena cyber) to credits (#1153) 2018-06-01 22:41:17 +08:00
cs_priv.h Declare global arch arrays with contents (next branch) (#1186) 2018-06-24 21:05:04 +08:00
cs.c Declare global arch arrays with contents (next branch) (#1186) 2018-06-24 21:05:04 +08:00
functions.mk Makefile: put common functions into functions.mk 2014-05-01 22:53:52 +08:00
HACK.TXT M680X: Target ready for pull request (#1034) 2017-10-21 21:44:36 +08:00
LEB128.h Undefined shifts (#1154) 2018-06-02 16:49:36 +08:00
LICENSE_LLVM.TXT initial import 2013-11-27 12:11:31 +08:00
LICENSE.TXT a a newline to LICENSE.TXT 2014-02-20 17:08:28 +08:00
make.sh Move functionality from make.sh to Makefile (#1142) 2018-05-17 16:30:05 +08:00
Makefile Move functionality from make.sh to Makefile (#1142) 2018-05-17 16:30:05 +08:00
MathExtras.h fix undefined shift in countLeadingZeros (#1157) 2018-06-03 22:27:54 +08:00
MCDisassembler.h 2015 2015-03-04 17:45:23 +08:00
MCFixedLenDisassembler.h 2015 2015-03-04 17:45:23 +08:00
MCInst.c Add Availability.h include to fix macOS SDK instrinsics 2018-06-15 22:14:48 +08:00
MCInst.h add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
MCInstrDesc.c 2015 2015-03-04 17:45:23 +08:00
MCInstrDesc.h Added support for building binaries for Windows CE 7 on ARMv7 (a.k.a., Windows Embedded Compact 7) and for Windows CE 8 on ARMv7 (a.k.a., Windows Embedded Compact 2013). 2016-04-07 17:05:00 +02:00
MCRegisterInfo.c mips: update core 2015-03-02 15:12:42 +08:00
MCRegisterInfo.h Added support for building binaries for Windows CE 7 on ARMv7 (a.k.a., Windows Embedded Compact 7) and for Windows CE 8 on ARMv7 (a.k.a., Windows Embedded Compact 2013). 2016-04-07 17:05:00 +02:00
nmake-x86.bat fix nmake-x86.bat 2017-05-21 21:33:47 -07:00
nmake.bat add nmake.bat 2017-03-13 15:07:28 +08:00
pkgconfig.mk Python: Automatically conform to PEP440 for version numbers. ported from Unicorn Python binding 2017-02-01 13:23:15 +08:00
README.md add Ethereum VM architecture 2018-03-31 17:29:22 +08:00
RELEASE_NOTES RELEASE_NOTES 2015-03-12 00:11:03 +08:00
SStream.c Add Availability.h include to fix macOS SDK instrinsics 2018-06-15 22:14:48 +08:00
SStream.h Added support for building binaries for Windows CE 7 on ARMv7 (a.k.a., Windows Embedded Compact 7) and for Windows CE 8 on ARMv7 (a.k.a., Windows Embedded Compact 2013). 2016-04-07 17:05:00 +02:00
TODO TODO 2015-03-11 11:33:00 +08:00
utils.c Add Availability.h include to fix macOS SDK instrinsics 2018-06-15 22:14:48 +08:00
utils.h M680X: Target ready for pull request (#1034) 2017-10-21 21:44:36 +08:00

Capstone Engine

Build Status Build status

Capstone is a disassembly framework with the target of becoming the ultimate disasm engine for binary analysis and reversing in the security community.

Created by Nguyen Anh Quynh, then developed and maintained by a small community, Capstone offers some unparalleled features:

  • Support multiple hardware architectures: ARM, ARM64 (ARMv8), Ethereum VM, M68K, Mips, PPC, Sparc, SystemZ, TMS320C64X, M680X, XCore and X86 (including X86_64).

  • Having clean/simple/lightweight/intuitive architecture-neutral API.

  • Provide details on disassembled instruction (called “decomposer” by others).

  • Provide semantics of the disassembled instruction, such as list of implicit registers read & written.

  • Implemented in pure C language, with lightweight bindings for PHP, PowerShell, Emacs, Haskell, Perl, Python, Ruby, C#, NodeJS, Java, GO, C++, OCaml, Lua, Rust, Delphi, Free Pascal & Vala ready either in main code, or provided externally by the community).

  • Native support for all popular platforms: Windows, Mac OSX, iOS, Android, Linux, *BSD, Solaris, etc.

  • Thread-safe by design.

  • Special support for embedding into firmware or OS kernel.

  • High performance & suitable for malware analysis (capable of handling various X86 malware tricks).

  • Distributed under the open source BSD license.

Further information is available at http://www.capstone-engine.org

Compile

See COMPILE.TXT file for how to compile and install Capstone.

Documentation

See docs/README for how to customize & program your own tools with Capstone.

Hack

See HACK.TXT file for the structure of the source code.

License

This project is released under the BSD license. If you redistribute the binary or source code of Capstone, please attach file LICENSE.TXT with your products.