diff options
| author | Rusty Wagner <rusty.wagner@gmail.com> | 2022-08-16 20:49:02 -0400 |
|---|---|---|
| committer | Rusty Wagner <rusty.wagner@gmail.com> | 2022-09-01 23:13:43 -0400 |
| commit | 40bdfac7b71dd1cbe9223b82518053f80268e2a8 (patch) | |
| tree | e53fc5710bb6e6844c1f09e967b715db0aac4444 /python/mediumlevelil.py | |
| parent | 2f6ebaa0042f6a02b9fcbf49b742fc25887bfdb4 (diff) | |
Splitting of variables
Diffstat (limited to 'python/mediumlevelil.py')
| -rw-r--r-- | python/mediumlevelil.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/python/mediumlevelil.py b/python/mediumlevelil.py index 06298e6e..47e7e2e1 100644 --- a/python/mediumlevelil.py +++ b/python/mediumlevelil.py @@ -730,6 +730,22 @@ class MediumLevelILInstruction(BaseILInstruction): core.BNGetMediumLevelILBranchDependence(self.function.handle, self.instr_index, branch_instr) ) + def get_split_var_for_definition(self, var: variable.Variable) -> variable.Variable: + """ + Gets the unique variable for a definition instruction. This unique variable can be passed + to ``Function.split_var`` to split a variable at a definition. The given ``var`` is the + assigned variable to query. + + :param Variable var: variable to query + :rtype: Variable + """ + return variable.Variable( + self.function.source_function, var.source_type, + core.BNGetDefaultIndexForMediumLevelILVariableDefinition( + self.function.handle, var.to_BNVariable(), self.instr_index + ), var.storage + ) + @property def operation(self) -> MediumLevelILOperation: return self.instr.operation |
