Skip to content

[WIP] Capstone v6 support #178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 31 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
baf3b35
sys: bump capstone to 6.0.0-alpha4, fix arm64 and sysz rename
jiegec May 23, 2025
16a79bb
rs: rename arm64 -> aarch64 and sysz -> systemz to follow upstream
jiegec May 23, 2025
bad92c4
rs: adapt to capstone v6 changes, mainly in aarch64
jiegec May 23, 2025
7fc47c6
rs: use aarch64_reg::Type for windows compat
jiegec May 23, 2025
7d95409
rs: run cargo fmt to make ci happy
jiegec May 23, 2025
f70c03d
rs, sys: mention capstone 6.0.0-alpha4 and arch renaming in CHANGELOG
jiegec May 23, 2025
1979708
rs: avoid possible panics in library functions
jiegec May 23, 2025
308c2c9
rs: add missing doc comments
jiegec May 23, 2025
cb58b6a
rs, sys: generate arm_spsr_cspr_bits as bitfield enum
jiegec May 24, 2025
21b9423
rs: add previously failed testcase from issue 175
jiegec May 24, 2025
9ba8dce
ci: rename arch_arm64 to arch_aarch64 feature
jiegec May 24, 2025
7dc3b14
sys: add Alpha arch support
jiegec May 24, 2025
9d765ac
rs, sys: fix feature detection after renaming
jiegec May 24, 2025
1478639
sys: add HPPA arch support
jiegec May 24, 2025
4f1ca44
sys: add LoongArch arch support
jiegec May 24, 2025
920b451
sys: add Xtensa arch support
jiegec May 24, 2025
21c36da
sys: add ARC arch support
jiegec May 24, 2025
baa20ed
sys: move bpf bindings around to become in order
jiegec May 24, 2025
c22abbb
rs: add Alpha arch support
jiegec May 24, 2025
b9a3d73
sys: fix build.rs lifetime for Rust 1.70.0
jiegec May 24, 2025
b45ee1d
rs: add HPPA arch support
jiegec May 24, 2025
bb3b9db
rs: add LoongArch arch support
jiegec May 24, 2025
a7082ee
rs: rename variable to reflect its type
jiegec May 24, 2025
897f845
rs: disable failing hppa test due to upstream bug
jiegec May 24, 2025
d8398a4
rs: add Xtensa arch support
jiegec May 24, 2025
73148cc
rs: fix tests on windows
jiegec May 24, 2025
b2cb063
rs: add ARC arch support
jiegec May 24, 2025
450ea65
rs: fix type conversion on windows
jiegec May 24, 2025
7efae1a
rs: bump capstone to 6.0.0-Alpha4-8-gefc0ba44 to fix upstream bugs
jiegec May 26, 2025
e03ba73
rs: update tests after upstream bugs are fixed
jiegec May 26, 2025
5c269b5
rs: test CS_OPT_UNSIGNED using x86 code
jiegec May 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:
- name: test (all features)
run: env ${{ matrix.rust.env }} ALL_FEATURES=1 ./capstone-rs/ci/test.sh

- name: test (only enable x86 and arm64)
run: env ${{ matrix.rust.env }} FEATURES=std,full,arch_x86,arch_arm64 NO_DEFAULT_FEATURES=1 ./capstone-rs/ci/test.sh
- name: test (only enable x86 and aarch64)
run: env ${{ matrix.rust.env }} FEATURES=std,full,arch_x86,arch_aarch64 NO_DEFAULT_FEATURES=1 ./capstone-rs/ci/test.sh
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- TriCore arch support
- MOS65XX arch support
- SH arch support
- Alpha arch support
- HPPA arch support
- LoongArch arch support
- Xtensa arch support
- ARC arch support
- Arch-specific features flags to enable/disable arch support
- Expose X86 instruction encoding info via `X86InsnDetail::encoding()`
- Make RegAccessType available for ARM64
- Rename RegAccessType to AccessType while keeping type alias
- Expose `CS_OPT_UNSIGNED` via `Capstone::set_unsigned`
- Expose `CS_OPT_MNEMONIC` via `Capstone::set_mnemonic`
- Rename ARM64 to AARCH64, SYSZ to SYSTEMZ to follow upstream changes

### Changed
- `InsnDetail::regs_read()`/`InsnDetail::regs_write()` return more of the accessed registers
- Bump bundled capstone to 5.0.6
- Bump bundled capstone to 6.0.0-Alpha4

## [0.13.0] - 2025-02-04
### Added
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ More complex demos welcome!
- `use_bindgen`: run `bindgen` to generate Rust bindings to Capstone C library
instead of using pre-generated bindings (not recommended).
- `arch_$ARCH`<sup>&dagger;</sup>: enable arch `$ARCH` support in capstone,
e.g. `arch_arm64` enables arch arm64 support.
e.g. `arch_aarch64` enables arch aarch64 support.
- `support_all_archs`<sup>&dagger;</sup>: enable all archs available
in capstone, imply all `arch_$ARCH` features.

Expand Down
18 changes: 14 additions & 4 deletions capstone-rs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,14 @@ full = ["capstone-sys/full"]
use_bindgen = ["capstone-sys/use_bindgen"]
# arch specific features to reduce binary size
support_all_archs = [
"arch_aarch64",
"arch_alpha",
"arch_arc",
"arch_arm",
"arch_arm64",
"arch_bpf",
"arch_evm",
"arch_hppa",
"arch_loongarch",
"arch_m680x",
"arch_m68k",
"arch_mips",
Expand All @@ -50,18 +54,23 @@ support_all_archs = [
"arch_riscv",
"arch_sh",
"arch_sparc",
"arch_sysz",
"arch_systemz",
"arch_tms320c64x",
"arch_tricore",
"arch_wasm",
"arch_x86",
"arch_xcore",
"arch_xtensa",
"capstone-sys/support_all_archs",
]
arch_aarch64 = ["capstone-sys/arch_aarch64"]
arch_alpha = ["capstone-sys/arch_alpha"]
arch_arc = ["capstone-sys/arch_arc"]
arch_arm = ["capstone-sys/arch_arm"]
arch_arm64 = ["capstone-sys/arch_arm64"]
arch_bpf = ["capstone-sys/arch_bpf"]
arch_evm = ["capstone-sys/arch_evm"]
arch_hppa = ["capstone-sys/arch_hppa"]
arch_loongarch = ["capstone-sys/arch_loongarch"]
arch_m680x = ["capstone-sys/arch_m680x"]
arch_m68k = ["capstone-sys/arch_m68k"]
arch_mips = ["capstone-sys/arch_mips"]
Expand All @@ -70,9 +79,10 @@ arch_powerpc = ["capstone-sys/arch_powerpc"]
arch_riscv = ["capstone-sys/arch_riscv"]
arch_sh = ["capstone-sys/arch_sh"]
arch_sparc = ["capstone-sys/arch_sparc"]
arch_sysz = ["capstone-sys/arch_sysz"]
arch_systemz = ["capstone-sys/arch_systemz"]
arch_tms320c64x = ["capstone-sys/arch_tms320c64x"]
arch_tricore = ["capstone-sys/arch_tricore"]
arch_wasm = ["capstone-sys/arch_wasm"]
arch_x86 = ["capstone-sys/arch_x86"]
arch_xcore = ["capstone-sys/arch_xcore"]
arch_xtensa = ["capstone-sys/arch_xtensa"]
Loading
Loading