summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorRusty Wagner <rusty@vector35.com>2018-04-05 17:34:55 -0400
committerRusty Wagner <rusty@vector35.com>2018-04-05 17:37:58 -0400
commitb15ea74b0b5e0afab9c935894eb39610408b6678 (patch)
treec5a2ade13917be17f31f121ea746350f759295a6 /python
parentfa716fe2da53a4f136380b1f60197bd197b2793a (diff)
Add SSA variable liveness API for MLIL
Diffstat (limited to 'python')
-rw-r--r--python/mediumlevelil.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index caf19e8e..d87b5bf7 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -851,6 +851,20 @@ class MediumLevelILFunction(object):
core.BNFreeILInstructionList(instrs)
return result
+ def is_ssa_var_live(self, ssa_var):
+ """
+ ``is_ssa_var_live`` determines if ``ssa_var`` is live at any point in the function
+
+ :param SSAVariable ssa_var: the SSA variable to query
+ :return: whether the variable is live at any point in the function
+ :rtype: bool
+ """
+ var_data = core.BNVariable()
+ var_data.type = ssa_var.var.source_type
+ var_data.index = ssa_var.var.index
+ var_data.storage = ssa_var.var.storage
+ return core.BNIsMediumLevelILSSAVarLive(self.handle, var_data, ssa_var.version)
+
def get_var_definitions(self, var):
count = ctypes.c_ulonglong()
var_data = core.BNVariable()