January 22, 2014

Release 2.0 deprecates verison 1.0 and brings a lot of crucial changes: see here on how to modify 1.0-based code to work with 2.0 API.

API changes:

  • API version has been bumped to 2.0 (see cs_version() API)

  • New API cs_strerror(errno) returns a string describing error code given in its only argument.

  • cs_version() now returns combined version encoding both major & minor versions.

  • New option CS_OPT_MODE allows to change engine’s mode at run-time with cs_option() API.

  • New option CS_OPT_MEM allows to specify user-defined functions for dynamically memory management used internally by Capstone. This is useful to embed Capstone into special environments such as kernel or firware.

  • New API cs_support() can be used to check if this lib supports a particular architecture (this is necessary since we now allow to choose which architectures to compile in).

  • The detail option is OFF by default now. To get detail information, it should be explicitly turned ON. The details then can be accessed using cs_insn.detail pointer (to newly added structure cs_detail)

Core changes

  • On memory usage, Capstone uses much less memory, but a lot faster now.

  • User now can choose which architectures to be supported by modifying config.mk file before compiling/installing.


  • Arm

    • Support Big-Endian mode (besides Little-Endian mode).

    • Support friendly register, so instead of output sub r12,r11,0x14, we have sub ip,fp,0x14.

  • Arm64: support Big-Endian mode (besides Little-Endian mode).

  • Mips: support friendly register, so instead of output srl $2,$1,0x1f, we have srl $v0,$at,0x1f.

  • PowerPC: newly added.

  • X86: bug fixes.

Python binding

  • Python binding is vastly improved in performance: around 3 ~ 4 times faster than in 1.0.

  • Cython support has been added, which can further speed up over the default pure Python binding (up to 60% in some benchmarks)

  • Function cs_disasm_quick() & Cs.disasm() now use generator (rather than a list) to return succesfully disassembled instructions. This improves the performance and reduces memory usage.

Java binding

  • Better performance & bug fixes.


  • Fixed some installation issues with Gentoo Linux.

  • Capstone now can easily compile/install on all *nix, including Linux, OSX, {Net, Free, Open}BSD & Solaris.