summaryrefslogtreecommitdiff
path: root/mediumlevelilinstruction.h
diff options
context:
space:
mode:
authorRyan Snyder <ryan@vector35.com>2025-01-24 17:57:26 -0500
committerRyan Snyder <ryan@vector35.com>2025-02-14 15:58:56 -0500
commitbcdc0d9b89605936a1cb6cf3ffaaece60d3c5777 (patch)
tree7286bd0963a49d9b90ddccf3a4b70b71c08e6ce5 /mediumlevelilinstruction.h
parent071811547bded7cf570125a03bb12d0b7c56a5ac (diff)
uidf refactor
Diffstat (limited to 'mediumlevelilinstruction.h')
-rw-r--r--mediumlevelilinstruction.h41
1 files changed, 39 insertions, 2 deletions
diff --git a/mediumlevelilinstruction.h b/mediumlevelilinstruction.h
index 018f9ffc..589f7c8b 100644
--- a/mediumlevelilinstruction.h
+++ b/mediumlevelilinstruction.h
@@ -88,7 +88,8 @@ namespace BinaryNinja
IndexMapMediumLevelOperand,
VariableListMediumLevelOperand,
SSAVariableListMediumLevelOperand,
- ExprListMediumLevelOperand
+ ExprListMediumLevelOperand,
+ ConstraintMediumLevelOperand
};
/*!
@@ -134,7 +135,8 @@ namespace BinaryNinja
UntypedParameterExprsMediumLevelOperandUsage,
UntypedParameterSSAExprsMediumLevelOperandUsage,
ParameterSSAMemoryVersionMediumLevelOperandUsage,
- SourceSSAVariablesMediumLevelOperandUsages
+ SourceSSAVariablesMediumLevelOperandUsages,
+ ConstraintMediumLevelOperandUsage
};
} // namespace BinaryNinjaCore
@@ -457,6 +459,7 @@ namespace BinaryNinja
MediumLevelILVariableList GetRawOperandAsVariableList(size_t operand) const;
MediumLevelILSSAVariableList GetRawOperandAsSSAVariableList(size_t operand) const;
MediumLevelILInstructionList GetRawOperandAsExprList(size_t operand) const;
+ PossibleValueSet GetRawOperandAsPossibleValueSet(size_t operand) const;
void UpdateRawOperand(size_t operandIndex, ExprId value);
void UpdateRawOperandAsSSAVariableList(size_t operandIndex, const _STD_VECTOR<SSAVariable>& vars);
@@ -737,6 +740,11 @@ namespace BinaryNinja
{
return As<N>().GetSourceSSAVariables();
}
+ template <BNMediumLevelILOperation N>
+ PossibleValueSet GetConstraint() const
+ {
+ return As<N>().GetConstraint();
+ }
template <BNMediumLevelILOperation N>
void SetDestSSAVersion(size_t version)
@@ -1016,6 +1024,35 @@ namespace BinaryNinja
};
template <>
+ struct MediumLevelILInstructionAccessor<MLIL_FORCE_VER> : public MediumLevelILInstructionBase
+ {
+ Variable GetDestVariable() const { return GetRawOperandAsVariable(0); }
+ Variable GetSourceVariable() const { return GetRawOperandAsVariable(1); }
+ };
+ template <>
+ struct MediumLevelILInstructionAccessor<MLIL_FORCE_VER_SSA> : public MediumLevelILInstructionBase
+ {
+ SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); }
+ void SetDestSSAVersion(size_t version) { UpdateRawOperand(1, version); }
+ SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsSSAVariable(2); }
+ void SetSourceSSAVersion(size_t version) { UpdateRawOperand(3, version); }
+ };
+ template <>
+ struct MediumLevelILInstructionAccessor<MLIL_ASSERT> : public MediumLevelILInstructionBase
+ {
+ Variable GetSourceVariable() const { return GetRawOperandAsVariable(0); }
+ PossibleValueSet GetConstraint() const { return GetRawOperandAsPossibleValueSet(1); }
+ };
+ template <>
+ struct MediumLevelILInstructionAccessor<MLIL_ASSERT_SSA> : public MediumLevelILInstructionBase
+ {
+ SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsSSAVariable(0); }
+ void SetSourceSSAVersion(size_t version) { UpdateRawOperand(1, version); }
+ PossibleValueSet GetConstraint() const { return GetRawOperandAsPossibleValueSet(2); }
+ };
+
+
+ template <>
struct MediumLevelILInstructionAccessor<MLIL_LOAD> : public MediumLevelILOneOperandInstruction
{};
template <>