From 0e8987bb46b8aa33c5898d5effed25f1124e03dd Mon Sep 17 00:00:00 2001 From: Rusty Wagner Date: Fri, 3 Jan 2020 21:51:50 -0500 Subject: Add types to HLIL expressions --- python/highlevelil.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'python/highlevelil.py') diff --git a/python/highlevelil.py b/python/highlevelil.py index feac146b..a4140f85 100644 --- a/python/highlevelil.py +++ b/python/highlevelil.py @@ -29,6 +29,7 @@ from binaryninja import function from binaryninja import lowlevelil from binaryninja import mediumlevelil from binaryninja import basicblock +from binaryninja import types # 2-3 compatibility from binaryninja import range @@ -467,10 +468,13 @@ class HighLevelILInstruction(object): @property def expr_type(self): """Type of expression""" - mlil = self.mlil - if mlil is None: - return None - return mlil.expr_type + result = core.BNGetHighLevelILExprType(self._function.handle, self._expr_index) + if result.type: + platform = None + if self._function.source_function: + platform = self._function.source_function.platform + return types.Type(result.type, platform = platform, confidence = result.confidence) + return None def get_possible_values(self, options = []): mlil = self.mlil -- cgit v1.3.1