From 6be6ee30e5973fa4d5f29cebdeafdf05c3f4251e Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 9 Sep 2016 03:29:14 -0400 Subject: Minor changes to API for creation of IL functions --- python/__init__.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'python') diff --git a/python/__init__.py b/python/__init__.py index e36670cc..7978fd2c 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -7201,7 +7201,10 @@ class LowLevelILFunction(object): if handle is not None: self.handle = core.handle_of_type(handle, core.BNLowLevelILFunction) else: - self.handle = core.BNCreateLowLevelILFunction(arch.handle) + func_handle = None + if self.source_function is not None: + func_handle = self.source_function.handle + self.handle = core.BNCreateLowLevelILFunction(arch.handle, func_handle) def __del__(self): core.BNFreeLowLevelILFunction(self.handle) @@ -8164,17 +8167,13 @@ class LowLevelILFunction(object): core.BNLowLevelILSetExprSourceOperand(self.handle, expr.index, n) return expr - def finalize(self, func = None): + def finalize(self): """ - ``finalize`` ends the provided LowLevelILLabel. + ``finalize`` ends the function and computes the list of basic blocks. - :param LowLevelILFunction func: optional function to end :rtype: None """ - if func is None: - core.BNFinalizeLowLevelILFunction(self.handle, None) - else: - core.BNFinalizeLowLevelILFunction(self.handle, func.handle) + core.BNFinalizeLowLevelILFunction(self.handle) def add_label_for_address(self, arch, addr): """ -- cgit v1.3.1