From 7331610128610368846206388081524749722648 Mon Sep 17 00:00:00 2001 From: Glenn Smith Date: Tue, 1 Jul 2025 18:01:05 -0400 Subject: Python: get_instruction_index_for_expr for all ILs --- python/highlevelil.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'python/highlevelil.py') diff --git a/python/highlevelil.py b/python/highlevelil.py index 6398bc26..8869fedd 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -4713,6 +4713,16 @@ class HighLevelILFunction: return [] + def get_instruction_index_for_expr(self, expr: ExpressionIndex) -> Optional[InstructionIndex]: + result = core.BNGetHighLevelILInstructionForExpr(self.handle, expr) + if result >= core.BNGetHighLevelILInstructionCount(self.handle): + return None + return InstructionIndex(result) + + def get_expr_index_for_instruction(self, instr: InstructionIndex) -> ExpressionIndex: + result = core.BNGetHighLevelILIndexForInstruction(self.handle, instr) + return ExpressionIndex(result) + def get_medium_level_il_expr_index(self, expr: ExpressionIndex) -> Optional['mediumlevelil.ExpressionIndex']: medium_il = self.medium_level_il if medium_il is None: -- cgit v1.3.1