Information*/Troubleshoot

How to install binary ninja python API (in mac m1)

ch4rli3kop 2022. 8. 25. 18:35
반응형

How to install binary ninja python API (in mac m1)

Trouble

I have the payment of the binary ninja personal edition a month ago. But, when I use the python API of the binary ninja, there is some problem like the below.

ch4rli3kop in [~/code_snippets/BinaryNinja/binaryninja-api] 15:29:09 › python3
Python 3.8.9 (default, Oct 26 2021, 07:25:53)
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from binaryninja import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'binaryninja'

Solution

By running script /Applications/Binary Ninja.app/Contents/Resources/scripts/install_api.py, we can install python API easily.

ch4rli3kop in [/Applications/Binary Ninja.app/Contents/Resources/scripts] 18:01:18 › ls
install_api.py
ch4rli3kop in [/Applications/Binary Ninja.app/Contents/Resources/scripts] 17:58:12 › python3 install_api.py
Binary Ninja API already in the path

If the python path of the binary ninja is successfully added to the system python package path, we can import the binary ninja API on our python console.

ch4rli3kop in [/Applications/Binary Ninja.app/Contents/Resources/scripts] 17:58:16 › python3
Python 3.8.9 (default, Oct 26 2021, 07:25:53)
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from binaryninja import *
>>> exit()

 

[+]
But... I found personal user doesn't use headless mode..!
personal license user can use python-api only in the python console of binary ninja... :(

반응형

'Information* > Troubleshoot' 카테고리의 다른 글

zsh plugin 오류  (0) 2023.04.26
Trouble shoot with installing gef  (0) 2022.08.29
Hyper-v 로그인 화면 안 뜰 때  (0) 2022.05.20
wslregisterdistribution failed with error: 0x80370102  (0) 2021.10.05
WinAFL build error  (0) 2021.09.30