capstone/bindings/python
Rot127 faffeec2dc
Fix naming convention of Alpha enums. (#2971)
All the enum names were prefixed with `Alpha` instead of `ALPHA`.
That happened because of an old Auto-Sync bug.
Sadly, I just recognized that Alpha was generated with it.
No idea why it got through in the PR in the first place.

I really would like that to have fixed before Beta.
And while it is super annoying for everyone to fix,
it is better to do as early as possible.

A simple command to replace all these occurrences in your code base is:
```
find . -type f -regex ".*\.\(c\|h\)$" -exec sed -i -E "s|Alpha_([A-Z0-9_]+)|ALPHA_\1|g" {} +
```

Please excuse the inconvenience!
2026-06-20 15:50:33 +00:00
..
capstone Fix naming convention of Alpha enums. (#2971) 2026-06-20 15:50:33 +00:00
cstest_py Add M68K ColdFire ISA support (#2927) 2026-05-22 15:04:35 +00:00
prebuilt Add ability to copy prebuilt libraries from prebuilt directory during python build 2017-03-04 17:09:07 -08:00
tests RISC-V: add reg_access and test its usages in C and Python (#2895) 2026-04-17 17:40:16 +00:00
.gitignore Modern Testing (#2456) 2024-08-31 21:33:38 +08:00
BUILDING.md Convert all README's to markdown files. (#2863) 2026-02-14 13:56:07 +00:00
LICENSE.TXT python: add LICENSE & PKG-INFO for Python module 2015-01-30 14:45:58 +08:00
MANIFEST.in Python package building rework (#2538) 2024-11-18 19:10:27 +08:00
pyproject.toml Python package building rework (#2538) 2024-11-18 19:10:27 +08:00
README.md Convert all README's to markdown files. (#2863) 2026-02-14 13:56:07 +00:00
setup.py Convert all README's to markdown files. (#2863) 2026-02-14 13:56:07 +00:00

To install Capstone, you should run pip install capstone.

If you would like to build and install Capstone with just the source distribution, just run python -m pip install ., considering you are in the folder with setup.py in it.

In order to use this source distribution, you will need an environment that can compile C code. On Linux, this is usually easy, but on Windows, this involves installing Visual Studio and using the "Developer Command Prompt" to perform the installation. See BUILDING.md for more information.

By default, attempting to install the python bindings will trigger a build of the capstone native core. If this is undesirable for whatever reason, for instance, you already have a globally installed copy of libcapstone, you may inhibit the build by setting the environment variable LIBCAPSTONE_PATH. The exact value is not checked, just setting it will inhibit the build. During execution, this variable may be set to the path of a directory containing a specific version of libcapstone you would like to use.

If you don't want to build your own copy of Capstone, you can use a precompiled binary distribution from PyPI. Saying pip install capstone should automatically obtain an appropriate copy for your system. If it does not, please open an issue at https://github.com/capstone-engine/capstone.


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, AARCH64 (ARMv8), Mips, PPC, Sparc, SystemZ, 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 wrappers for C++, C#, Go, Java, NodeJS, Ocaml, Python, Ruby & Vala ready (available 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

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.