## Problem `stegoveritas-binwalk` (the bundled binwalk fork) fails to import on systems with capstone ≥ 5.0. `binwalk/modules/disasm.py` references `capstone.CS_ARCH_ARM64` as a class-level attribute, evaluated at **import time**: ```python Architecture(type=capstone.CS_ARCH_ARM64, ...) ``` In capstone 5.0, `CS_ARCH_ARM64` was renamed to `CS_ARCH_AARCH64`. This causes an immediate `AttributeError` before any test or analysis runs: ``` AttributeError: module 'capstone' has no attribute 'CS_ARCH_ARM64'. Did you mean: 'CS_ARCH_ARM'? File "binwalk/modules/disasm.py", line 60 ``` Additionally, `capstone` is not declared as a dependency of `stegoveritas-binwalk`, so it is not installed automatically. Discovered while packaging stegoveritas for Gentoo Linux: https://github.com/pentoo/pentoo-overlay/pull/2923 ## Fix Add a compatibility shim at the top of `binwalk/modules/disasm.py` (after `import capstone`): ```python # capstone 5.x renamed CS_ARCH_ARM64 to CS_ARCH_AARCH64; support both. _CS_ARCH_AARCH64 = getattr(capstone, 'CS_ARCH_AARCH64', None) or capstone.CS_ARCH_ARM64 ``` Then replace both `capstone.CS_ARCH_ARM64` references in `ARCHITECTURES` with `_CS_ARCH_AARCH64`. Also add `capstone` to the `stegoveritas-binwalk` package dependencies.
Activity