-
Notifications
You must be signed in to change notification settings - Fork 5
Open
Description
BinaryNinja Log during installation:
[Default] File "/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/lib/python3.11/ctypes/__init__.py", line 376, in __init__
[Default] self._handle = _dlopen(self._name, mode)
[Default] ^^^^^^^^^^^^^^^^^^^^^^^^^
[Default] OSError: dlopen(/Users/andrewl/Library/Application Support/Binary Ninja/python311/site-packages/capstone/lib/libcapstone.dylib, 0x0006): tried: '/Users/andrewl/Library/Application Support/Binary Ninja/python311/site-packages/capstone/lib/libcapstone.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64')), '/System/Volumes/Preboot/Cryptexes/OS/Users/andrewl/Library/Application Support/Binary Ninja/python311/site-packages/capstone/lib/libcapstone.dylib' (no such file), '/Users/andrewl/Library/Application Support/Binary Ninja/python311/site-packages/capstone/lib/libcapstone.dylib' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))
The wheel or whatever ends up with a dylib only for x86_64 instead of arm64.
When you delete plugins, the dependencies aren't deleted. So you can verify by removing keypatch, navigating to ~/Library/Application Support/Binary Ninja/python311/site-packages, deleting capstone and capstone-5.0.1.dist-info, then command palette for "Install python3 module...", enter capstone. The directories will reappear and:
$ file ./capstone/lib/libcapstone.dylib
./capstone/lib/libcapstone.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Another test is to look how Binja actually installs stuff, how it invokes PIP:
[Default] Running pip ['/opt/homebrew/Cellar/python@3.11/3.11.6_1/Frameworks/Python.framework/Versions/3.11/bin/python3.11', '-m', 'pip', '--isolated', '--disable-pip-version-check', 'install', '--upgrade', '--upgrade-strategy', 'only-if-needed', '--target', '/Users/andrewl/Library/Application Support/Binary Ninja/python311/site-packages', 'capstone']
We can then replicate this call outside of Binja and verify:
$ pip --isolated --disable-pip-version-check install --upgrade --upgrade-strategy only-if-needed --target /tmp/test capstone
$ file /tmp/test/capstone/lib/libcapstone.dylib
/tmp/test/capstone/lib/libcapstone.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Capstone seems aware of this issue: Universal wheel for macOS contains only x86_64 build #2154.
Metadata
Metadata
Assignees
Labels
No labels