From 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 27 Jan 2022 22:43:28 -0500 Subject: Format All Files --- highlevelilinstruction.cpp | 828 +++++++++++++++++++++------------------------ 1 file changed, 378 insertions(+), 450 deletions(-) (limited to 'highlevelilinstruction.cpp') diff --git a/highlevelilinstruction.cpp b/highlevelilinstruction.cpp index 2469f800..5f8777e1 100644 --- a/highlevelilinstruction.cpp +++ b/highlevelilinstruction.cpp @@ -19,15 +19,15 @@ // IN THE SOFTWARE. #ifdef BINARYNINJACORE_LIBRARY -#include "highlevelilfunction.h" -#include "highlevelilssafunction.h" -#include "mediumlevelilfunction.h" -#include "mediumlevelilssafunction.h" + #include "highlevelilfunction.h" + #include "highlevelilssafunction.h" + #include "mediumlevelilfunction.h" + #include "mediumlevelilssafunction.h" using namespace BinaryNinjaCore; #else -#include "binaryninjaapi.h" -#include "highlevelilinstruction.h" -#include "mediumlevelilinstruction.h" + #include "binaryninjaapi.h" + #include "highlevelilinstruction.h" + #include "mediumlevelilinstruction.h" using namespace BinaryNinja; #endif @@ -36,193 +36,155 @@ using namespace std; #endif -unordered_map - HighLevelILInstructionBase::operandTypeForUsage = { - {SourceExprHighLevelOperandUsage, ExprHighLevelOperand}, - {VariableHighLevelOperandUsage, VariableHighLevelOperand}, - {DestVariableHighLevelOperandUsage, VariableHighLevelOperand}, - {SSAVariableHighLevelOperandUsage, SSAVariableHighLevelOperand}, - {DestSSAVariableHighLevelOperandUsage, SSAVariableHighLevelOperand}, - {DestExprHighLevelOperandUsage, ExprHighLevelOperand}, - {LeftExprHighLevelOperandUsage, ExprHighLevelOperand}, - {RightExprHighLevelOperandUsage, ExprHighLevelOperand}, - {CarryExprHighLevelOperandUsage, ExprHighLevelOperand}, - {IndexExprHighLevelOperandUsage, ExprHighLevelOperand}, - {ConditionExprHighLevelOperandUsage, ExprHighLevelOperand}, - {ConditionPhiExprHighLevelOperandUsage, ExprHighLevelOperand}, - {TrueExprHighLevelOperandUsage, ExprHighLevelOperand}, - {FalseExprHighLevelOperandUsage, ExprHighLevelOperand}, - {LoopExprHighLevelOperandUsage, ExprHighLevelOperand}, - {InitExprHighLevelOperandUsage, ExprHighLevelOperand}, - {UpdateExprHighLevelOperandUsage, ExprHighLevelOperand}, - {DefaultExprHighLevelOperandUsage, ExprHighLevelOperand}, - {HighExprHighLevelOperandUsage, ExprHighLevelOperand}, - {LowExprHighLevelOperandUsage, ExprHighLevelOperand}, - {OffsetHighLevelOperandUsage, IntegerHighLevelOperand}, - {MemberIndexHighLevelOperandUsage, IndexHighLevelOperand}, - {ConstantHighLevelOperandUsage, IntegerHighLevelOperand}, - {VectorHighLevelOperandUsage, IntegerHighLevelOperand}, - {IntrinsicHighLevelOperandUsage, IntrinsicHighLevelOperand}, - {TargetHighLevelOperandUsage, IndexHighLevelOperand}, - {ParameterExprsHighLevelOperandUsage, ExprListHighLevelOperand}, - {SourceExprsHighLevelOperandUsage, ExprListHighLevelOperand}, - {DestExprsHighLevelOperandUsage, ExprListHighLevelOperand}, - {BlockExprsHighLevelOperandUsage, ExprListHighLevelOperand}, - {CasesHighLevelOperandUsage, ExprListHighLevelOperand}, - {ValueExprsHighLevelOperandUsage, ExprListHighLevelOperand}, - {SourceSSAVariablesHighLevelOperandUsage, SSAVariableListHighLevelOperand}, - {SourceMemoryVersionHighLevelOperandUsage, IndexHighLevelOperand}, - {SourceMemoryVersionsHighLevelOperandUsage, IndexListHighLevelOperand}, - {DestMemoryVersionHighLevelOperandUsage, IndexHighLevelOperand} - }; +unordered_map HighLevelILInstructionBase::operandTypeForUsage = { + {SourceExprHighLevelOperandUsage, ExprHighLevelOperand}, {VariableHighLevelOperandUsage, VariableHighLevelOperand}, + {DestVariableHighLevelOperandUsage, VariableHighLevelOperand}, + {SSAVariableHighLevelOperandUsage, SSAVariableHighLevelOperand}, + {DestSSAVariableHighLevelOperandUsage, SSAVariableHighLevelOperand}, + {DestExprHighLevelOperandUsage, ExprHighLevelOperand}, {LeftExprHighLevelOperandUsage, ExprHighLevelOperand}, + {RightExprHighLevelOperandUsage, ExprHighLevelOperand}, {CarryExprHighLevelOperandUsage, ExprHighLevelOperand}, + {IndexExprHighLevelOperandUsage, ExprHighLevelOperand}, {ConditionExprHighLevelOperandUsage, ExprHighLevelOperand}, + {ConditionPhiExprHighLevelOperandUsage, ExprHighLevelOperand}, + {TrueExprHighLevelOperandUsage, ExprHighLevelOperand}, {FalseExprHighLevelOperandUsage, ExprHighLevelOperand}, + {LoopExprHighLevelOperandUsage, ExprHighLevelOperand}, {InitExprHighLevelOperandUsage, ExprHighLevelOperand}, + {UpdateExprHighLevelOperandUsage, ExprHighLevelOperand}, {DefaultExprHighLevelOperandUsage, ExprHighLevelOperand}, + {HighExprHighLevelOperandUsage, ExprHighLevelOperand}, {LowExprHighLevelOperandUsage, ExprHighLevelOperand}, + {OffsetHighLevelOperandUsage, IntegerHighLevelOperand}, {MemberIndexHighLevelOperandUsage, IndexHighLevelOperand}, + {ConstantHighLevelOperandUsage, IntegerHighLevelOperand}, {VectorHighLevelOperandUsage, IntegerHighLevelOperand}, + {IntrinsicHighLevelOperandUsage, IntrinsicHighLevelOperand}, {TargetHighLevelOperandUsage, IndexHighLevelOperand}, + {ParameterExprsHighLevelOperandUsage, ExprListHighLevelOperand}, + {SourceExprsHighLevelOperandUsage, ExprListHighLevelOperand}, + {DestExprsHighLevelOperandUsage, ExprListHighLevelOperand}, + {BlockExprsHighLevelOperandUsage, ExprListHighLevelOperand}, {CasesHighLevelOperandUsage, ExprListHighLevelOperand}, + {ValueExprsHighLevelOperandUsage, ExprListHighLevelOperand}, + {SourceSSAVariablesHighLevelOperandUsage, SSAVariableListHighLevelOperand}, + {SourceMemoryVersionHighLevelOperandUsage, IndexHighLevelOperand}, + {SourceMemoryVersionsHighLevelOperandUsage, IndexListHighLevelOperand}, + {DestMemoryVersionHighLevelOperandUsage, IndexHighLevelOperand}}; unordered_map> - HighLevelILInstructionBase::operationOperandUsage = { - {HLIL_NOP, {}}, - {HLIL_BREAK, {}}, - {HLIL_CONTINUE, {}}, - {HLIL_NORET, {}}, - {HLIL_BP, {}}, - {HLIL_UNDEF, {}}, - {HLIL_UNIMPL, {}}, - {HLIL_BLOCK, {BlockExprsHighLevelOperandUsage}}, - {HLIL_IF, {ConditionExprHighLevelOperandUsage, TrueExprHighLevelOperandUsage, - FalseExprHighLevelOperandUsage}}, - {HLIL_WHILE, {ConditionExprHighLevelOperandUsage, LoopExprHighLevelOperandUsage}}, - {HLIL_WHILE_SSA, {ConditionPhiExprHighLevelOperandUsage, - ConditionExprHighLevelOperandUsage, LoopExprHighLevelOperandUsage}}, - {HLIL_DO_WHILE, {LoopExprHighLevelOperandUsage, ConditionExprHighLevelOperandUsage}}, - {HLIL_DO_WHILE_SSA, {LoopExprHighLevelOperandUsage, ConditionPhiExprHighLevelOperandUsage, - ConditionExprHighLevelOperandUsage}}, - {HLIL_FOR, {InitExprHighLevelOperandUsage, ConditionExprHighLevelOperandUsage, - UpdateExprHighLevelOperandUsage, LoopExprHighLevelOperandUsage}}, - {HLIL_FOR_SSA, {InitExprHighLevelOperandUsage, ConditionPhiExprHighLevelOperandUsage, - ConditionExprHighLevelOperandUsage, UpdateExprHighLevelOperandUsage, - LoopExprHighLevelOperandUsage}}, - {HLIL_SWITCH, {ConditionExprHighLevelOperandUsage, DefaultExprHighLevelOperandUsage, - CasesHighLevelOperandUsage}}, - {HLIL_CASE, {ValueExprsHighLevelOperandUsage, TrueExprHighLevelOperandUsage}}, - {HLIL_JUMP, {DestExprHighLevelOperandUsage}}, - {HLIL_RET, {SourceExprsHighLevelOperandUsage}}, - {HLIL_GOTO, {TargetHighLevelOperandUsage}}, - {HLIL_LABEL, {TargetHighLevelOperandUsage}}, - {HLIL_VAR_DECLARE, {VariableHighLevelOperandUsage}}, - {HLIL_VAR_INIT, {DestVariableHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, - {HLIL_VAR_INIT_SSA, {DestSSAVariableHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, - {HLIL_ASSIGN, {DestExprHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, - {HLIL_ASSIGN_UNPACK, {DestExprsHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, - {HLIL_ASSIGN_MEM_SSA, {DestExprHighLevelOperandUsage, DestMemoryVersionHighLevelOperandUsage, - SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, - {HLIL_ASSIGN_UNPACK, {DestExprsHighLevelOperandUsage, DestMemoryVersionHighLevelOperandUsage, - SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, - {HLIL_VAR, {VariableHighLevelOperandUsage}}, - {HLIL_VAR_SSA, {SSAVariableHighLevelOperandUsage}}, - {HLIL_VAR_PHI, {DestSSAVariableHighLevelOperandUsage, SourceSSAVariablesHighLevelOperandUsage}}, - {HLIL_MEM_PHI, {DestMemoryVersionHighLevelOperandUsage, SourceMemoryVersionsHighLevelOperandUsage}}, - {HLIL_STRUCT_FIELD, {SourceExprHighLevelOperandUsage, OffsetHighLevelOperandUsage, - MemberIndexHighLevelOperandUsage}}, - {HLIL_ARRAY_INDEX, {SourceExprHighLevelOperandUsage, IndexExprHighLevelOperandUsage}}, - {HLIL_ARRAY_INDEX_SSA, {SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage, - IndexExprHighLevelOperandUsage}}, - {HLIL_SPLIT, {HighExprHighLevelOperandUsage, LowExprHighLevelOperandUsage}}, - {HLIL_DEREF, {SourceExprHighLevelOperandUsage}}, - {HLIL_DEREF_FIELD, {SourceExprHighLevelOperandUsage, OffsetHighLevelOperandUsage, - MemberIndexHighLevelOperandUsage}}, - {HLIL_DEREF_SSA, {SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, - {HLIL_DEREF_FIELD_SSA, {SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage, - OffsetHighLevelOperandUsage, MemberIndexHighLevelOperandUsage}}, - {HLIL_ADDRESS_OF, {SourceExprHighLevelOperandUsage}}, - {HLIL_CALL, {DestExprHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage}}, - {HLIL_SYSCALL, {ParameterExprsHighLevelOperandUsage}}, - {HLIL_TAILCALL, {DestExprHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage}}, - {HLIL_INTRINSIC, {IntrinsicHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage}}, - {HLIL_CALL_SSA, {DestExprHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage, - DestMemoryVersionHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, - {HLIL_SYSCALL_SSA, {ParameterExprsHighLevelOperandUsage, DestMemoryVersionHighLevelOperandUsage, - SourceMemoryVersionHighLevelOperandUsage}}, - {HLIL_INTRINSIC_SSA, {IntrinsicHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage, - DestMemoryVersionHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, - {HLIL_TRAP, {VectorHighLevelOperandUsage}}, - {HLIL_CONST, {ConstantHighLevelOperandUsage}}, - {HLIL_CONST_PTR, {ConstantHighLevelOperandUsage}}, - {HLIL_EXTERN_PTR, {ConstantHighLevelOperandUsage, OffsetHighLevelOperandUsage}}, - {HLIL_FLOAT_CONST, {ConstantHighLevelOperandUsage}}, - {HLIL_IMPORT, {ConstantHighLevelOperandUsage}}, - {HLIL_ADD, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_SUB, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_AND, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_OR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_XOR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_LSL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_LSR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_ASR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_ROL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_ROR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_MUL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_MULU_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_MULS_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_DIVU, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_DIVS, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_MODU, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_MODS, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_E, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_NE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_SLT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_ULT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_SLE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_ULE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_SGE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_UGE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_SGT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_CMP_UGT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_TEST_BIT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_ADD_OVERFLOW, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_ADC, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, - CarryExprHighLevelOperandUsage}}, - {HLIL_SBB, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, - CarryExprHighLevelOperandUsage}}, - {HLIL_RLC, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, - CarryExprHighLevelOperandUsage}}, - {HLIL_RRC, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, - CarryExprHighLevelOperandUsage}}, - {HLIL_DIVU_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_DIVS_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_MODU_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_MODS_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_NEG, {SourceExprHighLevelOperandUsage}}, - {HLIL_NOT, {SourceExprHighLevelOperandUsage}}, - {HLIL_SX, {SourceExprHighLevelOperandUsage}}, - {HLIL_ZX, {SourceExprHighLevelOperandUsage}}, - {HLIL_LOW_PART, {SourceExprHighLevelOperandUsage}}, - {HLIL_BOOL_TO_INT, {SourceExprHighLevelOperandUsage}}, - {HLIL_UNIMPL_MEM, {SourceExprHighLevelOperandUsage}}, - {HLIL_FADD, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FSUB, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FMUL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FDIV, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FSQRT, {SourceExprHighLevelOperandUsage}}, - {HLIL_FNEG, {SourceExprHighLevelOperandUsage}}, - {HLIL_FABS, {SourceExprHighLevelOperandUsage}}, - {HLIL_FLOAT_TO_INT, {SourceExprHighLevelOperandUsage}}, - {HLIL_INT_TO_FLOAT, {SourceExprHighLevelOperandUsage}}, - {HLIL_FLOAT_CONV, {SourceExprHighLevelOperandUsage}}, - {HLIL_ROUND_TO_INT, {SourceExprHighLevelOperandUsage}}, - {HLIL_FLOOR, {SourceExprHighLevelOperandUsage}}, - {HLIL_CEIL, {SourceExprHighLevelOperandUsage}}, - {HLIL_FTRUNC, {SourceExprHighLevelOperandUsage}}, - {HLIL_FCMP_E, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FCMP_NE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FCMP_LT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FCMP_LE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FCMP_GE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FCMP_GT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FCMP_O, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, - {HLIL_FCMP_UO, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}} - }; - - -static unordered_map> GetOperandIndexForOperandUsages() + HighLevelILInstructionBase::operationOperandUsage = {{HLIL_NOP, {}}, {HLIL_BREAK, {}}, {HLIL_CONTINUE, {}}, + {HLIL_NORET, {}}, {HLIL_BP, {}}, {HLIL_UNDEF, {}}, {HLIL_UNIMPL, {}}, + {HLIL_BLOCK, {BlockExprsHighLevelOperandUsage}}, + {HLIL_IF, {ConditionExprHighLevelOperandUsage, TrueExprHighLevelOperandUsage, FalseExprHighLevelOperandUsage}}, + {HLIL_WHILE, {ConditionExprHighLevelOperandUsage, LoopExprHighLevelOperandUsage}}, + {HLIL_WHILE_SSA, + {ConditionPhiExprHighLevelOperandUsage, ConditionExprHighLevelOperandUsage, LoopExprHighLevelOperandUsage}}, + {HLIL_DO_WHILE, {LoopExprHighLevelOperandUsage, ConditionExprHighLevelOperandUsage}}, + {HLIL_DO_WHILE_SSA, + {LoopExprHighLevelOperandUsage, ConditionPhiExprHighLevelOperandUsage, ConditionExprHighLevelOperandUsage}}, + {HLIL_FOR, {InitExprHighLevelOperandUsage, ConditionExprHighLevelOperandUsage, UpdateExprHighLevelOperandUsage, + LoopExprHighLevelOperandUsage}}, + {HLIL_FOR_SSA, + {InitExprHighLevelOperandUsage, ConditionPhiExprHighLevelOperandUsage, ConditionExprHighLevelOperandUsage, + UpdateExprHighLevelOperandUsage, LoopExprHighLevelOperandUsage}}, + {HLIL_SWITCH, + {ConditionExprHighLevelOperandUsage, DefaultExprHighLevelOperandUsage, CasesHighLevelOperandUsage}}, + {HLIL_CASE, {ValueExprsHighLevelOperandUsage, TrueExprHighLevelOperandUsage}}, + {HLIL_JUMP, {DestExprHighLevelOperandUsage}}, {HLIL_RET, {SourceExprsHighLevelOperandUsage}}, + {HLIL_GOTO, {TargetHighLevelOperandUsage}}, {HLIL_LABEL, {TargetHighLevelOperandUsage}}, + {HLIL_VAR_DECLARE, {VariableHighLevelOperandUsage}}, + {HLIL_VAR_INIT, {DestVariableHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, + {HLIL_VAR_INIT_SSA, {DestSSAVariableHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, + {HLIL_ASSIGN, {DestExprHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, + {HLIL_ASSIGN_UNPACK, {DestExprsHighLevelOperandUsage, SourceExprHighLevelOperandUsage}}, + {HLIL_ASSIGN_MEM_SSA, {DestExprHighLevelOperandUsage, DestMemoryVersionHighLevelOperandUsage, + SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, + {HLIL_ASSIGN_UNPACK, {DestExprsHighLevelOperandUsage, DestMemoryVersionHighLevelOperandUsage, + SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, + {HLIL_VAR, {VariableHighLevelOperandUsage}}, {HLIL_VAR_SSA, {SSAVariableHighLevelOperandUsage}}, + {HLIL_VAR_PHI, {DestSSAVariableHighLevelOperandUsage, SourceSSAVariablesHighLevelOperandUsage}}, + {HLIL_MEM_PHI, {DestMemoryVersionHighLevelOperandUsage, SourceMemoryVersionsHighLevelOperandUsage}}, + {HLIL_STRUCT_FIELD, + {SourceExprHighLevelOperandUsage, OffsetHighLevelOperandUsage, MemberIndexHighLevelOperandUsage}}, + {HLIL_ARRAY_INDEX, {SourceExprHighLevelOperandUsage, IndexExprHighLevelOperandUsage}}, + {HLIL_ARRAY_INDEX_SSA, {SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage, + IndexExprHighLevelOperandUsage}}, + {HLIL_SPLIT, {HighExprHighLevelOperandUsage, LowExprHighLevelOperandUsage}}, + {HLIL_DEREF, {SourceExprHighLevelOperandUsage}}, + {HLIL_DEREF_FIELD, + {SourceExprHighLevelOperandUsage, OffsetHighLevelOperandUsage, MemberIndexHighLevelOperandUsage}}, + {HLIL_DEREF_SSA, {SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, + {HLIL_DEREF_FIELD_SSA, {SourceExprHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage, + OffsetHighLevelOperandUsage, MemberIndexHighLevelOperandUsage}}, + {HLIL_ADDRESS_OF, {SourceExprHighLevelOperandUsage}}, + {HLIL_CALL, {DestExprHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage}}, + {HLIL_SYSCALL, {ParameterExprsHighLevelOperandUsage}}, + {HLIL_TAILCALL, {DestExprHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage}}, + {HLIL_INTRINSIC, {IntrinsicHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage}}, + {HLIL_CALL_SSA, {DestExprHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage, + DestMemoryVersionHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, + {HLIL_SYSCALL_SSA, {ParameterExprsHighLevelOperandUsage, DestMemoryVersionHighLevelOperandUsage, + SourceMemoryVersionHighLevelOperandUsage}}, + {HLIL_INTRINSIC_SSA, {IntrinsicHighLevelOperandUsage, ParameterExprsHighLevelOperandUsage, + DestMemoryVersionHighLevelOperandUsage, SourceMemoryVersionHighLevelOperandUsage}}, + {HLIL_TRAP, {VectorHighLevelOperandUsage}}, {HLIL_CONST, {ConstantHighLevelOperandUsage}}, + {HLIL_CONST_PTR, {ConstantHighLevelOperandUsage}}, + {HLIL_EXTERN_PTR, {ConstantHighLevelOperandUsage, OffsetHighLevelOperandUsage}}, + {HLIL_FLOAT_CONST, {ConstantHighLevelOperandUsage}}, {HLIL_IMPORT, {ConstantHighLevelOperandUsage}}, + {HLIL_ADD, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_SUB, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_AND, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_OR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_XOR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_LSL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_LSR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_ASR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_ROL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_ROR, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_MUL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_MULU_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_MULS_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_DIVU, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_DIVS, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_MODU, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_MODS, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_E, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_NE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_SLT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_ULT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_SLE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_ULE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_SGE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_UGE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_SGT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_CMP_UGT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_TEST_BIT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_ADD_OVERFLOW, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_ADC, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, CarryExprHighLevelOperandUsage}}, + {HLIL_SBB, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, CarryExprHighLevelOperandUsage}}, + {HLIL_RLC, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, CarryExprHighLevelOperandUsage}}, + {HLIL_RRC, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage, CarryExprHighLevelOperandUsage}}, + {HLIL_DIVU_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_DIVS_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_MODU_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_MODS_DP, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_NEG, {SourceExprHighLevelOperandUsage}}, {HLIL_NOT, {SourceExprHighLevelOperandUsage}}, + {HLIL_SX, {SourceExprHighLevelOperandUsage}}, {HLIL_ZX, {SourceExprHighLevelOperandUsage}}, + {HLIL_LOW_PART, {SourceExprHighLevelOperandUsage}}, {HLIL_BOOL_TO_INT, {SourceExprHighLevelOperandUsage}}, + {HLIL_UNIMPL_MEM, {SourceExprHighLevelOperandUsage}}, + {HLIL_FADD, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FSUB, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FMUL, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FDIV, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FSQRT, {SourceExprHighLevelOperandUsage}}, {HLIL_FNEG, {SourceExprHighLevelOperandUsage}}, + {HLIL_FABS, {SourceExprHighLevelOperandUsage}}, {HLIL_FLOAT_TO_INT, {SourceExprHighLevelOperandUsage}}, + {HLIL_INT_TO_FLOAT, {SourceExprHighLevelOperandUsage}}, {HLIL_FLOAT_CONV, {SourceExprHighLevelOperandUsage}}, + {HLIL_ROUND_TO_INT, {SourceExprHighLevelOperandUsage}}, {HLIL_FLOOR, {SourceExprHighLevelOperandUsage}}, + {HLIL_CEIL, {SourceExprHighLevelOperandUsage}}, {HLIL_FTRUNC, {SourceExprHighLevelOperandUsage}}, + {HLIL_FCMP_E, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FCMP_NE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FCMP_LT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FCMP_LE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FCMP_GE, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FCMP_GT, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FCMP_O, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}, + {HLIL_FCMP_UO, {LeftExprHighLevelOperandUsage, RightExprHighLevelOperandUsage}}}; + + +static unordered_map> + GetOperandIndexForOperandUsages() { unordered_map> result; result.reserve(HighLevelILInstructionBase::operationOperandUsage.size()); @@ -254,7 +216,7 @@ static unordered_map> - HighLevelILInstructionBase::operationOperandIndex = GetOperandIndexForOperandUsages(); + HighLevelILInstructionBase::operationOperandIndex = GetOperandIndexForOperandUsages(); bool HighLevelILIntegerList::ListIterator::operator==(const ListIterator& a) const @@ -297,8 +259,8 @@ uint64_t HighLevelILIntegerList::ListIterator::operator*() } -HighLevelILIntegerList::HighLevelILIntegerList(HighLevelILFunction* func, - const BNHighLevelILInstruction& instr, size_t count) +HighLevelILIntegerList::HighLevelILIntegerList( + HighLevelILFunction* func, const BNHighLevelILInstruction& instr, size_t count) { m_start.function = func; m_start.instr = instr; @@ -355,10 +317,10 @@ size_t HighLevelILIndexList::ListIterator::operator*() } -HighLevelILIndexList::HighLevelILIndexList(HighLevelILFunction* func, - const BNHighLevelILInstruction& instr, size_t count): m_list(func, instr, count) -{ -} +HighLevelILIndexList::HighLevelILIndexList( + HighLevelILFunction* func, const BNHighLevelILInstruction& instr, size_t count) : + m_list(func, instr, count) +{} HighLevelILIndexList::const_iterator HighLevelILIndexList::begin() const @@ -407,20 +369,19 @@ const HighLevelILInstruction HighLevelILInstructionList::ListIterator::operator* { if (ast) { - return HighLevelILInstruction(pos.GetFunction(), pos.GetFunction()->GetRawExpr((size_t)*pos), - (size_t)*pos, true, instructionIndex); + return HighLevelILInstruction( + pos.GetFunction(), pos.GetFunction()->GetRawExpr((size_t)*pos), (size_t)*pos, true, instructionIndex); } - return HighLevelILInstruction(pos.GetFunction(), pos.GetFunction()->GetRawNonASTExpr((size_t)*pos), - (size_t)*pos, false, instructionIndex); + return HighLevelILInstruction( + pos.GetFunction(), pos.GetFunction()->GetRawNonASTExpr((size_t)*pos), (size_t)*pos, false, instructionIndex); } -HighLevelILInstructionList::HighLevelILInstructionList(HighLevelILFunction* func, - const BNHighLevelILInstruction& instr, size_t count, bool asFullAst, - size_t instructionIndex): m_list(func, instr, count), m_ast(asFullAst), - m_instructionIndex(instructionIndex) -{ -} +HighLevelILInstructionList::HighLevelILInstructionList(HighLevelILFunction* func, const BNHighLevelILInstruction& instr, + size_t count, bool asFullAst, size_t instructionIndex) : + m_list(func, instr, count), + m_ast(asFullAst), m_instructionIndex(instructionIndex) +{} HighLevelILInstructionList::const_iterator HighLevelILInstructionList::begin() const @@ -479,10 +440,10 @@ const SSAVariable HighLevelILSSAVariableList::ListIterator::operator*() } -HighLevelILSSAVariableList::HighLevelILSSAVariableList(HighLevelILFunction* func, - const BNHighLevelILInstruction& instr, size_t count): m_list(func, instr, count & (~1)) -{ -} +HighLevelILSSAVariableList::HighLevelILSSAVariableList( + HighLevelILFunction* func, const BNHighLevelILInstruction& instr, size_t count) : + m_list(func, instr, count & (~1)) +{} HighLevelILSSAVariableList::const_iterator HighLevelILSSAVariableList::begin() const @@ -527,9 +488,10 @@ HighLevelILSSAVariableList::operator vector() const } -HighLevelILOperand::HighLevelILOperand(const HighLevelILInstruction& instr, - HighLevelILOperandUsage usage, size_t operandIndex): - m_instr(instr), m_usage(usage), m_operandIndex(operandIndex) +HighLevelILOperand::HighLevelILOperand( + const HighLevelILInstruction& instr, HighLevelILOperandUsage usage, size_t operandIndex) : + m_instr(instr), + m_usage(usage), m_operandIndex(operandIndex) { auto i = HighLevelILInstructionBase::operandTypeForUsage.find(m_usage); if (i == HighLevelILInstructionBase::operandTypeForUsage.end()) @@ -621,11 +583,11 @@ const HighLevelILOperand HighLevelILOperandList::ListIterator::operator*() HighLevelILOperandList::HighLevelILOperandList(const HighLevelILInstruction& instr, - const vector& usageList, - const unordered_map& operandIndexMap): - m_instr(instr), m_usageList(usageList), m_operandIndexMap(operandIndexMap) -{ -} + const vector& usageList, + const unordered_map& operandIndexMap) : + m_instr(instr), + m_usageList(usageList), m_operandIndexMap(operandIndexMap) +{} HighLevelILOperandList::const_iterator HighLevelILOperandList::begin() const @@ -683,8 +645,8 @@ HighLevelILInstruction::HighLevelILInstruction() } -HighLevelILInstruction::HighLevelILInstruction(HighLevelILFunction* func, - const BNHighLevelILInstruction& instr, size_t expr, bool asFullAst, size_t instrIdx) +HighLevelILInstruction::HighLevelILInstruction( + HighLevelILFunction* func, const BNHighLevelILInstruction& instr, size_t expr, bool asFullAst, size_t instrIdx) { operation = instr.operation; sourceOperand = instr.sourceOperand; @@ -750,11 +712,11 @@ HighLevelILInstruction HighLevelILInstructionBase::GetRawOperandAsExpr(size_t op { if (ast) { - return HighLevelILInstruction(function, function->GetRawExpr(operands[operand]), - operands[operand], true, instructionIndex); + return HighLevelILInstruction( + function, function->GetRawExpr(operands[operand]), operands[operand], true, instructionIndex); } - return HighLevelILInstruction(function, function->GetRawNonASTExpr(operands[operand]), - operands[operand], false, instructionIndex); + return HighLevelILInstruction( + function, function->GetRawNonASTExpr(operands[operand]), operands[operand], false, instructionIndex); } @@ -772,8 +734,8 @@ SSAVariable HighLevelILInstructionBase::GetRawOperandAsSSAVariable(size_t operan HighLevelILInstructionList HighLevelILInstructionBase::GetRawOperandAsExprList(size_t operand) const { - return HighLevelILInstructionList(function, function->GetRawExpr(operands[operand + 1]), - operands[operand], ast, instructionIndex); + return HighLevelILInstructionList( + function, function->GetRawExpr(operands[operand + 1]), operands[operand], ast, instructionIndex); } @@ -803,7 +765,8 @@ void HighLevelILInstructionBase::UpdateRawOperandAsInteger(size_t operandIndex, } -void HighLevelILInstructionBase::UpdateRawOperandAsExprList(size_t operandIndex, const vector& exprs) +void HighLevelILInstructionBase::UpdateRawOperandAsExprList( + size_t operandIndex, const vector& exprs) { vector exprIndexList; for (auto& i : exprs) @@ -1222,14 +1185,12 @@ void HighLevelILInstruction::VisitExprs(const std::function& subExprHandler) const +ExprId HighLevelILInstruction::CopyTo( + HighLevelILFunction* dest, const std::function& subExprHandler) const { vector output, params; switch (operation) @@ -1241,37 +1202,33 @@ ExprId HighLevelILInstruction::CopyTo(HighLevelILFunction* dest, params.push_back(subExprHandler(i)); return dest->Block(params, *this); case HLIL_IF: - return dest->If(subExprHandler(GetConditionExpr()), - subExprHandler(GetTrueExpr()), subExprHandler(GetFalseExpr()), *this); + return dest->If(subExprHandler(GetConditionExpr()), subExprHandler(GetTrueExpr()), + subExprHandler(GetFalseExpr()), *this); case HLIL_WHILE: - return dest->While(subExprHandler(GetConditionExpr()), - subExprHandler(GetLoopExpr()), *this); + return dest->While( + subExprHandler(GetConditionExpr()), subExprHandler(GetLoopExpr()), *this); case HLIL_WHILE_SSA: return dest->WhileSSA(subExprHandler(GetConditionPhiExpr()), - subExprHandler(GetConditionExpr()), - subExprHandler(GetLoopExpr()), *this); + subExprHandler(GetConditionExpr()), subExprHandler(GetLoopExpr()), *this); case HLIL_DO_WHILE: - return dest->DoWhile(subExprHandler(GetLoopExpr()), - subExprHandler(GetConditionExpr()), *this); + return dest->DoWhile( + subExprHandler(GetLoopExpr()), subExprHandler(GetConditionExpr()), *this); case HLIL_DO_WHILE_SSA: return dest->DoWhileSSA(subExprHandler(GetLoopExpr()), - subExprHandler(GetConditionPhiExpr()), - subExprHandler(GetConditionExpr()), *this); + subExprHandler(GetConditionPhiExpr()), + subExprHandler(GetConditionExpr()), *this); case HLIL_FOR: - return dest->For(subExprHandler(GetInitExpr()), - subExprHandler(GetConditionExpr()), subExprHandler(GetUpdateExpr()), - subExprHandler(GetLoopExpr()), *this); + return dest->For(subExprHandler(GetInitExpr()), subExprHandler(GetConditionExpr()), + subExprHandler(GetUpdateExpr()), subExprHandler(GetLoopExpr()), *this); case HLIL_FOR_SSA: return dest->ForSSA(subExprHandler(GetInitExpr()), - subExprHandler(GetConditionPhiExpr()), - subExprHandler(GetConditionExpr()), - subExprHandler(GetUpdateExpr()), - subExprHandler(GetLoopExpr()), *this); + subExprHandler(GetConditionPhiExpr()), subExprHandler(GetConditionExpr()), + subExprHandler(GetUpdateExpr()), subExprHandler(GetLoopExpr()), *this); case HLIL_SWITCH: for (auto i : GetCases()) params.push_back(subExprHandler(i)); return dest->Switch(subExprHandler(GetConditionExpr()), - subExprHandler(GetDefaultExpr()), params, *this); + subExprHandler(GetDefaultExpr()), params, *this); case HLIL_CASE: for (auto i : GetValueExprs()) params.push_back(subExprHandler(i)); @@ -1287,29 +1244,28 @@ ExprId HighLevelILInstruction::CopyTo(HighLevelILFunction* dest, case HLIL_VAR_DECLARE: return dest->VarDeclare(GetVariable(), *this); case HLIL_VAR_INIT: - return dest->VarInit(size, GetDestVariable(), - subExprHandler(GetSourceExpr()), *this); + return dest->VarInit( + size, GetDestVariable(), subExprHandler(GetSourceExpr()), *this); case HLIL_VAR_INIT_SSA: - return dest->VarInitSSA(size, GetDestSSAVariable(), - subExprHandler(GetSourceExpr()), *this); + return dest->VarInitSSA( + size, GetDestSSAVariable(), subExprHandler(GetSourceExpr()), *this); case HLIL_ASSIGN: - return dest->Assign(size, subExprHandler(GetDestExpr()), - subExprHandler(GetSourceExpr()), *this); + return dest->Assign( + size, subExprHandler(GetDestExpr()), subExprHandler(GetSourceExpr()), *this); case HLIL_ASSIGN_UNPACK: for (auto i : GetDestExprs()) output.push_back(subExprHandler(i)); - return dest->AssignUnpack(output, - subExprHandler(GetSourceExpr()), *this); + return dest->AssignUnpack(output, subExprHandler(GetSourceExpr()), *this); case HLIL_ASSIGN_MEM_SSA: return dest->AssignMemSSA(size, subExprHandler(GetDestExpr()), - GetDestMemoryVersion(), subExprHandler(GetSourceExpr()), - GetSourceMemoryVersion(), *this); + GetDestMemoryVersion(), subExprHandler(GetSourceExpr()), + GetSourceMemoryVersion(), *this); case HLIL_ASSIGN_UNPACK_MEM_SSA: for (auto i : GetDestExprs()) output.push_back(subExprHandler(i)); return dest->AssignUnpackMemSSA(output, GetDestMemoryVersion(), - subExprHandler(GetSourceExpr()), - GetSourceMemoryVersion(), *this); + subExprHandler(GetSourceExpr()), + GetSourceMemoryVersion(), *this); case HLIL_VAR: return dest->Var(size, GetVariable(), *this); case HLIL_VAR_SSA: @@ -1320,29 +1276,29 @@ ExprId HighLevelILInstruction::CopyTo(HighLevelILFunction* dest, return dest->MemPhi(GetDestMemoryVersion(), GetSourceMemoryVersions(), *this); case HLIL_STRUCT_FIELD: return dest->StructField(size, subExprHandler(GetSourceExpr()), - GetOffset(), GetMemberIndex(), *this); + GetOffset(), GetMemberIndex(), *this); case HLIL_ARRAY_INDEX: return dest->ArrayIndex(size, subExprHandler(GetSourceExpr()), - subExprHandler(GetIndexExpr()), *this); + subExprHandler(GetIndexExpr()), *this); case HLIL_ARRAY_INDEX_SSA: return dest->ArrayIndexSSA(size, subExprHandler(GetSourceExpr()), - GetSourceMemoryVersion(), - subExprHandler(GetIndexExpr()), *this); + GetSourceMemoryVersion(), subExprHandler(GetIndexExpr()), + *this); case HLIL_SPLIT: - return dest->Split(size, subExprHandler(GetHighExpr()), - subExprHandler(GetLowExpr()), *this); + return dest->Split( + size, subExprHandler(GetHighExpr()), subExprHandler(GetLowExpr()), *this); case HLIL_DEREF: return dest->Deref(size, subExprHandler(GetSourceExpr()), *this); case HLIL_DEREF_FIELD: - return dest->DerefField(size, subExprHandler(GetSourceExpr()), - GetOffset(), GetMemberIndex(), *this); + return dest->DerefField(size, subExprHandler(GetSourceExpr()), GetOffset(), + GetMemberIndex(), *this); case HLIL_DEREF_SSA: - return dest->DerefSSA(size, subExprHandler(GetSourceExpr()), - GetSourceMemoryVersion(), *this); + return dest->DerefSSA( + size, subExprHandler(GetSourceExpr()), GetSourceMemoryVersion(), *this); case HLIL_DEREF_FIELD_SSA: return dest->DerefFieldSSA(size, subExprHandler(GetSourceExpr()), - GetSourceMemoryVersion(), GetOffset(), - GetMemberIndex(), *this); + GetSourceMemoryVersion(), GetOffset(), + GetMemberIndex(), *this); case HLIL_ADDRESS_OF: return dest->AddressOf(subExprHandler(GetSourceExpr()), *this); case HLIL_CALL: @@ -1361,12 +1317,12 @@ ExprId HighLevelILInstruction::CopyTo(HighLevelILFunction* dest, for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); return dest->CallSSA(subExprHandler(GetDestExpr()), params, - GetDestMemoryVersion(), GetSourceMemoryVersion(), *this); + GetDestMemoryVersion(), GetSourceMemoryVersion(), *this); case HLIL_SYSCALL_SSA: for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); - return dest->SyscallSSA(params, GetDestMemoryVersion(), - GetSourceMemoryVersion(), *this); + return dest->SyscallSSA( + params, GetDestMemoryVersion(), GetSourceMemoryVersion(), *this); case HLIL_RET: for (auto i : GetSourceExprs()) params.push_back(subExprHandler(i)); @@ -1391,8 +1347,7 @@ ExprId HighLevelILInstruction::CopyTo(HighLevelILFunction* dest, case HLIL_FLOOR: case HLIL_CEIL: case HLIL_FTRUNC: - return dest->AddExprWithLocation(operation, *this, size, - subExprHandler(AsOneOperand().GetSourceExpr())); + return dest->AddExprWithLocation(operation, *this, size, subExprHandler(AsOneOperand().GetSourceExpr())); case HLIL_ADD: case HLIL_SUB: case HLIL_AND: @@ -1438,16 +1393,15 @@ ExprId HighLevelILInstruction::CopyTo(HighLevelILFunction* dest, case HLIL_FCMP_GT: case HLIL_FCMP_O: case HLIL_FCMP_UO: - return dest->AddExprWithLocation(operation, *this, size, - subExprHandler(AsTwoOperand().GetLeftExpr()), subExprHandler(AsTwoOperand().GetRightExpr())); + return dest->AddExprWithLocation(operation, *this, size, subExprHandler(AsTwoOperand().GetLeftExpr()), + subExprHandler(AsTwoOperand().GetRightExpr())); case HLIL_ADC: case HLIL_SBB: case HLIL_RLC: case HLIL_RRC: - return dest->AddExprWithLocation(operation, *this, size, - subExprHandler(AsTwoOperandWithCarry().GetLeftExpr()), - subExprHandler(AsTwoOperandWithCarry().GetRightExpr()), - subExprHandler(AsTwoOperandWithCarry().GetCarryExpr())); + return dest->AddExprWithLocation(operation, *this, size, subExprHandler(AsTwoOperandWithCarry().GetLeftExpr()), + subExprHandler(AsTwoOperandWithCarry().GetRightExpr()), + subExprHandler(AsTwoOperandWithCarry().GetCarryExpr())); case HLIL_CONST: return dest->Const(size, GetConstant(), *this); case HLIL_CONST_PTR: @@ -1470,7 +1424,7 @@ ExprId HighLevelILInstruction::CopyTo(HighLevelILFunction* dest, for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); return dest->IntrinsicSSA(GetIntrinsic(), params, - GetDestMemoryVersion(), GetSourceMemoryVersion(), *this); + GetDestMemoryVersion(), GetSourceMemoryVersion(), *this); case HLIL_UNDEF: return dest->Undefined(*this); case HLIL_UNIMPL: @@ -1666,19 +1620,24 @@ bool HighLevelILInstruction::operator<(const HighLevelILInstruction& other) cons return false; return GetSourceMemoryVersion() < other.GetSourceMemoryVersion(); case HLIL_ASSIGN_UNPACK_MEM_SSA: - if (GetDestMemoryVersion() < other.GetDestMemoryVersion()) + if (GetDestMemoryVersion() + < other.GetDestMemoryVersion()) return true; - if (other.GetDestMemoryVersion() < GetDestMemoryVersion()) + if (other.GetDestMemoryVersion() + < GetDestMemoryVersion()) return false; if (GetSourceExpr() < other.GetSourceExpr()) return true; if (other.GetSourceExpr() < GetSourceExpr()) return false; - if (GetSourceMemoryVersion() < other.GetSourceMemoryVersion()) + if (GetSourceMemoryVersion() + < other.GetSourceMemoryVersion()) return true; - if (other.GetSourceMemoryVersion() < GetSourceMemoryVersion()) + if (other.GetSourceMemoryVersion() + < GetSourceMemoryVersion()) return false; - return CompareExprList(GetDestExprs(), other.GetDestExprs()); + return CompareExprList( + GetDestExprs(), other.GetDestExprs()); case HLIL_VAR: if (size < other.size) return true; @@ -1949,51 +1908,51 @@ bool HighLevelILInstruction::operator<(const HighLevelILInstruction& other) cons return false; return AsOneOperand().GetSourceExpr() < other.AsOneOperand().GetSourceExpr(); case HLIL_VAR_PHI: + { + if (GetDestSSAVariable() < other.GetDestSSAVariable()) + return true; + if (other.GetDestSSAVariable() < GetDestSSAVariable()) + return false; + HighLevelILSSAVariableList list = GetSourceSSAVariables(); + HighLevelILSSAVariableList otherList = other.GetSourceSSAVariables(); + if (list.size() < otherList.size()) + return true; + if (list.size() > otherList.size()) + return false; + auto i = list.begin(); + auto j = otherList.begin(); + for (; i != list.end(); ++i, ++j) { - if (GetDestSSAVariable() < other.GetDestSSAVariable()) - return true; - if (other.GetDestSSAVariable() < GetDestSSAVariable()) - return false; - HighLevelILSSAVariableList list = GetSourceSSAVariables(); - HighLevelILSSAVariableList otherList = other.GetSourceSSAVariables(); - if (list.size() < otherList.size()) + if (*i < *j) return true; - if (list.size() > otherList.size()) + if (*j < *i) return false; - auto i = list.begin(); - auto j = otherList.begin(); - for (; i != list.end(); ++i, ++j) - { - if (*i < *j) - return true; - if (*j < *i) - return false; - } - return false; } + return false; + } case HLIL_MEM_PHI: + { + if (GetDestMemoryVersion() < other.GetDestMemoryVersion()) + return true; + if (other.GetDestMemoryVersion() < GetDestMemoryVersion()) + return false; + HighLevelILIndexList list = GetSourceMemoryVersions(); + HighLevelILIndexList otherList = other.GetSourceMemoryVersions(); + if (list.size() < otherList.size()) + return true; + if (list.size() > otherList.size()) + return false; + auto i = list.begin(); + auto j = otherList.begin(); + for (; i != list.end(); ++i, ++j) { - if (GetDestMemoryVersion() < other.GetDestMemoryVersion()) - return true; - if (other.GetDestMemoryVersion() < GetDestMemoryVersion()) - return false; - HighLevelILIndexList list = GetSourceMemoryVersions(); - HighLevelILIndexList otherList = other.GetSourceMemoryVersions(); - if (list.size() < otherList.size()) + if (*i < *j) return true; - if (list.size() > otherList.size()) + if (*j < *i) return false; - auto i = list.begin(); - auto j = otherList.begin(); - for (; i != list.end(); ++i, ++j) - { - if (*i < *j) - return true; - if (*j < *i) - return false; - } - return false; } + return false; + } default: return false; } @@ -2361,8 +2320,7 @@ ExprId HighLevelILFunction::Block(const vector& exprs, const ILSourceLoc } -ExprId HighLevelILFunction::If(ExprId condition, ExprId trueExpr, ExprId falseExpr, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::If(ExprId condition, ExprId trueExpr, ExprId falseExpr, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_IF, loc, 0, condition, trueExpr, falseExpr); } @@ -2374,8 +2332,8 @@ ExprId HighLevelILFunction::While(ExprId condition, ExprId loopExpr, const ILSou } -ExprId HighLevelILFunction::WhileSSA(ExprId conditionPhi, ExprId condition, ExprId loopExpr, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::WhileSSA( + ExprId conditionPhi, ExprId condition, ExprId loopExpr, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_WHILE_SSA, loc, 0, conditionPhi, condition, loopExpr); } @@ -2387,32 +2345,31 @@ ExprId HighLevelILFunction::DoWhile(ExprId loopExpr, ExprId condition, const ILS } -ExprId HighLevelILFunction::DoWhileSSA(ExprId loopExpr, ExprId conditionPhi, ExprId condition, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::DoWhileSSA( + ExprId loopExpr, ExprId conditionPhi, ExprId condition, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_DO_WHILE_SSA, loc, 0, loopExpr, conditionPhi, condition); } -ExprId HighLevelILFunction::For(ExprId initExpr, ExprId condition, ExprId updateExpr, ExprId loopExpr, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::For( + ExprId initExpr, ExprId condition, ExprId updateExpr, ExprId loopExpr, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_FOR, loc, 0, initExpr, condition, updateExpr, loopExpr); } -ExprId HighLevelILFunction::ForSSA(ExprId initExpr, ExprId conditionPhi, ExprId condition, - ExprId updateExpr, ExprId loopExpr, const ILSourceLocation& loc) +ExprId HighLevelILFunction::ForSSA(ExprId initExpr, ExprId conditionPhi, ExprId condition, ExprId updateExpr, + ExprId loopExpr, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_FOR_SSA, loc, 0, initExpr, conditionPhi, condition, updateExpr, loopExpr); } -ExprId HighLevelILFunction::Switch(ExprId condition, ExprId defaultExpr, const vector& cases, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::Switch( + ExprId condition, ExprId defaultExpr, const vector& cases, const ILSourceLocation& loc) { - return AddExprWithLocation(HLIL_SWITCH, loc, 0, condition, defaultExpr, - cases.size(), AddOperandList(cases)); + return AddExprWithLocation(HLIL_SWITCH, loc, 0, condition, defaultExpr, cases.size(), AddOperandList(cases)); } @@ -2488,46 +2445,44 @@ ExprId HighLevelILFunction::Assign(size_t size, ExprId dest, ExprId src, const I } -ExprId HighLevelILFunction::AssignUnpack(const vector& output, ExprId src, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::AssignUnpack(const vector& output, ExprId src, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ASSIGN_UNPACK, loc, 0, output.size(), AddOperandList(output), src); } -ExprId HighLevelILFunction::AssignMemSSA(size_t size, ExprId dest, size_t destMemVersion, ExprId src, - size_t srcMemVersion, const ILSourceLocation& loc) +ExprId HighLevelILFunction::AssignMemSSA( + size_t size, ExprId dest, size_t destMemVersion, ExprId src, size_t srcMemVersion, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ASSIGN_MEM_SSA, loc, size, dest, destMemVersion, src, srcMemVersion); } -ExprId HighLevelILFunction::AssignUnpackMemSSA(const vector& output, size_t destMemVersion, ExprId src, - size_t srcMemVersion, const ILSourceLocation& loc) +ExprId HighLevelILFunction::AssignUnpackMemSSA( + const vector& output, size_t destMemVersion, ExprId src, size_t srcMemVersion, const ILSourceLocation& loc) { - return AddExprWithLocation(HLIL_ASSIGN_UNPACK_MEM_SSA, loc, 0, output.size(), AddOperandList(output), - destMemVersion, src, srcMemVersion); + return AddExprWithLocation( + HLIL_ASSIGN_UNPACK_MEM_SSA, loc, 0, output.size(), AddOperandList(output), destMemVersion, src, srcMemVersion); } -ExprId HighLevelILFunction::Var(size_t size, const Variable& src, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::Var(size_t size, const Variable& src, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_VAR, loc, size, src.ToIdentifier()); } -ExprId HighLevelILFunction::VarSSA(size_t size, const SSAVariable& src, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::VarSSA(size_t size, const SSAVariable& src, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_VAR_SSA, loc, size, src.var.ToIdentifier(), src.version); } -ExprId HighLevelILFunction::VarPhi(const SSAVariable& dest, const vector& sources, const ILSourceLocation& loc) +ExprId HighLevelILFunction::VarPhi( + const SSAVariable& dest, const vector& sources, const ILSourceLocation& loc) { - return AddExprWithLocation(HLIL_VAR_PHI, loc, 0, dest.var.ToIdentifier(), dest.version, - sources.size() * 2, AddSSAVariableList(sources)); + return AddExprWithLocation( + HLIL_VAR_PHI, loc, 0, dest.var.ToIdentifier(), dest.version, sources.size() * 2, AddSSAVariableList(sources)); } @@ -2537,8 +2492,8 @@ ExprId HighLevelILFunction::MemPhi(size_t dest, const vector& sources, c } -ExprId HighLevelILFunction::StructField(size_t size, ExprId src, uint64_t offset, size_t memberIndex, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::StructField( + size_t size, ExprId src, uint64_t offset, size_t memberIndex, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_STRUCT_FIELD, loc, size, src, offset, memberIndex); } @@ -2556,8 +2511,8 @@ ExprId HighLevelILFunction::ArrayIndex(size_t size, ExprId src, ExprId idx, cons } -ExprId HighLevelILFunction::ArrayIndexSSA(size_t size, ExprId src, size_t srcMemVersion, ExprId idx, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::ArrayIndexSSA( + size_t size, ExprId src, size_t srcMemVersion, ExprId idx, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ARRAY_INDEX_SSA, loc, size, src, srcMemVersion, idx); } @@ -2569,8 +2524,8 @@ ExprId HighLevelILFunction::Deref(size_t size, ExprId src, const ILSourceLocatio } -ExprId HighLevelILFunction::DerefField(size_t size, ExprId src, uint64_t offset, size_t memberIndex, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::DerefField( + size_t size, ExprId src, uint64_t offset, size_t memberIndex, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_DEREF_FIELD, loc, size, src, offset, memberIndex); } @@ -2582,8 +2537,8 @@ ExprId HighLevelILFunction::DerefSSA(size_t size, ExprId src, size_t srcMemVersi } -ExprId HighLevelILFunction::DerefFieldSSA(size_t size, ExprId src, size_t srcMemVersion, - uint64_t offset, size_t memberIndex, const ILSourceLocation& loc) +ExprId HighLevelILFunction::DerefFieldSSA( + size_t size, ExprId src, size_t srcMemVersion, uint64_t offset, size_t memberIndex, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_DEREF_FIELD_SSA, loc, size, src, srcMemVersion, offset, memberIndex); } @@ -2655,8 +2610,8 @@ ExprId HighLevelILFunction::Add(size_t size, ExprId left, ExprId right, const IL } -ExprId HighLevelILFunction::AddWithCarry(size_t size, ExprId left, ExprId right, ExprId carry, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::AddWithCarry( + size_t size, ExprId left, ExprId right, ExprId carry, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ADC, loc, size, left, right, carry); } @@ -2668,8 +2623,8 @@ ExprId HighLevelILFunction::Sub(size_t size, ExprId left, ExprId right, const IL } -ExprId HighLevelILFunction::SubWithBorrow(size_t size, ExprId left, ExprId right, ExprId carry, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::SubWithBorrow( + size_t size, ExprId left, ExprId right, ExprId carry, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_SBB, loc, size, left, right, carry); } @@ -2693,127 +2648,111 @@ ExprId HighLevelILFunction::Xor(size_t size, ExprId left, ExprId right, const IL } -ExprId HighLevelILFunction::ShiftLeft(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::ShiftLeft(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_LSL, loc, size, left, right); } -ExprId HighLevelILFunction::LogicalShiftRight(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::LogicalShiftRight(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_LSR, loc, size, left, right); } -ExprId HighLevelILFunction::ArithShiftRight(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::ArithShiftRight(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ASR, loc, size, left, right); } -ExprId HighLevelILFunction::RotateLeft(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::RotateLeft(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ROL, loc, size, left, right); } -ExprId HighLevelILFunction::RotateLeftCarry(size_t size, ExprId left, ExprId right, ExprId carry, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::RotateLeftCarry( + size_t size, ExprId left, ExprId right, ExprId carry, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_RLC, loc, size, left, right, carry); } -ExprId HighLevelILFunction::RotateRight(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::RotateRight(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ROR, loc, size, left, right); } -ExprId HighLevelILFunction::RotateRightCarry(size_t size, ExprId left, ExprId right, ExprId carry, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::RotateRightCarry( + size_t size, ExprId left, ExprId right, ExprId carry, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_RRC, loc, size, left, right, carry); } -ExprId HighLevelILFunction::Mult(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::Mult(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_MUL, loc, size, left, right); } -ExprId HighLevelILFunction::MultDoublePrecSigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::MultDoublePrecSigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_MULS_DP, loc, size, left, right); } -ExprId HighLevelILFunction::MultDoublePrecUnsigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::MultDoublePrecUnsigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_MULU_DP, loc, size, left, right); } -ExprId HighLevelILFunction::DivSigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::DivSigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_DIVS, loc, size, left, right); } -ExprId HighLevelILFunction::DivUnsigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::DivUnsigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_DIVU, loc, size, left, right); } -ExprId HighLevelILFunction::DivDoublePrecSigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::DivDoublePrecSigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_DIVS_DP, loc, size, left, right); } -ExprId HighLevelILFunction::DivDoublePrecUnsigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::DivDoublePrecUnsigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_DIVU_DP, loc, size, left, right); } -ExprId HighLevelILFunction::ModSigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::ModSigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_MODS, loc, size, left, right); } -ExprId HighLevelILFunction::ModUnsigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::ModUnsigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_MODU, loc, size, left, right); } -ExprId HighLevelILFunction::ModDoublePrecSigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::ModDoublePrecSigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_MODS_DP, loc, size, left, right); } -ExprId HighLevelILFunction::ModDoublePrecUnsigned(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::ModDoublePrecUnsigned(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_MODU_DP, loc, size, left, right); } @@ -2855,8 +2794,7 @@ ExprId HighLevelILFunction::Call(ExprId dest, const vector& params, cons } -ExprId HighLevelILFunction::Syscall(const vector& params, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::Syscall(const vector& params, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_SYSCALL, loc, 0, params.size(), AddOperandList(params)); } @@ -2868,94 +2806,88 @@ ExprId HighLevelILFunction::TailCall(ExprId dest, const vector& params, } -ExprId HighLevelILFunction::CallSSA(ExprId dest, const vector& params, size_t destMemVersion, - size_t srcMemVersion, const ILSourceLocation& loc) +ExprId HighLevelILFunction::CallSSA( + ExprId dest, const vector& params, size_t destMemVersion, size_t srcMemVersion, const ILSourceLocation& loc) { - return AddExprWithLocation(HLIL_CALL_SSA, loc, 0, dest, params.size(), AddOperandList(params), - destMemVersion, srcMemVersion); + return AddExprWithLocation( + HLIL_CALL_SSA, loc, 0, dest, params.size(), AddOperandList(params), destMemVersion, srcMemVersion); } -ExprId HighLevelILFunction::SyscallSSA(const vector& params, size_t destMemVersion, - size_t srcMemVersion, const ILSourceLocation& loc) +ExprId HighLevelILFunction::SyscallSSA( + const vector& params, size_t destMemVersion, size_t srcMemVersion, const ILSourceLocation& loc) { - return AddExprWithLocation(HLIL_SYSCALL_SSA, loc, 0, params.size(), AddOperandList(params), - destMemVersion, srcMemVersion); + return AddExprWithLocation( + HLIL_SYSCALL_SSA, loc, 0, params.size(), AddOperandList(params), destMemVersion, srcMemVersion); } -ExprId HighLevelILFunction::CompareEqual(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareEqual(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_E, loc, size, left, right); } -ExprId HighLevelILFunction::CompareNotEqual(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareNotEqual(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_NE, loc, size, left, right); } -ExprId HighLevelILFunction::CompareSignedLessThan(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareSignedLessThan(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_SLT, loc, size, left, right); } -ExprId HighLevelILFunction::CompareUnsignedLessThan(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareUnsignedLessThan(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_ULT, loc, size, left, right); } -ExprId HighLevelILFunction::CompareSignedLessEqual(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareSignedLessEqual(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_SLE, loc, size, left, right); } -ExprId HighLevelILFunction::CompareUnsignedLessEqual(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareUnsignedLessEqual( + size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_ULE, loc, size, left, right); } -ExprId HighLevelILFunction::CompareSignedGreaterEqual(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareSignedGreaterEqual( + size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_SGE, loc, size, left, right); } -ExprId HighLevelILFunction::CompareUnsignedGreaterEqual(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareUnsignedGreaterEqual( + size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_UGE, loc, size, left, right); } -ExprId HighLevelILFunction::CompareSignedGreaterThan(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareSignedGreaterThan( + size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_SGT, loc, size, left, right); } -ExprId HighLevelILFunction::CompareUnsignedGreaterThan(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::CompareUnsignedGreaterThan( + size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_CMP_UGT, loc, size, left, right); } -ExprId HighLevelILFunction::TestBit(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::TestBit(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_TEST_BIT, loc, size, left, right); } @@ -2967,8 +2899,7 @@ ExprId HighLevelILFunction::BoolToInt(size_t size, ExprId src, const ILSourceLoc } -ExprId HighLevelILFunction::AddOverflow(size_t size, ExprId left, ExprId right, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::AddOverflow(size_t size, ExprId left, ExprId right, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_ADD_OVERFLOW, loc, size, left, right); } @@ -2986,19 +2917,17 @@ ExprId HighLevelILFunction::Trap(int64_t vector, const ILSourceLocation& loc) } -ExprId HighLevelILFunction::Intrinsic(uint32_t intrinsic, const vector& params, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::Intrinsic(uint32_t intrinsic, const vector& params, const ILSourceLocation& loc) { - return AddExprWithLocation(HLIL_INTRINSIC, loc, 0, intrinsic, - params.size(), AddOperandList(params)); + return AddExprWithLocation(HLIL_INTRINSIC, loc, 0, intrinsic, params.size(), AddOperandList(params)); } -ExprId HighLevelILFunction::IntrinsicSSA(uint32_t intrinsic, const vector& params, - size_t destMemVersion, size_t srcMemVersion, const ILSourceLocation& loc) +ExprId HighLevelILFunction::IntrinsicSSA(uint32_t intrinsic, const vector& params, size_t destMemVersion, + size_t srcMemVersion, const ILSourceLocation& loc) { - return AddExprWithLocation(HLIL_INTRINSIC_SSA, loc, 0, intrinsic, - params.size(), AddOperandList(params), destMemVersion, srcMemVersion); + return AddExprWithLocation( + HLIL_INTRINSIC_SSA, loc, 0, intrinsic, params.size(), AddOperandList(params), destMemVersion, srcMemVersion); } @@ -3014,8 +2943,7 @@ ExprId HighLevelILFunction::Unimplemented(const ILSourceLocation& loc) } -ExprId HighLevelILFunction::UnimplementedMemoryRef(size_t size, ExprId target, - const ILSourceLocation& loc) +ExprId HighLevelILFunction::UnimplementedMemoryRef(size_t size, ExprId target, const ILSourceLocation& loc) { return AddExprWithLocation(HLIL_UNIMPL_MEM, loc, size, target); } -- cgit v1.3.1