* Add support for M68060 architecture in M68K disassembler and tests Add disassembly support for CAS instruction in M68060 and update tests Add support for M68K CPU32 mode and new instructions - Introduced CS_MODE_M68K_CPU32 to support the M68K CPU32 architecture in the Python bindings and C headers. - Updated the instruction table generator to include new CPU32-specific instructions: `bgnd`, `tbls`, `tblu`, `tblsn`, and `tblun`. - Enhanced the instruction decoding logic in `cs.c` to account for CPU32 mode. - Added test cases for new instructions and ensured compatibility with existing M68K modes. - Updated YAML test files to validate the behavior of new instructions under different M68K modes. fix(M68K): fix cross-arch bugs in cpush/cinv and dc.w printing build_cpush_cinv: use op1->reg instead of op1->imm for address register operand. Writing to imm (uint64_t) when reg (m68k_reg, uint32_t) is read back causes garbage values on big-endian targets (PPC64, s390x) due to union byte order mismatch. M68K_printInst: cast imm to uint32_t before passing to PRIx32 format. Passing uint64_t to a PRIx32 format specifier is UB; on 32-bit big-endian MIPS the high word (0) is read instead of the low word containing the instruction bytes. Fixes cstest details failures on QEMU Linux PPC64, s390x, Mips32. run clang-format fix[m68k]: ori build_imm_ea fix[m68k]: btst fix[m68k]: cast immediate values to unsigned int in build_imm_ea functions * fix get_with_index_address_mode * - Replaced specific assembly instructions with `dc.w` for invalid cases. - Added new test cases for SBCD, PACK, UNPK, CHK.L, and coprocessor instructions to ensure correct behavior across different CPU models. - Ensured that invalid instructions for CPU32 and 68000 are correctly identified. - Updated expected outputs for fsdiv and PMMU related instructions to reflect their validity on specific architectures. * Fix CMake test command to use target file reference for integration tests * Refactor PMOVE instruction comments for clarity and accuracy in m68k.yaml * Add tests for bitfield instructions and PC-relative addressing in m68k.yaml * Refactor M68K instruction printing and enhance bitfield support - Improved the M68K instruction printer by refactoring the handling of register bits and addressing modes. - Introduced new functions for printing scale factors, index registers, and immediate values. - Enhanced bitfield handling in the `m68k_op_mem` structure to support both static and register-encoded values. - Updated tests to reflect changes in instruction formatting, particularly for `cinvl`, `cpushl`, and `cas2` instructions. - Added new test cases for bitfield instructions to ensure correct parsing and output. - Add details to tests/m68k.yaml * Fix type casting for immediate values in addressing modes and enhance m68k architecture support in cstool * Refactor type usage for immediate values and enhance switch handling in M68K disassembler - Replace int with uint32_t for immediate values, register lists, and related parameters to ensure correct type handling and consistency. - Add default cases to switch statements for improved robustness. - Update bitfield printing to use explicit PRId8 formatting for clarity. - Refactor detail handling in M68KInstPrinter to use helper functions for detail access. - Minor code cleanups and improved type safety throughout disassembler logic. * m68k: update v6 guide |
||
|---|---|---|
| .. | ||
| capstone | ||
| cstest_py | ||
| prebuilt | ||
| tests | ||
| .gitignore | ||
| BUILDING.md | ||
| LICENSE.TXT | ||
| MANIFEST.in | ||
| pyproject.toml | ||
| README.md | ||
| setup.py | ||
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.