FS#58835 - [binwalk] 2.1.1-4 failed on lacking attributes in module 'capstone'

Attached to Project: Community Packages
Opened by Ting-Wei Lin (t1016d) - Saturday, 02 June 2018, 04:10 GMT
Last edited by Doug Newgard (Scimmia) - Saturday, 02 June 2018, 06:05 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To No-one
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


When Executing binwalk, I get `AttributeError: module 'capstone' has no attribute 'CS_ARCH_ARM'`.
It can't execute even with --help option.

I've managed to get it work after installing `python-capstone` (3.0.4-5), I think binwalk should have python-capstone as dependency.
(I also tested that only installing `capstone 3.0.4-5` doesn't fix it)

Additional info:
* package version(s):
binwalk 2.1.1-4
python 3.6.5-3

* Here's the complete error message
Traceback (most recent call last):
File "/usr/bin/binwalk", line 26, in <module>
import binwalk.modules
File "/usr/lib/python3.6/site-packages/binwalk/modules/__init__.py", line 3, in <module>
from binwalk.modules.disasm import Disasm
File "/usr/lib/python3.6/site-packages/binwalk/modules/disasm.py", line 16, in <module>
class Disasm(Module):
File "/usr/lib/python3.6/site-packages/binwalk/modules/disasm.py", line 47, in Disasm
AttributeError: module 'capstone' has no attribute 'CS_ARCH_ARM'

Steps to reproduce:
Install binwalk and execute it.
(Without installing python-capstone)
This task depends upon

Closed by  Doug Newgard (Scimmia)
Saturday, 02 June 2018, 06:05 GMT
Reason for closing:  Not a bug
Comment by Doug Newgard (Scimmia) - Saturday, 02 June 2018, 04:43 GMT
Works fine for me. Is this on Arch or Arch ARM?

The package in question is clearly marked as an optional dep already; since the package seems to function without it, I'm not seeing an issue.
Comment by Pochang Chen (johnchen902) - Saturday, 02 June 2018, 06:01 GMT
After discussing with @t1016d, we found the culprit (his system was broken).
To reproduce, uninstall python-capstone and run:

# mkdir /usr/lib/python3.6/site-packages/capstone
$ binwalk

I have no idea how the directory got into his system, though.