From 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 27 Jan 2022 22:43:28 -0500 Subject: Format All Files --- mediumlevelilinstruction.h | 1042 ++++++++++++++++++++++++++++++++------------ 1 file changed, 763 insertions(+), 279 deletions(-) (limited to 'mediumlevelilinstruction.h') diff --git a/mediumlevelilinstruction.h b/mediumlevelilinstruction.h index 1d3d2689..7e6194a7 100644 --- a/mediumlevelilinstruction.h +++ b/mediumlevelilinstruction.h @@ -24,9 +24,9 @@ #include #include #ifdef BINARYNINJACORE_LIBRARY -#include "variable.h" + #include "variable.h" #else -#include "binaryninjaapi.h" + #include "binaryninjaapi.h" #endif #ifdef BINARYNINJACORE_LIBRARY @@ -38,7 +38,8 @@ namespace BinaryNinja class MediumLevelILFunction; template - struct MediumLevelILInstructionAccessor {}; + struct MediumLevelILInstructionAccessor + {}; struct MediumLevelILInstruction; struct MediumLevelILConstantInstruction; @@ -122,14 +123,15 @@ namespace BinaryNinja ParameterSSAMemoryVersionMediumLevelOperandUsage, SourceSSAVariablesMediumLevelOperandUsages }; -} +} // namespace BinaryNinjaCore -namespace std -{ +namespace std { #ifdef BINARYNINJACORE_LIBRARY - template<> struct hash + template <> + struct hash #else - template<> struct hash + template <> + struct hash #endif { #ifdef BINARYNINJACORE_LIBRARY @@ -143,20 +145,20 @@ namespace std } }; - template<> struct hash + template <> + struct hash { typedef BNMediumLevelILOperation argument_type; typedef int result_type; - result_type operator()(argument_type const& value) const - { - return (result_type)value; - } + result_type operator()(argument_type const& value) const { return (result_type)value; } }; #ifdef BINARYNINJACORE_LIBRARY - template<> struct hash + template <> + struct hash #else - template<> struct hash + template <> + struct hash #endif { #ifdef BINARYNINJACORE_LIBRARY @@ -165,12 +167,9 @@ namespace std typedef BinaryNinja::MediumLevelILOperandUsage argument_type; #endif typedef int result_type; - result_type operator()(argument_type const& value) const - { - return (result_type)value; - } + result_type operator()(argument_type const& value) const { return (result_type)value; } }; -} +} // namespace std #ifdef BINARYNINJACORE_LIBRARY namespace BinaryNinjaCore @@ -179,21 +178,21 @@ namespace BinaryNinja #endif { #ifdef BINARYNINJACORE_LIBRARY -#define _STD_VECTOR vector -#define _STD_SET set -#define _STD_UNORDERED_MAP unordered_map -#define _STD_MAP map + #define _STD_VECTOR vector + #define _STD_SET set + #define _STD_UNORDERED_MAP unordered_map + #define _STD_MAP map #else -#define _STD_VECTOR std::vector -#define _STD_SET std::set -#define _STD_UNORDERED_MAP std::unordered_map -#define _STD_MAP std::map + #define _STD_VECTOR std::vector + #define _STD_SET std::set + #define _STD_UNORDERED_MAP std::unordered_map + #define _STD_MAP std::map #endif - class MediumLevelILInstructionAccessException: public std::exception + class MediumLevelILInstructionAccessException : public std::exception { - public: - MediumLevelILInstructionAccessException(): std::exception() {} + public: + MediumLevelILInstructionAccessException() : std::exception() {} virtual const char* what() const NOEXCEPT { return "invalid access to MLIL instruction"; } }; @@ -219,7 +218,7 @@ namespace BinaryNinja ListIterator m_start; - public: + public: typedef ListIterator const_iterator; MediumLevelILIntegerList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); @@ -240,13 +239,17 @@ namespace BinaryNinja bool operator==(const ListIterator& a) const { return pos == a.pos; } bool operator!=(const ListIterator& a) const { return pos != a.pos; } bool operator<(const ListIterator& a) const { return pos < a.pos; } - ListIterator& operator++() { ++pos; return *this; } + ListIterator& operator++() + { + ++pos; + return *this; + } size_t operator*(); }; MediumLevelILIntegerList m_list; - public: + public: typedef ListIterator const_iterator; MediumLevelILIndexList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); @@ -267,13 +270,18 @@ namespace BinaryNinja bool operator==(const ListIterator& a) const { return pos == a.pos; } bool operator!=(const ListIterator& a) const { return pos != a.pos; } bool operator<(const ListIterator& a) const { return pos < a.pos; } - ListIterator& operator++() { ++pos; ++pos; return *this; } + ListIterator& operator++() + { + ++pos; + ++pos; + return *this; + } const std::pair operator*(); }; MediumLevelILIntegerList m_list; - public: + public: typedef ListIterator const_iterator; MediumLevelILIndexMap(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); @@ -294,13 +302,17 @@ namespace BinaryNinja bool operator==(const ListIterator& a) const { return pos == a.pos; } bool operator!=(const ListIterator& a) const { return pos != a.pos; } bool operator<(const ListIterator& a) const { return pos < a.pos; } - ListIterator& operator++() { ++pos; return *this; } + ListIterator& operator++() + { + ++pos; + return *this; + } const Variable operator*(); }; MediumLevelILIntegerList m_list; - public: + public: typedef ListIterator const_iterator; MediumLevelILVariableList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); @@ -321,16 +333,22 @@ namespace BinaryNinja bool operator==(const ListIterator& a) const { return pos == a.pos; } bool operator!=(const ListIterator& a) const { return pos != a.pos; } bool operator<(const ListIterator& a) const { return pos < a.pos; } - ListIterator& operator++() { ++pos; ++pos; return *this; } + ListIterator& operator++() + { + ++pos; + ++pos; + return *this; + } const SSAVariable operator*(); }; MediumLevelILIntegerList m_list; - public: + public: typedef ListIterator const_iterator; - MediumLevelILSSAVariableList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); + MediumLevelILSSAVariableList( + MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count); const_iterator begin() const; const_iterator end() const; @@ -349,18 +367,22 @@ namespace BinaryNinja bool operator==(const ListIterator& a) const { return pos == a.pos; } bool operator!=(const ListIterator& a) const { return pos != a.pos; } bool operator<(const ListIterator& a) const { return pos < a.pos; } - ListIterator& operator++() { ++pos; return *this; } + ListIterator& operator++() + { + ++pos; + return *this; + } const MediumLevelILInstruction operator*(); }; MediumLevelILIntegerList m_list; size_t m_instructionIndex; - public: + public: typedef ListIterator const_iterator; MediumLevelILInstructionList(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t count, - size_t instructionIndex); + size_t instructionIndex); const_iterator begin() const; const_iterator end() const; @@ -370,7 +392,7 @@ namespace BinaryNinja operator _STD_VECTOR() const; }; - struct MediumLevelILInstructionBase: public BNMediumLevelILInstruction + struct MediumLevelILInstructionBase : public BNMediumLevelILInstruction { #ifdef BINARYNINJACORE_LIBRARY MediumLevelILFunction* function; @@ -380,10 +402,10 @@ namespace BinaryNinja size_t exprIndex, instructionIndex; static _STD_UNORDERED_MAP operandTypeForUsage; - static _STD_UNORDERED_MAP> operationOperandUsage; - static _STD_UNORDERED_MAP> operationOperandIndex; + static _STD_UNORDERED_MAP> + operationOperandUsage; + static _STD_UNORDERED_MAP> + operationOperandIndex; MediumLevelILOperandList GetOperands() const; @@ -405,8 +427,8 @@ namespace BinaryNinja void UpdateRawOperandAsExprList(size_t operandIndex, const _STD_VECTOR& exprs); RegisterValue GetValue() const; - PossibleValueSet GetPossibleValues(const _STD_SET& options = - _STD_SET()) const; + PossibleValueSet GetPossibleValues( + const _STD_SET& options = _STD_SET()) const; Confidence> GetType() const; size_t GetSSAVarVersion(const Variable& var); @@ -459,14 +481,8 @@ namespace BinaryNinja throw MediumLevelILInstructionAccessException(); return *(MediumLevelILInstructionAccessor*)this; } - MediumLevelILOneOperandInstruction& AsOneOperand() - { - return *(MediumLevelILOneOperandInstruction*)this; - } - MediumLevelILTwoOperandInstruction& AsTwoOperand() - { - return *(MediumLevelILTwoOperandInstruction*)this; - } + MediumLevelILOneOperandInstruction& AsOneOperand() { return *(MediumLevelILOneOperandInstruction*)this; } + MediumLevelILTwoOperandInstruction& AsTwoOperand() { return *(MediumLevelILTwoOperandInstruction*)this; } MediumLevelILTwoOperandWithCarryInstruction& AsTwoOperandWithCarry() { return *(MediumLevelILTwoOperandWithCarryInstruction*)this; @@ -497,66 +513,246 @@ namespace BinaryNinja } }; - struct MediumLevelILInstruction: public MediumLevelILInstructionBase + struct MediumLevelILInstruction : public MediumLevelILInstructionBase { MediumLevelILInstruction(); - MediumLevelILInstruction(MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, - size_t expr, size_t instrIdx); + MediumLevelILInstruction( + MediumLevelILFunction* func, const BNMediumLevelILInstruction& instr, size_t expr, size_t instrIdx); MediumLevelILInstruction(const MediumLevelILInstructionBase& instr); void VisitExprs(const std::function& func) const; ExprId CopyTo(MediumLevelILFunction* dest) const; ExprId CopyTo(MediumLevelILFunction* dest, - const std::function& subExprHandler) const; + const std::function& subExprHandler) const; // Templated accessors for instruction operands, use these for efficient access to a known instruction - template MediumLevelILInstruction GetSourceExpr() const { return As().GetSourceExpr(); } - template Variable GetSourceVariable() const { return As().GetSourceVariable(); } - template SSAVariable GetSourceSSAVariable() const { return As().GetSourceSSAVariable(); } - template MediumLevelILInstruction GetDestExpr() const { return As().GetDestExpr(); } - template Variable GetDestVariable() const { return As().GetDestVariable(); } - template SSAVariable GetDestSSAVariable() const { return As().GetDestSSAVariable(); } - template MediumLevelILInstruction GetLeftExpr() const { return As().GetLeftExpr(); } - template MediumLevelILInstruction GetRightExpr() const { return As().GetRightExpr(); } - template MediumLevelILInstruction GetCarryExpr() const { return As().GetCarryExpr(); } - template MediumLevelILInstruction GetStackExpr() const { return As().GetStackExpr(); } - template MediumLevelILInstruction GetConditionExpr() const { return As().GetConditionExpr(); } - template Variable GetHighVariable() const { return As().GetHighVariable(); } - template Variable GetLowVariable() const { return As().GetLowVariable(); } - template SSAVariable GetHighSSAVariable() const { return As().GetHighSSAVariable(); } - template SSAVariable GetLowSSAVariable() const { return As().GetLowSSAVariable(); } - template uint64_t GetOffset() const { return As().GetOffset(); } - template int64_t GetConstant() const { return As().GetConstant(); } - template int64_t GetVector() const { return As().GetVector(); } - template uint32_t GetIntrinsic() const { return As().GetIntrinsic(); } - template size_t GetTarget() const { return As().GetTarget(); } - template size_t GetTrueTarget() const { return As().GetTrueTarget(); } - template size_t GetFalseTarget() const { return As().GetFalseTarget(); } - template size_t GetDestMemoryVersion() const { return As().GetDestMemoryVersion(); } - template size_t GetSourceMemoryVersion() const { return As().GetSourceMemoryVersion(); } - template MediumLevelILIndexMap GetTargets() const { return As().GetTargets(); } - template MediumLevelILIndexList GetSourceMemoryVersions() const { return As().GetSourceMemoryVersions(); } - template MediumLevelILVariableList GetOutputVariables() const { return As().GetOutputVariables(); } - template MediumLevelILSSAVariableList GetOutputSSAVariables() const { return As().GetOutputSSAVariables(); } - template MediumLevelILInstructionList GetParameterExprs() const { return As().GetParameterExprs(); } - template MediumLevelILInstructionList GetSourceExprs() const { return As().GetSourceExprs(); } - template MediumLevelILVariableList GetParameterVariables() const { return As().GetParameterVariables(); } - template MediumLevelILSSAVariableList GetParameterSSAVariables() const { return As().GetParameterSSAVariables(); } - template MediumLevelILSSAVariableList GetSourceSSAVariables() const { return As().GetSourceSSAVariables(); } - - template void SetDestSSAVersion(size_t version) { As().SetDestSSAVersion(version); } - template void SetSourceSSAVersion(size_t version) { As().SetSourceSSAVersion(version); } - template void SetHighSSAVersion(size_t version) { As().SetHighSSAVersion(version); } - template void SetLowSSAVersion(size_t version) { As().SetLowSSAVersion(version); } - template void SetDestMemoryVersion(size_t version) { As().SetDestMemoryVersion(version); } - template void SetSourceMemoryVersion(size_t version) { As().SetSourceMemoryVersion(version); } - template void SetOutputSSAVariables(const _STD_VECTOR& vars) { As().SetOutputSSAVariables(vars); } - template void SetParameterSSAVariables(const _STD_VECTOR& vars) { As().SetParameterSSAVariables(vars); } - template void SetParameterExprs(const _STD_VECTOR& params) { As().SetParameterExprs(params); } - template void SetParameterExprs(const _STD_VECTOR& params) { As().SetParameterExprs(params); } - template void SetSourceExprs(const _STD_VECTOR& params) { As().SetSourceExprs(params); } - template void SetSourceExprs(const _STD_VECTOR& params) { As().SetSourceExprs(params); } + template + MediumLevelILInstruction GetSourceExpr() const + { + return As().GetSourceExpr(); + } + template + Variable GetSourceVariable() const + { + return As().GetSourceVariable(); + } + template + SSAVariable GetSourceSSAVariable() const + { + return As().GetSourceSSAVariable(); + } + template + MediumLevelILInstruction GetDestExpr() const + { + return As().GetDestExpr(); + } + template + Variable GetDestVariable() const + { + return As().GetDestVariable(); + } + template + SSAVariable GetDestSSAVariable() const + { + return As().GetDestSSAVariable(); + } + template + MediumLevelILInstruction GetLeftExpr() const + { + return As().GetLeftExpr(); + } + template + MediumLevelILInstruction GetRightExpr() const + { + return As().GetRightExpr(); + } + template + MediumLevelILInstruction GetCarryExpr() const + { + return As().GetCarryExpr(); + } + template + MediumLevelILInstruction GetStackExpr() const + { + return As().GetStackExpr(); + } + template + MediumLevelILInstruction GetConditionExpr() const + { + return As().GetConditionExpr(); + } + template + Variable GetHighVariable() const + { + return As().GetHighVariable(); + } + template + Variable GetLowVariable() const + { + return As().GetLowVariable(); + } + template + SSAVariable GetHighSSAVariable() const + { + return As().GetHighSSAVariable(); + } + template + SSAVariable GetLowSSAVariable() const + { + return As().GetLowSSAVariable(); + } + template + uint64_t GetOffset() const + { + return As().GetOffset(); + } + template + int64_t GetConstant() const + { + return As().GetConstant(); + } + template + int64_t GetVector() const + { + return As().GetVector(); + } + template + uint32_t GetIntrinsic() const + { + return As().GetIntrinsic(); + } + template + size_t GetTarget() const + { + return As().GetTarget(); + } + template + size_t GetTrueTarget() const + { + return As().GetTrueTarget(); + } + template + size_t GetFalseTarget() const + { + return As().GetFalseTarget(); + } + template + size_t GetDestMemoryVersion() const + { + return As().GetDestMemoryVersion(); + } + template + size_t GetSourceMemoryVersion() const + { + return As().GetSourceMemoryVersion(); + } + template + MediumLevelILIndexMap GetTargets() const + { + return As().GetTargets(); + } + template + MediumLevelILIndexList GetSourceMemoryVersions() const + { + return As().GetSourceMemoryVersions(); + } + template + MediumLevelILVariableList GetOutputVariables() const + { + return As().GetOutputVariables(); + } + template + MediumLevelILSSAVariableList GetOutputSSAVariables() const + { + return As().GetOutputSSAVariables(); + } + template + MediumLevelILInstructionList GetParameterExprs() const + { + return As().GetParameterExprs(); + } + template + MediumLevelILInstructionList GetSourceExprs() const + { + return As().GetSourceExprs(); + } + template + MediumLevelILVariableList GetParameterVariables() const + { + return As().GetParameterVariables(); + } + template + MediumLevelILSSAVariableList GetParameterSSAVariables() const + { + return As().GetParameterSSAVariables(); + } + template + MediumLevelILSSAVariableList GetSourceSSAVariables() const + { + return As().GetSourceSSAVariables(); + } + + template + void SetDestSSAVersion(size_t version) + { + As().SetDestSSAVersion(version); + } + template + void SetSourceSSAVersion(size_t version) + { + As().SetSourceSSAVersion(version); + } + template + void SetHighSSAVersion(size_t version) + { + As().SetHighSSAVersion(version); + } + template + void SetLowSSAVersion(size_t version) + { + As().SetLowSSAVersion(version); + } + template + void SetDestMemoryVersion(size_t version) + { + As().SetDestMemoryVersion(version); + } + template + void SetSourceMemoryVersion(size_t version) + { + As().SetSourceMemoryVersion(version); + } + template + void SetOutputSSAVariables(const _STD_VECTOR& vars) + { + As().SetOutputSSAVariables(vars); + } + template + void SetParameterSSAVariables(const _STD_VECTOR& vars) + { + As().SetParameterSSAVariables(vars); + } + template + void SetParameterExprs(const _STD_VECTOR& params) + { + As().SetParameterExprs(params); + } + template + void SetParameterExprs(const _STD_VECTOR& params) + { + As().SetParameterExprs(params); + } + template + void SetSourceExprs(const _STD_VECTOR& params) + { + As().SetSourceExprs(params); + } + template + void SetSourceExprs(const _STD_VECTOR& params) + { + As().SetSourceExprs(params); + } bool GetOperandIndexForUsage(MediumLevelILOperandUsage usage, size_t& operandIndex) const; @@ -604,9 +800,9 @@ namespace BinaryNinja MediumLevelILOperandType m_type; size_t m_operandIndex; - public: - MediumLevelILOperand(const MediumLevelILInstruction& instr, MediumLevelILOperandUsage usage, - size_t operandIndex); + public: + MediumLevelILOperand( + const MediumLevelILInstruction& instr, MediumLevelILOperandUsage usage, size_t operandIndex); MediumLevelILOperandType GetType() const { return m_type; } MediumLevelILOperandUsage GetUsage() const { return m_usage; } @@ -633,7 +829,11 @@ namespace BinaryNinja bool operator==(const ListIterator& a) const { return pos == a.pos; } bool operator!=(const ListIterator& a) const { return pos != a.pos; } bool operator<(const ListIterator& a) const { return pos < a.pos; } - ListIterator& operator++() { ++pos; return *this; } + ListIterator& operator++() + { + ++pos; + return *this; + } const MediumLevelILOperand operator*(); }; @@ -641,12 +841,12 @@ namespace BinaryNinja const _STD_VECTOR& m_usageList; const _STD_UNORDERED_MAP& m_operandIndexMap; - public: + public: typedef ListIterator const_iterator; MediumLevelILOperandList(const MediumLevelILInstruction& instr, - const _STD_VECTOR& usageList, - const _STD_UNORDERED_MAP& operandIndexMap); + const _STD_VECTOR& usageList, + const _STD_UNORDERED_MAP& operandIndexMap); const_iterator begin() const; const_iterator end() const; @@ -656,23 +856,23 @@ namespace BinaryNinja operator _STD_VECTOR() const; }; - struct MediumLevelILConstantInstruction: public MediumLevelILInstructionBase + struct MediumLevelILConstantInstruction : public MediumLevelILInstructionBase { int64_t GetConstant() const { return GetRawOperandAsInteger(0); } }; - struct MediumLevelILOneOperandInstruction: public MediumLevelILInstructionBase + struct MediumLevelILOneOperandInstruction : public MediumLevelILInstructionBase { MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(0); } }; - struct MediumLevelILTwoOperandInstruction: public MediumLevelILInstructionBase + struct MediumLevelILTwoOperandInstruction : public MediumLevelILInstructionBase { MediumLevelILInstruction GetLeftExpr() const { return GetRawOperandAsExpr(0); } MediumLevelILInstruction GetRightExpr() const { return GetRawOperandAsExpr(1); } }; - struct MediumLevelILTwoOperandWithCarryInstruction: public MediumLevelILInstructionBase + struct MediumLevelILTwoOperandWithCarryInstruction : public MediumLevelILInstructionBase { MediumLevelILInstruction GetLeftExpr() const { return GetRawOperandAsExpr(0); } MediumLevelILInstruction GetRightExpr() const { return GetRawOperandAsExpr(1); } @@ -682,31 +882,36 @@ namespace BinaryNinja // Implementations of each instruction to fetch the correct operand value for the valid operands, these // are derived from MediumLevelILInstructionBase so that invalid operand accessor functions will generate // a compiler error. - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetDestVariable() const { return GetRawOperandAsVariable(0); } MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetDestVariable() const { return GetRawOperandAsVariable(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(1); } MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(2); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetHighVariable() const { return GetRawOperandAsVariable(0); } Variable GetLowVariable() const { return GetRawOperandAsVariable(1); } MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(2); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); } MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(2); } void SetDestSSAVersion(size_t version) { UpdateRawOperand(1, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); } SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsPartialSSAVariableSource(0); } @@ -715,7 +920,8 @@ namespace BinaryNinja void SetDestSSAVersion(size_t version) { UpdateRawOperand(1, version); } void SetSourceSSAVersion(size_t version) { UpdateRawOperand(2, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetHighSSAVariable() const { return GetRawOperandAsSSAVariable(0); } SSAVariable GetLowSSAVariable() const { return GetRawOperandAsSSAVariable(2); } @@ -723,7 +929,8 @@ namespace BinaryNinja void SetHighSSAVersion(size_t version) { UpdateRawOperand(1, version); } void SetLowSSAVersion(size_t version) { UpdateRawOperand(3, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); } SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsPartialSSAVariableSource(0); } @@ -731,7 +938,8 @@ namespace BinaryNinja void SetDestMemoryVersion(size_t version) { UpdateRawOperand(1, version); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(2, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); } SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsPartialSSAVariableSource(0); } @@ -741,19 +949,24 @@ namespace BinaryNinja void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(2, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(0); } size_t GetSourceMemoryVersion() const { return GetRawOperandAsIndex(1); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(1, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(1); } @@ -761,18 +974,21 @@ namespace BinaryNinja void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(2, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); } MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(1); } MediumLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(2); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); } size_t GetDestMemoryVersion() const { return GetRawOperandAsIndex(1); } @@ -781,7 +997,8 @@ namespace BinaryNinja void SetDestMemoryVersion(size_t version) { UpdateRawOperand(1, version); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(2, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(1); } @@ -792,44 +1009,52 @@ namespace BinaryNinja void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(3, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetSourceVariable() const { return GetRawOperandAsVariable(0); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetSourceVariable() const { return GetRawOperandAsVariable(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetHighVariable() const { return GetRawOperandAsVariable(0); } Variable GetLowVariable() const { return GetRawOperandAsVariable(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsSSAVariable(0); } void SetSourceSSAVersion(size_t version) { UpdateRawOperand(1, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsSSAVariable(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(2); } void SetSourceSSAVersion(size_t version) { UpdateRawOperand(1, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsSSAVariable(0); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(1, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsSSAVariable(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(2); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(1, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetHighSSAVariable() const { return GetRawOperandAsSSAVariable(0); } SSAVariable GetLowSSAVariable() const { return GetRawOperandAsSSAVariable(2); } @@ -837,169 +1062,272 @@ namespace BinaryNinja void SetLowSSAVersion(size_t version) { UpdateRawOperand(3, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetSourceVariable() const { return GetRawOperandAsVariable(0); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetSourceVariable() const { return GetRawOperandAsVariable(0); } uint64_t GetOffset() const { return GetRawOperandAsInteger(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); } MediumLevelILIndexMap GetTargets() const { return GetRawOperandAsIndexMap(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(0); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILVariableList GetOutputVariables() const { return GetRawOperandAsVariableList(0); } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(2); } MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(3); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { - MediumLevelILVariableList GetOutputVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsVariableList(0); } + MediumLevelILVariableList GetOutputVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsVariableList(0); + } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(1); } - MediumLevelILVariableList GetParameterVariables() const { return GetRawOperandAsExpr(2).GetRawOperandAsVariableList(0); } + MediumLevelILVariableList GetParameterVariables() const + { + return GetRawOperandAsExpr(2).GetRawOperandAsVariableList(0); + } MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(3); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILVariableList GetOutputVariables() const { return GetRawOperandAsVariableList(0); } MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(2); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { - MediumLevelILVariableList GetOutputVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsVariableList(0); } - MediumLevelILVariableList GetParameterVariables() const { return GetRawOperandAsExpr(1).GetRawOperandAsVariableList(0); } + MediumLevelILVariableList GetOutputVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsVariableList(0); + } + MediumLevelILVariableList GetParameterVariables() const + { + return GetRawOperandAsExpr(1).GetRawOperandAsVariableList(0); + } MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(2); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILVariableList GetOutputVariables() const { return GetRawOperandAsVariableList(0); } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(2); } MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(3); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { - MediumLevelILVariableList GetOutputVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsVariableList(0); } + MediumLevelILVariableList GetOutputVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsVariableList(0); + } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(1); } - MediumLevelILVariableList GetParameterVariables() const { return GetRawOperandAsExpr(2).GetRawOperandAsVariableList(0); } + MediumLevelILVariableList GetParameterVariables() const + { + return GetRawOperandAsExpr(2).GetRawOperandAsVariableList(0); + } MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(3); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetDestMemoryVersion() const { return GetRawOperandAsExpr(0).GetRawOperandAsIndex(0); } - MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetOutputSSAVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); + } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(1); } MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(2); } size_t GetSourceMemoryVersion() const { return GetRawOperandAsIndex(4); } void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(4, version); } - void SetOutputSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); } - void SetParameterExprs(const _STD_VECTOR& params) { UpdateRawOperandAsExprList(2, params); } + void SetOutputSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); + } + void SetParameterExprs(const _STD_VECTOR& params) + { + UpdateRawOperandAsExprList(2, params); + } void SetParameterExprs(const _STD_VECTOR& params) { UpdateRawOperandAsExprList(2, params); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetDestMemoryVersion() const { return GetRawOperandAsExpr(0).GetRawOperandAsIndex(0); } - MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetOutputSSAVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); + } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(1); } - MediumLevelILSSAVariableList GetParameterSSAVariables() const { return GetRawOperandAsExpr(2).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetParameterSSAVariables() const + { + return GetRawOperandAsExpr(2).GetRawOperandAsSSAVariableList(1); + } size_t GetSourceMemoryVersion() const { return GetRawOperandAsExpr(2).GetRawOperandAsIndex(0); } MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(3); } void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); } void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(0, version); } - void SetOutputSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); } - void SetParameterSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); } + void SetOutputSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); + } + void SetParameterSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); + } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetDestMemoryVersion() const { return GetRawOperandAsExpr(0).GetRawOperandAsIndex(0); } - MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetOutputSSAVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); + } MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(1); } size_t GetSourceMemoryVersion() const { return GetRawOperandAsIndex(3); } void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(3, version); } - void SetOutputSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); } - void SetParameterExprs(const _STD_VECTOR& params) { UpdateRawOperandAsExprList(1, params); } + void SetOutputSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); + } + void SetParameterExprs(const _STD_VECTOR& params) + { + UpdateRawOperandAsExprList(1, params); + } void SetParameterExprs(const _STD_VECTOR& params) { UpdateRawOperandAsExprList(1, params); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetDestMemoryVersion() const { return GetRawOperandAsExpr(0).GetRawOperandAsIndex(0); } - MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); } - MediumLevelILSSAVariableList GetParameterSSAVariables() const { return GetRawOperandAsExpr(1).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetOutputSSAVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); + } + MediumLevelILSSAVariableList GetParameterSSAVariables() const + { + return GetRawOperandAsExpr(1).GetRawOperandAsSSAVariableList(1); + } size_t GetSourceMemoryVersion() const { return GetRawOperandAsExpr(1).GetRawOperandAsIndex(0); } MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(2); } void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); } void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(1).UpdateRawOperand(0, version); } - void SetOutputSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); } - void SetParameterSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(1).UpdateRawOperandAsSSAVariableList(1, vars); } + void SetOutputSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); + } + void SetParameterSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(1).UpdateRawOperandAsSSAVariableList(1, vars); + } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetDestMemoryVersion() const { return GetRawOperandAsExpr(0).GetRawOperandAsIndex(0); } - MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetOutputSSAVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); + } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(1); } MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(2); } size_t GetSourceMemoryVersion() const { return GetRawOperandAsIndex(4); } void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); } void SetSourceMemoryVersion(size_t version) { UpdateRawOperand(4, version); } - void SetOutputSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); } - void SetParameterExprs(const _STD_VECTOR& params) { UpdateRawOperandAsExprList(2, params); } + void SetOutputSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); + } + void SetParameterExprs(const _STD_VECTOR& params) + { + UpdateRawOperandAsExprList(2, params); + } void SetParameterExprs(const _STD_VECTOR& params) { UpdateRawOperandAsExprList(2, params); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetDestMemoryVersion() const { return GetRawOperandAsExpr(0).GetRawOperandAsIndex(0); } - MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetOutputSSAVariables() const + { + return GetRawOperandAsExpr(0).GetRawOperandAsSSAVariableList(1); + } MediumLevelILInstruction GetDestExpr() const { return GetRawOperandAsExpr(1); } - MediumLevelILSSAVariableList GetParameterSSAVariables() const { return GetRawOperandAsExpr(2).GetRawOperandAsSSAVariableList(1); } + MediumLevelILSSAVariableList GetParameterSSAVariables() const + { + return GetRawOperandAsExpr(2).GetRawOperandAsSSAVariableList(1); + } size_t GetSourceMemoryVersion() const { return GetRawOperandAsExpr(2).GetRawOperandAsIndex(0); } MediumLevelILInstruction GetStackExpr() const { return GetRawOperandAsExpr(3); } void SetDestMemoryVersion(size_t version) { GetRawOperandAsExpr(0).UpdateRawOperand(0, version); } void SetSourceMemoryVersion(size_t version) { GetRawOperandAsExpr(2).UpdateRawOperand(0, version); } - void SetOutputSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); } - void SetParameterSSAVariables(const _STD_VECTOR& vars) { GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); } + void SetOutputSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(0).UpdateRawOperandAsSSAVariableList(1, vars); + } + void SetParameterSSAVariables(const _STD_VECTOR& vars) + { + GetRawOperandAsExpr(2).UpdateRawOperandAsSSAVariableList(1, vars); + } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstructionList GetSourceExprs() const { return GetRawOperandAsExprList(0); } void SetSourceExprs(const _STD_VECTOR& exprs) { UpdateRawOperandAsExprList(0, exprs); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILInstruction GetConditionExpr() const { return GetRawOperandAsExpr(0); } size_t GetTrueTarget() const { return GetRawOperandAsIndex(1); } size_t GetFalseTarget() const { return GetRawOperandAsIndex(2); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetTarget() const { return GetRawOperandAsIndex(0); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILVariableList GetOutputVariables() const { return GetRawOperandAsVariableList(0); } uint32_t GetIntrinsic() const { return (uint32_t)GetRawOperandAsInteger(2); } MediumLevelILInstructionList GetParameterExprs() const { return GetRawOperandAsExprList(3); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { MediumLevelILSSAVariableList GetOutputSSAVariables() const { return GetRawOperandAsSSAVariableList(0); } uint32_t GetIntrinsic() const { return (uint32_t)GetRawOperandAsInteger(2); } @@ -1007,11 +1335,13 @@ namespace BinaryNinja void SetOutputSSAVariables(const _STD_VECTOR& vars) { UpdateRawOperandAsSSAVariableList(0, vars); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { Variable GetDestVariable() const { return GetRawOperandAsVariable(0); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); } SSAVariable GetSourceSSAVariable() const { return GetRawOperandAsPartialSSAVariableSource(0); } @@ -1019,110 +1349,264 @@ namespace BinaryNinja void SetSourceSSAVersion(size_t version) { UpdateRawOperand(2, version); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { int64_t GetVector() const { return GetRawOperandAsInteger(0); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { SSAVariable GetDestSSAVariable() const { return GetRawOperandAsSSAVariable(0); } MediumLevelILSSAVariableList GetSourceSSAVariables() const { return GetRawOperandAsSSAVariableList(2); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase { size_t GetDestMemoryVersion() const { return GetRawOperandAsIndex(0); } MediumLevelILIndexList GetSourceMemoryVersions() const { return GetRawOperandAsIndexList(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILConstantInstruction + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILConstantInstruction { int64_t GetConstant() const { return GetRawOperandAsInteger(0); } int64_t GetOffset() const { return GetRawOperandAsInteger(1); } }; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILInstructionBase {}; - - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILConstantInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILConstantInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILConstantInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILConstantInstruction {}; - - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandInstruction {}; - - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandWithCarryInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandWithCarryInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandWithCarryInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILTwoOperandWithCarryInstruction {}; - - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; - template <> struct MediumLevelILInstructionAccessor: public MediumLevelILOneOperandInstruction {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILInstructionBase + {}; + + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILConstantInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILConstantInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILConstantInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILConstantInstruction + {}; + + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandInstruction + {}; + + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandWithCarryInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandWithCarryInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandWithCarryInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILTwoOperandWithCarryInstruction + {}; + + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; + template <> + struct MediumLevelILInstructionAccessor : public MediumLevelILOneOperandInstruction + {}; #undef _STD_VECTOR #undef _STD_SET #undef _STD_UNORDERED_MAP #undef _STD_MAP -} +} // namespace BinaryNinjaCore -- cgit v1.3.1