summaryrefslogtreecommitdiff
path: root/python/lowlevelil.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2018-09-04 20:15:18 -0400
committerRusty Wagner <rusty@vector35.com>2018-09-04 20:15:18 -0400
commite51031010b107089dd7b5b69039ac42b856a0769 (patch)
tree02e4e9deb3453ce7c0372c00db3bdb98c83e6667 /python/lowlevelil.py
parentd13dba15dab0484fa237bf741948582afb517253 (diff)
Add API to create graphs of IL functions
Diffstat (limited to 'python/lowlevelil.py')
-rw-r--r--python/lowlevelil.py13
1 files changed, 10 insertions, 3 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py
index ec7c37fd..b2a28d6e 100644
--- a/python/lowlevelil.py
+++ b/python/lowlevelil.py
@@ -734,9 +734,9 @@ class LowLevelILFunction(object):
if handle is not None:
self.handle = core.handle_of_type(handle, core.BNLowLevelILFunction)
else:
- func_handle = None
- if self.source_function is not None:
- func_handle = self.source_function.handle
+ if self.source_function is None:
+ raise ValueError("IL functions must be created with an associated function")
+ func_handle = self.source_function.handle
self.handle = core.BNCreateLowLevelILFunction(arch.handle, func_handle)
def __del__(self):
@@ -2354,6 +2354,13 @@ class LowLevelILFunction(object):
return None
return result
+ def create_graph(self, settings = None):
+ if settings is not None:
+ settings_obj = settings.handle
+ else:
+ settings_obj = None
+ return binaryninja.flowgraph.CoreFlowGraph(core.BNCreateLowLevelILFunctionGraph(self.handle, settings_obj))
+
class LowLevelILBasicBlock(basicblock.BasicBlock):
def __init__(self, view, handle, owner):