diff options
| author | Rusty Wagner <rusty@vector35.com> | 2020-01-03 21:51:50 -0500 |
|---|---|---|
| committer | Rusty Wagner <rusty@vector35.com> | 2020-04-17 14:20:38 -0400 |
| commit | 0e8987bb46b8aa33c5898d5effed25f1124e03dd (patch) | |
| tree | 87943b69c39f4377eedf07c2fa9b9ec1ab018f9d /python/highlevelil.py | |
| parent | 620dd96217a49803fe04c6bc286291ddd857dcba (diff) | |
Add types to HLIL expressions
Diffstat (limited to 'python/highlevelil.py')
| -rw-r--r-- | python/highlevelil.py | 12 |
1 files changed, 8 insertions, 4 deletions
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 |
