summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorKyleMiles <krm504@nyu.edu>2024-05-07 12:16:13 -0400
committerKyleMiles <krm504@nyu.edu>2024-05-07 12:16:13 -0400
commit818dc318a974b5a5053720e55084b0671017b814 (patch)
tree9d37c6fb6824701ad7e7b5669422416c734eebba /python
parenta0c388f5a8beb0c0485deed3070d97b3a78f3990 (diff)
fix def_sites and use_sites 👀
Diffstat (limited to 'python')
-rw-r--r--python/mediumlevelil.py19
-rw-r--r--python/variable.py5
2 files changed, 18 insertions, 6 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py
index 6971e120..bd13afa2 100644
--- a/python/mediumlevelil.py
+++ b/python/mediumlevelil.py
@@ -80,25 +80,32 @@ class SSAVariable:
@property
def function(self) -> 'function.Function':
+ """returns the source Function object which this variable belongs to"""
return self.var.function
@property
+ def il_function(self) -> 'function.ILFunctionType':
+ """returns the il Function object which this variable belongs to"""
+ return self.var._il_function
+
+ @property
def dead_store_elimination(self) -> DeadStoreElimination:
+ """returns the dead store elimination setting for this variable (read-only)"""
return self.var.dead_store_elimination
@property
- def def_site(self) -> Optional['MediumLevelILInstruction']:
+ def def_site(self) -> Optional[Union['MediumLevelILInstruction', 'highlevelil.HighLevelILInstruction']]:
"""
- Gets the MediumLevelILInstruction where this SSAVariable is defined.
+ Gets the IL instructions where this SSAVariable is defined.
"""
- return self.function.mlil.get_ssa_var_definition(self)
+ return self.il_function.get_ssa_var_definition(self)
@property
- def use_sites(self) -> List['MediumLevelILInstruction']:
+ def use_sites(self) -> List[Union['MediumLevelILInstruction', 'highlevelil.HighLevelILInstruction']]:
"""
- Gets the list of MediumLevelILInstructions where this SSAVariable is used inside of this function.
+ Gets the list of IL instructions where this SSAVariable is used inside of this function.
"""
- return self.function.mlil.get_ssa_var_uses(self)
+ return self.il_function.get_ssa_var_uses(self)
class MediumLevelILLabel:
diff --git a/python/variable.py b/python/variable.py
index 75e95712..3ca4bb1c 100644
--- a/python/variable.py
+++ b/python/variable.py
@@ -886,6 +886,11 @@ class Variable(CoreVariable):
"""returns the source Function object which this variable belongs to"""
return self._function
+ @property
+ def il_function(self) -> 'function.ILFunctionType':
+ """returns the IL Function object which this variable belongs to"""
+ return self.var._il_function
+
def set_name_async(self, name: Optional[str]) -> None:
"""
``set_name_async`` provides a way to asynchronously set the name of a variable. This method should be used