From bcdc0d9b89605936a1cb6cf3ffaaece60d3c5777 Mon Sep 17 00:00:00 2001 From: Ryan Snyder Date: Fri, 24 Jan 2025 17:57:26 -0500 Subject: uidf refactor --- highlevelilinstruction.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'highlevelilinstruction.h') diff --git a/highlevelilinstruction.h b/highlevelilinstruction.h index f962226e..056cd211 100644 --- a/highlevelilinstruction.h +++ b/highlevelilinstruction.h @@ -349,6 +349,7 @@ namespace BinaryNinja HighLevelILInstructionList GetRawOperandAsExprList(size_t operand) const; HighLevelILSSAVariableList GetRawOperandAsSSAVariableList(size_t operand) const; HighLevelILIndexList GetRawOperandAsIndexList(size_t operand) const; + PossibleValueSet GetRawOperandAsPossibleValueSet(size_t operand) const; void UpdateRawOperand(size_t operandIndex, ExprId value); void UpdateRawOperandAsInteger(size_t operandIndex, uint64_t value); @@ -652,6 +653,11 @@ namespace BinaryNinja { return As().GetDestMemoryVersion(); } + template + PossibleValueSet GetConstraint() const + { + return As().GetConstraint(); + } template void SetSSAVersion(size_t version) @@ -1030,6 +1036,34 @@ namespace BinaryNinja void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(4, version); } }; + template <> + struct HighLevelILInstructionAccessor : public HighLevelILInstructionBase + { + Variable GetDestVariable() const { return GetRawOperandAsVariable(0); } + Variable GetVariable() const { return GetRawOperandAsVariable(1); } + }; + template <> + struct HighLevelILInstructionAccessor : public HighLevelILInstructionBase + { + SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); } + void SetDestSSAVersion(size_t version) { UpdateRawOperand(1, version); } + SSAVariable GetSSAVariable() const { return GetRawOperandAsSSAVariable(2); } + void SetSSAVersion(size_t version) { UpdateRawOperand(3, version); } + }; + template <> + struct HighLevelILInstructionAccessor : public HighLevelILInstructionBase + { + Variable GetVariable() const { return GetRawOperandAsVariable(0); } + PossibleValueSet GetConstraint() const { return GetRawOperandAsPossibleValueSet(1); } + }; + template <> + struct HighLevelILInstructionAccessor : public HighLevelILInstructionBase + { + SSAVariable GetSSAVariable() const { return GetRawOperandAsSSAVariable(0); } + void SetSSAVersion(size_t version) { UpdateRawOperand(1, version); } + PossibleValueSet GetConstraint() const { return GetRawOperandAsPossibleValueSet(2); } + }; + template <> struct HighLevelILInstructionAccessor : public HighLevelILInstructionBase { -- cgit v1.3.1