diff options
| author | Brian Potchik <brian@vector35.com> | 2020-11-21 17:55:26 -0500 |
|---|---|---|
| committer | Brian Potchik <brian@vector35.com> | 2020-11-21 17:55:26 -0500 |
| commit | df48a9ee65c4fa3b60f3bfebb36aa03d8dd40f2d (patch) | |
| tree | c4b5686db405729323bc06659bcc74135673fe9a /python/lowlevelil.py | |
| parent | 20b03bd36ec247b8c28dc1643f57b21ec94c8294 (diff) | |
Add improved instruction mapping APIs.
Diffstat (limited to 'python/lowlevelil.py')
| -rw-r--r-- | python/lowlevelil.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/python/lowlevelil.py b/python/lowlevelil.py index 870b787a..5f09d06c 100644 --- a/python/lowlevelil.py +++ b/python/lowlevelil.py @@ -1016,6 +1016,14 @@ class LowLevelILInstruction(object): return self.medium_level_il @property + def mlils(self): + exprs = self.function.get_medium_level_il_expr_indexes(self.expr_index) + result = [] + for expr in exprs: + result.append(binaryninja.mediumlevelil.MediumLevelILInstruction(self._function.medium_level_il, expr)) + return result + + @property def mapped_medium_level_il(self): """Gets the mapped medium level IL expression corresponding to this expression""" expr = self._function.get_mapped_medium_level_il_expr_index(self.expr_index) @@ -2994,6 +3002,15 @@ class LowLevelILFunction(object): return None return result + def get_medium_level_il_expr_indexes(self, expr): + count = ctypes.c_ulonglong() + exprs = core.BNGetMediumLevelILExprIndexes(self.handle, expr, count) + result = [] + for i in range(0, count.value): + result.append(exprs[i]) + core.BNFreeILInstructionList(exprs) + return result + def get_mapped_medium_level_il_instruction_index(self, instr): med_il = self.mapped_medium_level_il if med_il is None: |
