summaryrefslogtreecommitdiff
path: root/python/mediumlevelil.py
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2017-07-14 01:05:18 -0400
committerRusty Wagner <rusty@vector35.com>2017-07-14 01:05:18 -0400
commit35c65d909d1ec36a4a1bad7404c9f986e259f662 (patch)
tree213cc0371f20f8d9189387d28694d04d7153370a /python/mediumlevelil.py
parent3d403cfae9d5a366f112c8a5936a371a01cfd230 (diff)
Adding API to get type of MLIL expression
Diffstat (limited to 'python/mediumlevelil.py')
-rw-r--r--python/mediumlevelil.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 275746cc..76a85a86 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -26,6 +26,7 @@ from .enums import MediumLevelILOperation, InstructionTextTokenType, ILBranchDep
import function
import basicblock
import lowlevelil
+import types
class SSAVariable(object):
@@ -397,6 +398,14 @@ class MediumLevelILInstruction(object):
result += operand.vars_read
return result
+ @property
+ def expr_type(self):
+ """Type of expression"""
+ result = core.BNGetMediumLevelILExprType(self.function.handle, self.expr_index)
+ if result.type:
+ return types.Type(result.type, confidence = result.confidence)
+ return None
+
def get_ssa_var_possible_values(self, ssa_var):
var_data = core.BNVariable()
var_data.type = ssa_var.var.source_type