No package found exception - OSX Sierra
0x4a47 opened this issue · 12 comments
Hi,
After some issues installing scruffy, I was excited to get binjatron working however ran into an issue where init.py cant find the 'defaults.yaml' package from the looks of it. Can't seem to trace the error or resolve it so was wondering if you guys could have a look.
Traceback is as follows:
Traceback (most recent call last):
File "/Users/jgrant/Library/Application Support/Binary Ninja/plugins/__init__.py", line 32, in <module>
config = ConfigFile('~/.binjatron.conf', defaults=PackageFile('defaults.yaml'), apply_env=True, env_prefix='BTRON')
File "/Library/Python/2.7/site-packages/scruffy/file.py", line 236, in __init__
super(PackageFile, self).__init__(path=path, create=create, cleanup=cleanup, parent=PackageDirectory(package=package))
File "/Library/Python/2.7/site-packages/scruffy/file.py", line 466, in __init__
raise Exception('No package found')
Exception: No package found
Python plugin '__init__' could not be loaded
Am stumped by this issue and can't seem to resolve it myself.
Any ideas?
Thanks in advance!
Hey,
First off, the fact that you had issues installing Scruffy sounds like you haven't installed Voltron? You'll need to install that per the README first (which will install Scruffy).
Secondly, it looks like you've installed binjatron incorrectly. You need to check out the entire binjatron directory (which is a Python package) into the BN plugins
folder.
$ cd ~/Library/Application\ Support/Binary\ Ninja/plugins/
$ git clone https://github.com/snare/binjatron
Make sure you're running the latest Binary Ninja and it should load automatically (previous versions did not support this new plugin architecture and you needed a /Library/Application Support/Binary Ninja/plugins/loader.py
or similarly named file that did import binjatron
)
I had a name conflict from the UML Scruffy which was why i had issues installing but my Voltron works perfectly!
When i clone it into /plugins/, BN doesnt pickup the init module at all, is it supposed to sit within its original folder such as /plugins/binjatron/ or am i to extract the contents into /plugins/ (im assuming the first is correct). If so, BN does not recognise the folder and it isn't loaded.
Im currently running V1.0.10 Personal.
Oh hmm.. maybe you do still need the loader.py
. I thought that had changed.
So yeah, as I said - you check out the entire directory and leave it as .../plugins/binjatron/
Then create a file at .../plugins/loader.py
which contains:
import binjatron
Or you can just type import binjatron
into the Python console when you launch BN
Just tested both methods on BN 1.0.10 and it works fine for me
And yeah sorry about the name collision. I was annoyed when I went to upload Scruffy to PyPI and realised I hadn't checked for a name collision. I should probably just rename the whole package to scruffington
but I'm too stubborn.
ohhhhhh gotcha, i didn't have the loader. It seems that if its all one module such as their test plugin examples like 'jump_table.py' (i used to test) it loads without the loader.py, but maybe due to the fact that binjatron is an init module, it still requires the loader on the outside that would act as the linker and get loaded. - Thats just a guess though!
I was baffled as to why it wasn't working and then realised so no stress, i hadn't grasped the fact that Voltron already installed it for me anyway.
Testing with loader.py now
Yeah the package format (ie. a directory with a __init__.py
etc) is the new "official" format that I thought BN supported properly already, but I might have been using that on the beta channel or something. The "old" format (like the examples - a single .py
file) will definitely work, so the loader.py
thing is a workaround.
If you have an empty ~/.binjatron.conf
, delete it. Looks like a Scruffy bug that falls over if you have an empty config file.
Nice! You're very welcome. Hope binjatron is helpful.