summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2017-11-06 17:29:57 -0500
committerPeter LaFosse <peter@vector35.com>2017-11-06 17:29:57 -0500
commit16a4d413d58d2cb29be97781bba0b52546afa390 (patch)
treee9f27f78d024606faa18acc763813c2d1f9321db
parentb54bf0745bd9ef9809dfce1a8937622f8ed92df5 (diff)
parentaf062c5608b6a4abb60c3d6ebc193d3ac929165b (diff)
Merge branch 'dev'
-rw-r--r--docs/guide/plugins.md4
-rw-r--r--python/function.py4
-rw-r--r--python/mediumlevelil.py6
-rw-r--r--python/scriptingprovider.py8
-rwxr-xr-xscripts/linux-setup.sh2
5 files changed, 14 insertions, 10 deletions
diff --git a/docs/guide/plugins.md b/docs/guide/plugins.md
index 9c67d44f..442d6fe4 100644
--- a/docs/guide/plugins.md
+++ b/docs/guide/plugins.md
@@ -36,9 +36,9 @@ Binary Ninja now offers a [PluginManager API] which can simplify the process of
['__class__', '__delattr__', '__dict__', '__doc__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', 'add_repository', 'check_for_updates', 'default_repository', 'disable_plugin', 'enable_plugin', 'handle', 'install_plugin', 'plugins', 'repositories', 'uninstall_plugin', 'update_plugin']
>>> mgr.plugins
{'default': [<binaryninja-bookmarks not-installed/disabled>, <binaryninja-msp430 not-installed/disabled>, <binaryninja-radare2 not-installed/disabled>, <binaryninja-spu not-installed/disabled>, <binja-avr not-installed/disabled>, <binja_smali not-installed/disabled>, <binjatron not-installed/disabled>, <binoculars not-installed/disabled>, <easypatch not-installed/disabled>, <liil installed/enabled>, <list_comments not-installed/disabled>, <x64dbgbinja not-installed/disabled>]}
->>> mgr.install_plugin(easypatch)
+>>> mgr.install_plugin("easypatch")
True
->>> mgr.enable(easypatch)
+>>> mgr.enable_plugin("easypatch")
True
```
diff --git a/python/function.py b/python/function.py
index cbbdf9bd..f8aaae44 100644
--- a/python/function.py
+++ b/python/function.py
@@ -241,10 +241,10 @@ class Variable(object):
return self.name
def __eq__(self, other):
- return self.identifier == other.identifier
+ return (self.identifier, self.function) == (other.identifier, other.function)
def __hash__(self):
- return hash(self.identifier)
+ return hash((self.identifier, self.function))
class ConstantReference(object):
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 9167212a..6f5515bb 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -39,12 +39,12 @@ class SSAVariable(object):
def __eq__(self, other):
return (
- (self.var.identifier, self.version) ==
- (other.var.identifier, other.version)
+ (self.var, self.version) ==
+ (other.var, other.version)
)
def __hash__(self):
- return hash((self.var.identifier, self.version))
+ return hash((self.var, self.version))
class MediumLevelILLabel(object):
diff --git a/python/scriptingprovider.py b/python/scriptingprovider.py
index 211d2fb7..f9758cc9 100644
--- a/python/scriptingprovider.py
+++ b/python/scriptingprovider.py
@@ -540,8 +540,12 @@ class PythonScriptingInstance(ScriptingInstance):
self.locals["current_address"] = self.active_addr
self.locals["here"] = self.active_addr
self.locals["current_selection"] = (self.active_selection_begin, self.active_selection_end)
- self.locals["current_llil"] = self.active_func.low_level_il
- self.locals["current_mlil"] = self.active_func.medium_level_il
+ if self.active_func == None:
+ self.locals["current_llil"] = None
+ self.locals["current_mlil"] = None
+ else:
+ self.locals["current_llil"] = self.active_func.low_level_il
+ self.locals["current_mlil"] = self.active_func.medium_level_il
self.interpreter.runsource(code)
diff --git a/scripts/linux-setup.sh b/scripts/linux-setup.sh
index f1650b7f..8bf15ddd 100755
--- a/scripts/linux-setup.sh
+++ b/scripts/linux-setup.sh
@@ -61,7 +61,7 @@ lastrun()
pythonpath()
{
echo Configuring python path
- ${SUDO}python ${BNPATH}/install_api.py $ROOT
+ ${SUDO}python ${BNPATH}/scripts/install_api.py $ROOT
}
createdesktopfile()