View Issue Details

IDProjectCategoryView StatusLast Update
0008949Kali LinuxKali Package Bugpublic2024-10-09 05:12
ReporterAPWN Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
Status newResolutionopen 
Summary0008949: AttributeError: module 'capstone' has no attribute 'CS_ARCH_ARM64'
Description

System information:Linux kali 6.10.9-amd64 ReFirmLabs#1 SMP PREEMPT_DYNAMIC Kali 6.10.9-1kali1 (2024-09-09) x86_64 GNU/Linux
python information: 3.12.6

When I run binwalk, it appears:

Traceback (most recent call last):
File "/usr/bin/binwalk", line 33, in
sys.exit(load_entry_point('binwalk==2.4.2', 'console_scripts', 'binwalk')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/bin/binwalk", line 25, in importlib_load_entry_point
return next(matches).load()
^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/metadata/init.py", line 205, in load
module = import_module(match.group('module'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.12/importlib/init.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 995, in exec_module
File "", line 488, in _call_with_frames_removed
File "/usr/lib/python3/dist-packages/binwalk/main.py", line 24, in
import binwalk.modules
File "/usr/lib/python3/dist-packages/binwalk/modules/init.py", line 3, in
from binwalk.modules.disasm import Disasm
File "/usr/lib/python3/dist-packages/binwalk/modules/disasm.py", line 21, in
class Disasm(Module):
File "/usr/lib/python3/dist-packages/binwalk/modules/disasm.py", line 60, in Disasm
Architecture(type=capstone.CS_ARCH_ARM64,
^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'capstone' has no attribute 'CS_ARCH_ARM64'. Did you mean: 'CS_ARCH_ARM'?

I try to update binwalk,but it is the newest. Then I followed the instructions to find the corresponding disasm.py and modify it。I modify the "ARM64" to "ARM", just like:

ARCHITECTURES =[
Architecture(type=capstone.CS_ARCH_ARM,
mode=capstone.CS_MoDE_ARM,
endiannesS=capstone.CS_MODE_BIG_ENDIAN,
description="ARM executable code, 32-bit, big endian"),
Architecture(type=capstone.CS_ARCH_ARM,
mode=capstone.CS_MoDE_ARM,
endiannesS=capstone.CS_MODE_LITTLE_ENDIAN,
description="ARM executable code, 32-bit, little endian"),
Architecture(type=capstone.CS_ARCH_ARM,
mode=capstone.CS_MODE_ARM,
endianness=capstone.CS_MODE_BIG_ENDIAN,
description="ARM executable code, 64-bit, big endian"),
Architecture(type=capstone.CS_ARCH_ARM,
mode=capstone.CS_MODE_ARM,
romendiannesS=capstone.CS_MODE_LITTLE_ENDIAN,
Devicesdescription="ARM executable code, 64-bit, little endian"),

binwalk is then ready to run。

I would like to know why this is, and does my modification affect binwalk?

Then someone told me that it might be Kali Linux, so I came to report it now.

Activities

kali-bugreport

kali-bugreport

2024-10-08 04:44

reporter   ~0019879

Last edited: 2024-10-08 04:56

You should contact the binwalk developer about this question

kali-bugreport

kali-bugreport

2024-10-08 05:18

reporter   ~0019880

Would be good if you would include info directly that the binwalk author was already contacted:

https://github.com/OSPG/binwalk/issues/25

Seems some insights was given a few hours ago:

binwalk requires capstone >= 5.0 but the latest version on Kali Linux is capstone-4.0.2. Please report this issue to Kali Linux too.

btw, capstone is not a required dependency of binwalk, it can work properly without it. If you want to use capstone you could install it from pip as a workaround.

arnaudr

arnaudr

2024-10-09 02:57

manager   ~0019882

What command do you run exactly?

I just installed binwalk in a up-to-date Kali Linux VM, I run binwalk and I get the usage message, no error.

The packages binwalk and capstone are packaged by Debian, it's not something that we package in Kali Linux. The bug should be reported in the Debian bugtracker.

kali-bugreport

kali-bugreport

2024-10-09 05:12

reporter   ~0019883

--disasm needs to be passed so that capstone is used

Issue History

Date Modified Username Field Change
2024-10-08 00:57 APWN New Issue
2024-10-08 04:44 kali-bugreport Note Added: 0019879
2024-10-08 04:56 kali-bugreport Note Edited: 0019879
2024-10-08 05:18 kali-bugreport Note Added: 0019880
2024-10-09 02:19 arnaudr Description Updated
2024-10-09 02:57 arnaudr Note Added: 0019882
2024-10-09 05:12 kali-bugreport Note Added: 0019883