From 66fe34a49322d0a63d8f6efe00ca20d9a2c4ce05 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Wed, 4 Oct 2023 13:42:46 -0400 Subject: Add SSAVariable.def_site and SSAVariable.use_sites --- python/mediumlevelil.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'python') diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index c1c4d231..1ae61d38 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -85,6 +85,20 @@ class SSAVariable: def dead_store_elimination(self) -> DeadStoreElimination: return self.var.dead_store_elimination + @property + def def_site(self) -> Optional['MediumLevelILInstruction']: + """ + Gets the MediumLevelILInstruction where this SSAVariable is defined. + """ + return self.var.function.get_ssa_var_definition(self) + + @property + def use_sites(self) -> List['MediumLevelILInstruction']: + """ + Gets the list of MediumLevelILInstructions where this SSAVariable is used inside of this function. + """ + return self.var.function.get_ssa_var_uses(self) + class MediumLevelILLabel: def __init__(self, handle: Optional[core.BNMediumLevelILLabel] = None): -- cgit v1.3.1