From cecb2af5e8ec590500379e4b103531649de4e5a2 Mon Sep 17 00:00:00 2001 From: Ryan Snyder Date: Mon, 20 Aug 2018 18:58:00 -0400 Subject: api: add methods to get basic block objects from IL instrs --- python/lowlevelil.py | 5 +++++ python/mediumlevelil.py | 5 +++++ 2 files changed, 10 insertions(+) (limited to 'python') diff --git a/python/lowlevelil.py b/python/lowlevelil.py index e714eb48..41579719 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -536,6 +536,11 @@ class LowLevelILInstruction(object): core.BNFreeInstructionText(tokens, count.value) return result + @property + def il_basic_block(self): + """IL basic block object containing this expression (read-only) (only available on finalized functions)""" + return LowLevelILBasicBlock(self.function.source_function.view, core.BNGetLowLevelILBasicBlockForInstruction(self.function.handle, self.instr_index), self.function) + @property def ssa_form(self): """SSA form of expression (read-only)""" diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index cfa8f900..c024d287 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -333,6 +333,11 @@ class MediumLevelILInstruction(object): core.BNFreeInstructionText(tokens, count.value) return result + @property + def il_basic_block(self): + """IL basic block object containing this expression (read-only) (only available on finalized functions)""" + return MediumLevelILBasicBlock(self.function.source_function.view, core.BNGetMediumLevelILBasicBlockForInstruction(self.function.handle, self.instr_index), self.function) + @property def ssa_form(self): """SSA form of expression (read-only)""" -- cgit v1.3.1