summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2016-05-17 23:12:18 -0400
committerRusty Wagner <rusty@vector35.com>2016-05-17 23:12:18 -0400
commitcef6e55ba5aa55bfd2e168df7ac0e477e8dceffc (patch)
tree6d065115ab1c74813077eb907e27161b2946fa40 /python
parent72bf56348109d87994928dee244dd97a27480c6d (diff)
IL basic blocks are now in the IL function class
Diffstat (limited to 'python')
-rw-r--r--python/__init__.py42
1 files changed, 17 insertions, 25 deletions
diff --git a/python/__init__.py b/python/__init__.py
index ebaf030e..06cda6e1 100644
--- a/python/__init__.py
+++ b/python/__init__.py
@@ -2157,34 +2157,12 @@ class Function(object):
core.BNGetFunctionLowLevelIL(self.handle)), self)
@property
- def low_level_il_basic_blocks(self):
- """Function low level IL basic blocks (read-only)"""
- count = ctypes.c_ulonglong()
- blocks = core.BNGetFunctionLowLevelILBasicBlockList(self.handle, count)
- result = []
- for i in xrange(0, count.value):
- result.append(BasicBlock(self._view, core.BNNewBasicBlockReference(blocks[i])))
- core.BNFreeBasicBlockList(blocks, count.value)
- return result
-
- @property
def lifted_il(self):
"""Function lifted IL (read-only)"""
return LowLevelILFunction(self.arch, core.BNNewLowLevelILFunctionReference(
core.BNGetFunctionLiftedIL(self.handle)), self)
@property
- def lifted_il_basic_blocks(self):
- """Function lifted IL basic blocks (read-only)"""
- count = ctypes.c_ulonglong()
- blocks = core.BNGetFunctionLiftedILBasicBlockList(self.handle, count)
- result = []
- for i in xrange(0, count.value):
- result.append(BasicBlock(self._view, core.BNNewBasicBlockReference(blocks[i])))
- core.BNFreeBasicBlockList(blocks, count.value)
- return result
-
- @property
def type(self):
"""Function type (read-only)"""
return Type(core.BNGetFunctionType(self.handle))
@@ -3962,7 +3940,7 @@ class LowLevelILFunction(object):
if handle is not None:
self.handle = core.handle_of_type(handle, core.BNLowLevelILFunction)
else:
- self.handle = core.BNCreateLowLevelILFunction()
+ self.handle = core.BNCreateLowLevelILFunction(arch.handle)
def __del__(self):
core.BNFreeLowLevelILFunction(self.handle)
@@ -3985,6 +3963,17 @@ class LowLevelILFunction(object):
"""Number of temporary flags (read-only)"""
return core.BNGetLowLevelILTemporaryFlagCount(self.handle)
+ @property
+ def basic_blocks(self):
+ """Low level IL basic blocks (read-only)"""
+ count = ctypes.c_ulonglong()
+ blocks = core.BNGetLowLevelILBasicBlockList(self.handle, count)
+ result = []
+ for i in xrange(0, count.value):
+ result.append(BasicBlock(self._view, core.BNNewBasicBlockReference(blocks[i])))
+ core.BNFreeBasicBlockList(blocks, count.value)
+ return result
+
def __setattr__(self, name, value):
try:
object.__setattr__(self,name,value)
@@ -4252,8 +4241,11 @@ class LowLevelILFunction(object):
core.BNLowLevelILSetExprSourceOperand(self.handle, expr.index, n)
return expr
- def finalize(self):
- core.BNFinalizeLowLevelILFunction(self.handle)
+ def finalize(self, func = None):
+ if func is None:
+ core.BNFinalizeLowLevelILFunction(self.handle, None)
+ else:
+ core.BNFinalizeLowLevelILFunction(self.handle, func.handle)
def add_label_for_address(self, arch, addr):
if arch is not None: