diff options
| author | Peter LaFosse <peter@vector35.com> | 2018-09-12 17:03:38 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2018-09-12 17:03:38 -0400 |
| commit | 74a8547853dd66fe62d2e75b93c1b723eb6f69cf (patch) | |
| tree | 067119496c2beaf0636c955d27291d4620e17c0b /python/lowlevelil.py | |
| parent | 097a2e4c8849d4938d8a027985ce3816fd9785ed (diff) | |
| parent | 59a2824b1ad36ea5d0520919e86ad779cd97cc8f (diff) | |
Merging with dev
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index f7f8926c..3d330aa9 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -366,6 +366,7 @@ class LowLevelILInstruction(object): name, operand_type = operand if operand_type == "int": value = instr.operands[i] + value = (value & ((1 << 63) - 1)) - (value & (1 << 63)) elif operand_type == "float": if instr.size == 4: value = struct.unpack("f", struct.pack("I", instr.operands[i] & 0xffffffff))[0] @@ -734,9 +735,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): @@ -2365,6 +2366,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): |
