QuickstartΒΆ

Using 36-chambers requires a Binary Ninja installation as well as Binary Ninja being aware of your Python installation where the library will be installed. Ideally you’ll be using a VirtualEnv for this, however in order for your Binary Ninja application to be run using that environment, you’ll need to run it with something like the following:

DYLD_FRAMEWORK_PATH=/Users/username/.virtualenvs/binja /Applications/Binary\
Ninja.app/Contents/MacOS/binaryninja

The above assumes you have a virtualenv called “binja” in a ”.virtualenvs” directory in your home directory. The above command also assumes you are using MacOS. This should launch Binary Ninja and it should now have access to all Python libraries installed within your virtualenv.

The primary use of 36-chambers comes from the Chamber class. This will give you access to all of the functionality in 36-chambers. To instantiate the class, you’ll need the “bv” (BinaryView) object to pass in through the Binary Ninja console:

from chambers import Chamber

c = Chamber(bv=bv)

If you want to use 36-chambers in a Python script and not within Binary Ninja, you need to import Binary Ninja into your script and setup a BinaryView object:

import sys
try:
    import binaryninja
except ImportError:
    sys.path.append("/Applications/Binary\ Ninja.app/Contents/Resources/python/")
    import binaryninja

from chambers import Chamber

bv = binaryninja.BinaryViewType["PE"].open("/path/to/file")
bv.update_analysis()

c = Chamber(bv=bv)