Gets the instruction that contains the given SSA variable's definition. Since SSA variables can only be defined once, this will return the single instruction where that occurs. For SSA variable version 0s, which don't have definitions, this will return None instead.
(self, ssa_var: Union['mediumlevelil.SSAVariable', HighLevelILVarSsa])
| 2758 | return core.BNGetHighLevelILNonSSAInstructionIndex(self.handle, instr) |
| 2759 | |
| 2760 | def get_ssa_var_definition(self, ssa_var: Union['mediumlevelil.SSAVariable', HighLevelILVarSsa]) -> Optional[HighLevelILInstruction]: |
| 2761 | """ |
| 2762 | Gets the instruction that contains the given SSA variable's definition. |
| 2763 | |
| 2764 | Since SSA variables can only be defined once, this will return the single instruction where that occurs. |
| 2765 | For SSA variable version 0s, which don't have definitions, this will return None instead. |
| 2766 | """ |
| 2767 | if isinstance(ssa_var, HighLevelILVarSsa): |
| 2768 | ssa_var = ssa_var.var |
| 2769 | if not isinstance(ssa_var, mediumlevelil.SSAVariable): |
| 2770 | raise ValueError("Expected SSAVariable") |
| 2771 | var_data = ssa_var.var.to_BNVariable() |
| 2772 | result = core.BNGetHighLevelILSSAVarDefinition(self.handle, var_data, ssa_var.version) |
| 2773 | if result >= core.BNGetHighLevelILExprCount(self.handle): |
| 2774 | return None |
| 2775 | return HighLevelILInstruction.create(self, ExpressionIndex(result)) |
| 2776 | |
| 2777 | def get_ssa_memory_definition(self, version: int) -> Optional[HighLevelILInstruction]: |
| 2778 | result = core.BNGetHighLevelILSSAMemoryDefinition(self.handle, version) |
no test coverage detected