capstone
Capstone disassembly engine
What it is and what it does
Capstone is a lightweight, architecture-neutral disassembly framework designed for binary analysis and reverse engineering. It decodes machine code into assembly instructions for multiple CPU architectures (ARM, ARM64, MIPS, PPC, Sparc, SystemZ, XCore, X86) and provides semantic details about each instruction, such as implicit register reads and writes. The core is implemented in C with Python bindings, making it suitable for malware analysis and security research.
The package is distributed as precompiled wheels for most platforms, so installation via pip is typically frictionless. If you need to build from source, a C compiler is required. You can optionally point to an existing system-installed libcapstone library via the LIBCAPSTONE_PATH environment variable to skip the build step. The single runtime dependency is importlib-resources.
Use it for:
- Disassemble and analyze malware binaries to understand their behavior and identify obfuscation techniques.
- Reverse-engineer compiled executables to audit security properties or recover lost source code.
- Build custom binary analysis tools that need to decode machine code across multiple CPU architectures.
- Analyze firmware or embedded system binaries where architecture support and lightweight overhead are critical.
- Implement security research workflows that require extracting and analyzing instruction semantics from compiled code.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Capstone is a disassembly engine that decodes binary machine code into human-readable assembly instructions across multiple CPU architectures including ARM, ARM64, MIPS, PPC, Sparc, SystemZ, XCore, and X86.
Yes. Capstone is a mature, widely-used disassembly engine with no known vulnerabilities, permissive licensing, and straightforward installation via precompiled wheels. It is the right choice if you need to decode and analyze binary code across multiple architectures.
Install
capstone on PyPI
pip
pip install capstoneuv
uv add capstonepoetry
poetry add capstoneInstalling capstone
Before you install
Precompiled wheels are available for most common platforms (macOS, Linux, Windows across multiple architectures), making installation straightforward via pip. A C compilation environment is only needed if building from source; the package has one lightweight runtime dependency.
License in practice
Released under the BSD license, which is permissive and allows commercial use, modification, and redistribution with minimal restrictions—you must include the LICENSE.TXT file with redistributed binaries or source.
Quickstart
pip install capstone
import capstone
md = capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_64)
for instr in md.disasm(b'\x00'):
print(instr.mnemonic)
Requires Python 3.8 or later; if building from source on Windows, Visual Studio and the Developer Command Prompt are needed to compile C code.
Verify before relying
- Whether the package provides semantics (implicit register reads/writes) through a straightforward API or requires additional configuration.
- Performance characteristics when disassembling large binaries or handling complex malware patterns.
- Thread-safety guarantees and any caveats for concurrent disassembly operations.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | 1 — importlib-resources |
| Maintenance | actively maintained — 78 days since the last release |
| First released | |
| Downloads | 3,560,655/month — #2,575 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: capstone-5.0.9-py3-none-macosx_10_9_universal2.whl; capstone-5.0.9-py3-none-macosx_10_9_x86_64.whl; capstone-5.0.9-py3-none-macosx_11_0_arm64.whl; capstone-5.0.9-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; capstone-5.0.9-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; capstone-5.0.9-py3-none-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl; capstone-5.0.9-py3-none-musllinux_1_2_aarch64.whl; capstone-5.0.9-py3-none-musllinux_1_2_i686.whl; capstone-5.0.9-py3-none-musllinux_1_2_x86_64.whl; capstone-5.0.9-py3-none-win_amd64.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
keystone-engineKeystone is a lightweight assembler framework…
permissive · top 15,000 on PyPI
py-cpuinfoDetects and reports CPU…
permissive · top 1,000 on PyPI
pcodedmpDisassembles VBA p-code from Microsoft Office…
copyleft · top 5,000 on PyPI
smdaSMDA is a recursive disassembler library that…
permissive · top 15,000 on PyPI
dncildncil is a Python library for disassembling…
permissive · top 15,000 on PyPI
ethereum-dasmDisassembles Ethereum EVM bytecode into…
copyleft · top 15,000 on PyPI
pypcodepypcode provides machine code disassembly and…
permissive · top 15,000 on PyPI
pwntoolsPwntools is a CTF framework and exploit…
permissive · top 5,000 on PyPI
ropperRopper displays binary file metadata and…
permissive · top 15,000 on PyPI
idaproEnables programmatic binary analysis and…
permissive · top 15,000 on PyPI