From 6812c973c9fa9b4ad642ab81856c05f87bd6fcc4 Mon Sep 17 00:00:00 2001 From: KyleMiles Date: Thu, 27 Jan 2022 22:43:28 -0500 Subject: Format All Files --- lowlevelilinstruction.cpp | 995 +++++++++++++++++++++------------------------- 1 file changed, 456 insertions(+), 539 deletions(-) (limited to 'lowlevelilinstruction.cpp') diff --git a/lowlevelilinstruction.cpp b/lowlevelilinstruction.cpp index d0f7137d..59a3ad55 100644 --- a/lowlevelilinstruction.cpp +++ b/lowlevelilinstruction.cpp @@ -19,14 +19,14 @@ // IN THE SOFTWARE. #ifdef BINARYNINJACORE_LIBRARY -#include "lowlevelilfunction.h" -#include "lowlevelilssafunction.h" -#include "mediumlevelilfunction.h" + #include "lowlevelilfunction.h" + #include "lowlevelilssafunction.h" + #include "mediumlevelilfunction.h" using namespace BinaryNinjaCore; #else -#include "binaryninjaapi.h" -#include "lowlevelilinstruction.h" -#include "mediumlevelilinstruction.h" + #include "binaryninjaapi.h" + #include "lowlevelilinstruction.h" + #include "mediumlevelilinstruction.h" using namespace BinaryNinja; #endif @@ -35,220 +35,192 @@ using namespace std; #endif -unordered_map - LowLevelILInstructionBase::operandTypeForUsage = { - {SourceExprLowLevelOperandUsage, ExprLowLevelOperand}, - {SourceRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, - {SourceRegisterStackLowLevelOperandUsage, RegisterStackLowLevelOperand}, - {SourceFlagLowLevelOperandUsage, FlagLowLevelOperand}, - {SourceSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, - {SourceSSARegisterStackLowLevelOperandUsage, SSARegisterStackLowLevelOperand}, - {SourceSSAFlagLowLevelOperandUsage, SSAFlagLowLevelOperand}, - {DestExprLowLevelOperandUsage, ExprLowLevelOperand}, - {DestRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, - {DestRegisterStackLowLevelOperandUsage, RegisterStackLowLevelOperand}, - {DestFlagLowLevelOperandUsage, FlagLowLevelOperand}, - {DestSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, - {DestSSARegisterStackLowLevelOperandUsage, SSARegisterStackLowLevelOperand}, - {DestSSAFlagLowLevelOperandUsage, SSAFlagLowLevelOperand}, - {SemanticFlagClassLowLevelOperandUsage, SemanticFlagClassLowLevelOperand}, - {SemanticFlagGroupLowLevelOperandUsage, SemanticFlagGroupLowLevelOperand}, - {PartialRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, - {PartialSSARegisterStackSourceLowLevelOperandUsage, SSARegisterStackLowLevelOperand}, - {StackSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, - {StackMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, - {TopSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, - {LeftExprLowLevelOperandUsage, ExprLowLevelOperand}, - {RightExprLowLevelOperandUsage, ExprLowLevelOperand}, - {CarryExprLowLevelOperandUsage, ExprLowLevelOperand}, - {ConditionExprLowLevelOperandUsage, ExprLowLevelOperand}, - {HighRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, - {HighSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, - {LowRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, - {LowSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, - {IntrinsicLowLevelOperandUsage, IntrinsicLowLevelOperand}, - {ConstantLowLevelOperandUsage, IntegerLowLevelOperand}, - {VectorLowLevelOperandUsage, IntegerLowLevelOperand}, - {StackAdjustmentLowLevelOperandUsage, IntegerLowLevelOperand}, - {TargetLowLevelOperandUsage, IndexLowLevelOperand}, - {TrueTargetLowLevelOperandUsage, IndexLowLevelOperand}, - {FalseTargetLowLevelOperandUsage, IndexLowLevelOperand}, - {BitIndexLowLevelOperandUsage, IndexLowLevelOperand}, - {SourceMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, - {DestMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, - {FlagConditionLowLevelOperandUsage, FlagConditionLowLevelOperand}, - {OutputSSARegistersLowLevelOperandUsage, SSARegisterListLowLevelOperand}, - {OutputMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, - {ParameterExprsLowLevelOperandUsage, ExprListLowLevelOperand}, - {SourceSSARegistersLowLevelOperandUsage, SSARegisterListLowLevelOperand}, - {SourceSSARegisterStacksLowLevelOperandUsage, SSARegisterStackListLowLevelOperand}, - {SourceSSAFlagsLowLevelOperandUsage, SSAFlagListLowLevelOperand}, - {OutputRegisterOrFlagListLowLevelOperandUsage, RegisterOrFlagListLowLevelOperand}, - {OutputSSARegisterOrFlagListLowLevelOperandUsage, SSARegisterOrFlagListLowLevelOperand}, - {SourceMemoryVersionsLowLevelOperandUsage, IndexListLowLevelOperand}, - {TargetsLowLevelOperandUsage, IndexMapLowLevelOperand}, - {RegisterStackAdjustmentsLowLevelOperandUsage, RegisterStackAdjustmentsLowLevelOperand} - }; - - -unordered_map> - LowLevelILInstructionBase::operationOperandUsage = { - {LLIL_NOP, {}}, - {LLIL_POP, {}}, - {LLIL_NORET, {}}, - {LLIL_SYSCALL, {}}, - {LLIL_BP, {}}, - {LLIL_UNDEF, {}}, - {LLIL_UNIMPL, {}}, - {LLIL_SET_REG, {DestRegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_SET_REG_SPLIT, {HighRegisterLowLevelOperandUsage, LowRegisterLowLevelOperandUsage, - SourceExprLowLevelOperandUsage}}, - {LLIL_SET_REG_SSA, {DestSSARegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_SET_REG_SSA_PARTIAL, {DestSSARegisterLowLevelOperandUsage, PartialRegisterLowLevelOperandUsage, - SourceExprLowLevelOperandUsage}}, - {LLIL_SET_REG_SPLIT_SSA, {HighSSARegisterLowLevelOperandUsage, - LowSSARegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_SET_REG_STACK_REL, {DestRegisterStackLowLevelOperandUsage, DestExprLowLevelOperandUsage, - SourceExprLowLevelOperandUsage}}, - {LLIL_REG_STACK_PUSH, {DestRegisterStackLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_SET_REG_STACK_REL_SSA, {DestSSARegisterStackLowLevelOperandUsage, - PartialSSARegisterStackSourceLowLevelOperandUsage, DestExprLowLevelOperandUsage, - TopSSARegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_SET_REG_STACK_ABS_SSA, {DestSSARegisterStackLowLevelOperandUsage, - PartialSSARegisterStackSourceLowLevelOperandUsage, DestRegisterLowLevelOperandUsage, - SourceExprLowLevelOperandUsage}}, - {LLIL_SET_FLAG, {DestFlagLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_SET_FLAG_SSA, {DestSSAFlagLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_LOAD, {SourceExprLowLevelOperandUsage}}, - {LLIL_LOAD_SSA, {SourceExprLowLevelOperandUsage, SourceMemoryVersionLowLevelOperandUsage}}, - {LLIL_STORE, {DestExprLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_STORE_SSA, {DestExprLowLevelOperandUsage, DestMemoryVersionLowLevelOperandUsage, - SourceMemoryVersionLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_REG, {SourceRegisterLowLevelOperandUsage}}, - {LLIL_REG_SSA, {SourceSSARegisterLowLevelOperandUsage}}, - {LLIL_REG_SSA_PARTIAL, {SourceSSARegisterLowLevelOperandUsage, PartialRegisterLowLevelOperandUsage}}, - {LLIL_REG_SPLIT, {HighRegisterLowLevelOperandUsage, LowRegisterLowLevelOperandUsage}}, - {LLIL_REG_SPLIT_SSA, {HighSSARegisterLowLevelOperandUsage, LowSSARegisterLowLevelOperandUsage}}, - {LLIL_REG_STACK_REL, {SourceRegisterStackLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, - {LLIL_REG_STACK_POP, {SourceRegisterStackLowLevelOperandUsage}}, - {LLIL_REG_STACK_FREE_REG, {DestRegisterLowLevelOperandUsage}}, - {LLIL_REG_STACK_FREE_REL, {DestRegisterStackLowLevelOperandUsage, DestExprLowLevelOperandUsage}}, - {LLIL_REG_STACK_REL_SSA, {SourceSSARegisterStackLowLevelOperandUsage, TopSSARegisterLowLevelOperandUsage, - SourceExprLowLevelOperandUsage}}, - {LLIL_REG_STACK_ABS_SSA, {SourceSSARegisterStackLowLevelOperandUsage, SourceRegisterLowLevelOperandUsage}}, - {LLIL_REG_STACK_FREE_REL_SSA, {DestSSARegisterStackLowLevelOperandUsage, - PartialSSARegisterStackSourceLowLevelOperandUsage, DestExprLowLevelOperandUsage, - TopSSARegisterLowLevelOperandUsage}}, - {LLIL_REG_STACK_FREE_ABS_SSA, {DestSSARegisterStackLowLevelOperandUsage, - PartialSSARegisterStackSourceLowLevelOperandUsage, DestRegisterLowLevelOperandUsage}}, - {LLIL_FLAG, {SourceFlagLowLevelOperandUsage}}, - {LLIL_FLAG_BIT, {SourceFlagLowLevelOperandUsage, BitIndexLowLevelOperandUsage}}, - {LLIL_FLAG_SSA, {SourceSSAFlagLowLevelOperandUsage}}, - {LLIL_FLAG_BIT_SSA, {SourceSSAFlagLowLevelOperandUsage, BitIndexLowLevelOperandUsage}}, - {LLIL_JUMP, {DestExprLowLevelOperandUsage}}, - {LLIL_JUMP_TO, {DestExprLowLevelOperandUsage, TargetsLowLevelOperandUsage}}, - {LLIL_CALL, {DestExprLowLevelOperandUsage}}, - {LLIL_CALL_STACK_ADJUST, {DestExprLowLevelOperandUsage, StackAdjustmentLowLevelOperandUsage, - RegisterStackAdjustmentsLowLevelOperandUsage}}, - {LLIL_TAILCALL, {DestExprLowLevelOperandUsage}}, - {LLIL_RET, {DestExprLowLevelOperandUsage}}, - {LLIL_IF, {ConditionExprLowLevelOperandUsage, TrueTargetLowLevelOperandUsage, - FalseTargetLowLevelOperandUsage}}, - {LLIL_GOTO, {TargetLowLevelOperandUsage}}, - {LLIL_FLAG_COND, {FlagConditionLowLevelOperandUsage, SemanticFlagClassLowLevelOperandUsage}}, - {LLIL_FLAG_GROUP, {SemanticFlagGroupLowLevelOperandUsage}}, - {LLIL_TRAP, {VectorLowLevelOperandUsage}}, - {LLIL_CALL_SSA, {OutputSSARegistersLowLevelOperandUsage, OutputMemoryVersionLowLevelOperandUsage, - DestExprLowLevelOperandUsage, StackSSARegisterLowLevelOperandUsage, - StackMemoryVersionLowLevelOperandUsage, ParameterExprsLowLevelOperandUsage}}, - {LLIL_SYSCALL_SSA, {OutputSSARegistersLowLevelOperandUsage, OutputMemoryVersionLowLevelOperandUsage, - StackSSARegisterLowLevelOperandUsage, StackMemoryVersionLowLevelOperandUsage, - ParameterExprsLowLevelOperandUsage}}, - {LLIL_TAILCALL_SSA, {OutputSSARegistersLowLevelOperandUsage, OutputMemoryVersionLowLevelOperandUsage, - DestExprLowLevelOperandUsage, StackSSARegisterLowLevelOperandUsage, - StackMemoryVersionLowLevelOperandUsage, ParameterExprsLowLevelOperandUsage}}, - {LLIL_REG_PHI, {DestSSARegisterLowLevelOperandUsage, SourceSSARegistersLowLevelOperandUsage}}, - {LLIL_REG_STACK_PHI, {DestSSARegisterStackLowLevelOperandUsage, SourceSSARegisterStacksLowLevelOperandUsage}}, - {LLIL_FLAG_PHI, {DestSSAFlagLowLevelOperandUsage, SourceSSAFlagsLowLevelOperandUsage}}, - {LLIL_MEM_PHI, {DestMemoryVersionLowLevelOperandUsage, SourceMemoryVersionsLowLevelOperandUsage}}, - {LLIL_CONST, {ConstantLowLevelOperandUsage}}, - {LLIL_CONST_PTR, {ConstantLowLevelOperandUsage}}, - {LLIL_EXTERN_PTR, {ConstantLowLevelOperandUsage, OffsetLowLevelOperandUsage}}, - {LLIL_FLOAT_CONST, {ConstantLowLevelOperandUsage}}, - {LLIL_ADD, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_SUB, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_AND, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_OR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_XOR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_LSL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_LSR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_ASR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_ROL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_ROR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_MUL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_MULU_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_MULS_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_DIVU, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_DIVS, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_MODU, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_MODS, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_E, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_NE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_SLT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_ULT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_SLE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_ULE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_SGE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_UGE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_SGT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_CMP_UGT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_TEST_BIT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_ADD_OVERFLOW, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_ADC, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, - {LLIL_SBB, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, - {LLIL_RLC, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, - {LLIL_RRC, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, - {LLIL_DIVU_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_DIVS_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_MODU_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_MODS_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_PUSH, {SourceExprLowLevelOperandUsage}}, - {LLIL_NEG, {SourceExprLowLevelOperandUsage}}, - {LLIL_NOT, {SourceExprLowLevelOperandUsage}}, - {LLIL_SX, {SourceExprLowLevelOperandUsage}}, - {LLIL_ZX, {SourceExprLowLevelOperandUsage}}, - {LLIL_LOW_PART, {SourceExprLowLevelOperandUsage}}, - {LLIL_BOOL_TO_INT, {SourceExprLowLevelOperandUsage}}, - {LLIL_INTRINSIC, {OutputRegisterOrFlagListLowLevelOperandUsage, IntrinsicLowLevelOperandUsage, - ParameterExprsLowLevelOperandUsage}}, - {LLIL_INTRINSIC_SSA, {OutputSSARegisterOrFlagListLowLevelOperandUsage, IntrinsicLowLevelOperandUsage, - ParameterExprsLowLevelOperandUsage}}, - {LLIL_UNIMPL_MEM, {SourceExprLowLevelOperandUsage}}, - {LLIL_FADD, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FSUB, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FMUL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FDIV, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FSQRT, {SourceExprLowLevelOperandUsage}}, - {LLIL_FNEG, {SourceExprLowLevelOperandUsage}}, - {LLIL_FABS, {SourceExprLowLevelOperandUsage}}, - {LLIL_FLOAT_TO_INT, {SourceExprLowLevelOperandUsage}}, - {LLIL_INT_TO_FLOAT, {SourceExprLowLevelOperandUsage}}, - {LLIL_FLOAT_CONV, {SourceExprLowLevelOperandUsage}}, - {LLIL_ROUND_TO_INT, {SourceExprLowLevelOperandUsage}}, - {LLIL_FLOOR, {SourceExprLowLevelOperandUsage}}, - {LLIL_CEIL, {SourceExprLowLevelOperandUsage}}, - {LLIL_FTRUNC, {SourceExprLowLevelOperandUsage}}, - {LLIL_FCMP_E, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FCMP_NE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FCMP_LT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FCMP_LE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FCMP_GE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FCMP_GT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, - {LLIL_FCMP_UO, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}} - }; - - -static unordered_map> GetOperandIndexForOperandUsages() +unordered_map LowLevelILInstructionBase::operandTypeForUsage = { + {SourceExprLowLevelOperandUsage, ExprLowLevelOperand}, + {SourceRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, + {SourceRegisterStackLowLevelOperandUsage, RegisterStackLowLevelOperand}, + {SourceFlagLowLevelOperandUsage, FlagLowLevelOperand}, + {SourceSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, + {SourceSSARegisterStackLowLevelOperandUsage, SSARegisterStackLowLevelOperand}, + {SourceSSAFlagLowLevelOperandUsage, SSAFlagLowLevelOperand}, {DestExprLowLevelOperandUsage, ExprLowLevelOperand}, + {DestRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, + {DestRegisterStackLowLevelOperandUsage, RegisterStackLowLevelOperand}, + {DestFlagLowLevelOperandUsage, FlagLowLevelOperand}, + {DestSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, + {DestSSARegisterStackLowLevelOperandUsage, SSARegisterStackLowLevelOperand}, + {DestSSAFlagLowLevelOperandUsage, SSAFlagLowLevelOperand}, + {SemanticFlagClassLowLevelOperandUsage, SemanticFlagClassLowLevelOperand}, + {SemanticFlagGroupLowLevelOperandUsage, SemanticFlagGroupLowLevelOperand}, + {PartialRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, + {PartialSSARegisterStackSourceLowLevelOperandUsage, SSARegisterStackLowLevelOperand}, + {StackSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, + {StackMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, + {TopSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, + {LeftExprLowLevelOperandUsage, ExprLowLevelOperand}, {RightExprLowLevelOperandUsage, ExprLowLevelOperand}, + {CarryExprLowLevelOperandUsage, ExprLowLevelOperand}, {ConditionExprLowLevelOperandUsage, ExprLowLevelOperand}, + {HighRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, + {HighSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, + {LowRegisterLowLevelOperandUsage, RegisterLowLevelOperand}, + {LowSSARegisterLowLevelOperandUsage, SSARegisterLowLevelOperand}, + {IntrinsicLowLevelOperandUsage, IntrinsicLowLevelOperand}, {ConstantLowLevelOperandUsage, IntegerLowLevelOperand}, + {VectorLowLevelOperandUsage, IntegerLowLevelOperand}, {StackAdjustmentLowLevelOperandUsage, IntegerLowLevelOperand}, + {TargetLowLevelOperandUsage, IndexLowLevelOperand}, {TrueTargetLowLevelOperandUsage, IndexLowLevelOperand}, + {FalseTargetLowLevelOperandUsage, IndexLowLevelOperand}, {BitIndexLowLevelOperandUsage, IndexLowLevelOperand}, + {SourceMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, + {DestMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, + {FlagConditionLowLevelOperandUsage, FlagConditionLowLevelOperand}, + {OutputSSARegistersLowLevelOperandUsage, SSARegisterListLowLevelOperand}, + {OutputMemoryVersionLowLevelOperandUsage, IndexLowLevelOperand}, + {ParameterExprsLowLevelOperandUsage, ExprListLowLevelOperand}, + {SourceSSARegistersLowLevelOperandUsage, SSARegisterListLowLevelOperand}, + {SourceSSARegisterStacksLowLevelOperandUsage, SSARegisterStackListLowLevelOperand}, + {SourceSSAFlagsLowLevelOperandUsage, SSAFlagListLowLevelOperand}, + {OutputRegisterOrFlagListLowLevelOperandUsage, RegisterOrFlagListLowLevelOperand}, + {OutputSSARegisterOrFlagListLowLevelOperandUsage, SSARegisterOrFlagListLowLevelOperand}, + {SourceMemoryVersionsLowLevelOperandUsage, IndexListLowLevelOperand}, + {TargetsLowLevelOperandUsage, IndexMapLowLevelOperand}, + {RegisterStackAdjustmentsLowLevelOperandUsage, RegisterStackAdjustmentsLowLevelOperand}}; + + +unordered_map> LowLevelILInstructionBase::operationOperandUsage = + {{LLIL_NOP, {}}, {LLIL_POP, {}}, {LLIL_NORET, {}}, {LLIL_SYSCALL, {}}, {LLIL_BP, {}}, {LLIL_UNDEF, {}}, + {LLIL_UNIMPL, {}}, {LLIL_SET_REG, {DestRegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_REG_SPLIT, + {HighRegisterLowLevelOperandUsage, LowRegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_REG_SSA, {DestSSARegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_REG_SSA_PARTIAL, + {DestSSARegisterLowLevelOperandUsage, PartialRegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_REG_SPLIT_SSA, + {HighSSARegisterLowLevelOperandUsage, LowSSARegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_REG_STACK_REL, + {DestRegisterStackLowLevelOperandUsage, DestExprLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_REG_STACK_PUSH, {DestRegisterStackLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_REG_STACK_REL_SSA, + {DestSSARegisterStackLowLevelOperandUsage, PartialSSARegisterStackSourceLowLevelOperandUsage, + DestExprLowLevelOperandUsage, TopSSARegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_REG_STACK_ABS_SSA, + {DestSSARegisterStackLowLevelOperandUsage, PartialSSARegisterStackSourceLowLevelOperandUsage, + DestRegisterLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_FLAG, {DestFlagLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_SET_FLAG_SSA, {DestSSAFlagLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_LOAD, {SourceExprLowLevelOperandUsage}}, + {LLIL_LOAD_SSA, {SourceExprLowLevelOperandUsage, SourceMemoryVersionLowLevelOperandUsage}}, + {LLIL_STORE, {DestExprLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_STORE_SSA, {DestExprLowLevelOperandUsage, DestMemoryVersionLowLevelOperandUsage, + SourceMemoryVersionLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_REG, {SourceRegisterLowLevelOperandUsage}}, {LLIL_REG_SSA, {SourceSSARegisterLowLevelOperandUsage}}, + {LLIL_REG_SSA_PARTIAL, {SourceSSARegisterLowLevelOperandUsage, PartialRegisterLowLevelOperandUsage}}, + {LLIL_REG_SPLIT, {HighRegisterLowLevelOperandUsage, LowRegisterLowLevelOperandUsage}}, + {LLIL_REG_SPLIT_SSA, {HighSSARegisterLowLevelOperandUsage, LowSSARegisterLowLevelOperandUsage}}, + {LLIL_REG_STACK_REL, {SourceRegisterStackLowLevelOperandUsage, SourceExprLowLevelOperandUsage}}, + {LLIL_REG_STACK_POP, {SourceRegisterStackLowLevelOperandUsage}}, + {LLIL_REG_STACK_FREE_REG, {DestRegisterLowLevelOperandUsage}}, + {LLIL_REG_STACK_FREE_REL, {DestRegisterStackLowLevelOperandUsage, DestExprLowLevelOperandUsage}}, + {LLIL_REG_STACK_REL_SSA, {SourceSSARegisterStackLowLevelOperandUsage, TopSSARegisterLowLevelOperandUsage, + SourceExprLowLevelOperandUsage}}, + {LLIL_REG_STACK_ABS_SSA, {SourceSSARegisterStackLowLevelOperandUsage, SourceRegisterLowLevelOperandUsage}}, + {LLIL_REG_STACK_FREE_REL_SSA, + {DestSSARegisterStackLowLevelOperandUsage, PartialSSARegisterStackSourceLowLevelOperandUsage, + DestExprLowLevelOperandUsage, TopSSARegisterLowLevelOperandUsage}}, + {LLIL_REG_STACK_FREE_ABS_SSA, + {DestSSARegisterStackLowLevelOperandUsage, PartialSSARegisterStackSourceLowLevelOperandUsage, + DestRegisterLowLevelOperandUsage}}, + {LLIL_FLAG, {SourceFlagLowLevelOperandUsage}}, + {LLIL_FLAG_BIT, {SourceFlagLowLevelOperandUsage, BitIndexLowLevelOperandUsage}}, + {LLIL_FLAG_SSA, {SourceSSAFlagLowLevelOperandUsage}}, + {LLIL_FLAG_BIT_SSA, {SourceSSAFlagLowLevelOperandUsage, BitIndexLowLevelOperandUsage}}, + {LLIL_JUMP, {DestExprLowLevelOperandUsage}}, + {LLIL_JUMP_TO, {DestExprLowLevelOperandUsage, TargetsLowLevelOperandUsage}}, + {LLIL_CALL, {DestExprLowLevelOperandUsage}}, + {LLIL_CALL_STACK_ADJUST, {DestExprLowLevelOperandUsage, StackAdjustmentLowLevelOperandUsage, + RegisterStackAdjustmentsLowLevelOperandUsage}}, + {LLIL_TAILCALL, {DestExprLowLevelOperandUsage}}, {LLIL_RET, {DestExprLowLevelOperandUsage}}, + {LLIL_IF, {ConditionExprLowLevelOperandUsage, TrueTargetLowLevelOperandUsage, FalseTargetLowLevelOperandUsage}}, + {LLIL_GOTO, {TargetLowLevelOperandUsage}}, + {LLIL_FLAG_COND, {FlagConditionLowLevelOperandUsage, SemanticFlagClassLowLevelOperandUsage}}, + {LLIL_FLAG_GROUP, {SemanticFlagGroupLowLevelOperandUsage}}, {LLIL_TRAP, {VectorLowLevelOperandUsage}}, + {LLIL_CALL_SSA, {OutputSSARegistersLowLevelOperandUsage, OutputMemoryVersionLowLevelOperandUsage, + DestExprLowLevelOperandUsage, StackSSARegisterLowLevelOperandUsage, + StackMemoryVersionLowLevelOperandUsage, ParameterExprsLowLevelOperandUsage}}, + {LLIL_SYSCALL_SSA, {OutputSSARegistersLowLevelOperandUsage, OutputMemoryVersionLowLevelOperandUsage, + StackSSARegisterLowLevelOperandUsage, StackMemoryVersionLowLevelOperandUsage, + ParameterExprsLowLevelOperandUsage}}, + {LLIL_TAILCALL_SSA, {OutputSSARegistersLowLevelOperandUsage, OutputMemoryVersionLowLevelOperandUsage, + DestExprLowLevelOperandUsage, StackSSARegisterLowLevelOperandUsage, + StackMemoryVersionLowLevelOperandUsage, ParameterExprsLowLevelOperandUsage}}, + {LLIL_REG_PHI, {DestSSARegisterLowLevelOperandUsage, SourceSSARegistersLowLevelOperandUsage}}, + {LLIL_REG_STACK_PHI, {DestSSARegisterStackLowLevelOperandUsage, SourceSSARegisterStacksLowLevelOperandUsage}}, + {LLIL_FLAG_PHI, {DestSSAFlagLowLevelOperandUsage, SourceSSAFlagsLowLevelOperandUsage}}, + {LLIL_MEM_PHI, {DestMemoryVersionLowLevelOperandUsage, SourceMemoryVersionsLowLevelOperandUsage}}, + {LLIL_CONST, {ConstantLowLevelOperandUsage}}, {LLIL_CONST_PTR, {ConstantLowLevelOperandUsage}}, + {LLIL_EXTERN_PTR, {ConstantLowLevelOperandUsage, OffsetLowLevelOperandUsage}}, + {LLIL_FLOAT_CONST, {ConstantLowLevelOperandUsage}}, + {LLIL_ADD, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_SUB, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_AND, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_OR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_XOR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_LSL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_LSR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_ASR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_ROL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_ROR, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_MUL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_MULU_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_MULS_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_DIVU, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_DIVS, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_MODU, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_MODS, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_E, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_NE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_SLT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_ULT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_SLE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_ULE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_SGE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_UGE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_SGT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_CMP_UGT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_TEST_BIT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_ADD_OVERFLOW, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_ADC, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, + {LLIL_SBB, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, + {LLIL_RLC, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, + {LLIL_RRC, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage, CarryExprLowLevelOperandUsage}}, + {LLIL_DIVU_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_DIVS_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_MODU_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_MODS_DP, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_PUSH, {SourceExprLowLevelOperandUsage}}, {LLIL_NEG, {SourceExprLowLevelOperandUsage}}, + {LLIL_NOT, {SourceExprLowLevelOperandUsage}}, {LLIL_SX, {SourceExprLowLevelOperandUsage}}, + {LLIL_ZX, {SourceExprLowLevelOperandUsage}}, {LLIL_LOW_PART, {SourceExprLowLevelOperandUsage}}, + {LLIL_BOOL_TO_INT, {SourceExprLowLevelOperandUsage}}, + {LLIL_INTRINSIC, {OutputRegisterOrFlagListLowLevelOperandUsage, IntrinsicLowLevelOperandUsage, + ParameterExprsLowLevelOperandUsage}}, + {LLIL_INTRINSIC_SSA, {OutputSSARegisterOrFlagListLowLevelOperandUsage, IntrinsicLowLevelOperandUsage, + ParameterExprsLowLevelOperandUsage}}, + {LLIL_UNIMPL_MEM, {SourceExprLowLevelOperandUsage}}, + {LLIL_FADD, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FSUB, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FMUL, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FDIV, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FSQRT, {SourceExprLowLevelOperandUsage}}, {LLIL_FNEG, {SourceExprLowLevelOperandUsage}}, + {LLIL_FABS, {SourceExprLowLevelOperandUsage}}, {LLIL_FLOAT_TO_INT, {SourceExprLowLevelOperandUsage}}, + {LLIL_INT_TO_FLOAT, {SourceExprLowLevelOperandUsage}}, {LLIL_FLOAT_CONV, {SourceExprLowLevelOperandUsage}}, + {LLIL_ROUND_TO_INT, {SourceExprLowLevelOperandUsage}}, {LLIL_FLOOR, {SourceExprLowLevelOperandUsage}}, + {LLIL_CEIL, {SourceExprLowLevelOperandUsage}}, {LLIL_FTRUNC, {SourceExprLowLevelOperandUsage}}, + {LLIL_FCMP_E, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FCMP_NE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FCMP_LT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FCMP_LE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FCMP_GE, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FCMP_GT, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}, + {LLIL_FCMP_UO, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}}}; + + +static unordered_map> + GetOperandIndexForOperandUsages() { unordered_map> result; result.reserve(LowLevelILInstructionBase::operationOperandUsage.size()); @@ -313,22 +285,16 @@ static unordered_map> - LowLevelILInstructionBase::operationOperandIndex = GetOperandIndexForOperandUsages(); + LowLevelILInstructionBase::operationOperandIndex = GetOperandIndexForOperandUsages(); -RegisterOrFlag::RegisterOrFlag(): isFlag(false), index(BN_INVALID_REGISTER) -{ -} +RegisterOrFlag::RegisterOrFlag() : isFlag(false), index(BN_INVALID_REGISTER) {} -RegisterOrFlag::RegisterOrFlag(bool flag, uint32_t i): isFlag(flag), index(i) -{ -} +RegisterOrFlag::RegisterOrFlag(bool flag, uint32_t i) : isFlag(flag), index(i) {} -RegisterOrFlag::RegisterOrFlag(const RegisterOrFlag& v): isFlag(v.isFlag), index(v.index) -{ -} +RegisterOrFlag::RegisterOrFlag(const RegisterOrFlag& v) : isFlag(v.isFlag), index(v.index) {} uint32_t RegisterOrFlag::GetRegister() const @@ -387,19 +353,13 @@ RegisterOrFlag RegisterOrFlag::FromIdentifier(uint64_t id) } -SSARegister::SSARegister(): reg(BN_INVALID_REGISTER), version(0) -{ -} +SSARegister::SSARegister() : reg(BN_INVALID_REGISTER), version(0) {} -SSARegister::SSARegister(const uint32_t r, size_t i): reg(r), version(i) -{ -} +SSARegister::SSARegister(const uint32_t r, size_t i) : reg(r), version(i) {} -SSARegister::SSARegister(const SSARegister& v): reg(v.reg), version(v.version) -{ -} +SSARegister::SSARegister(const SSARegister& v) : reg(v.reg), version(v.version) {} SSARegister& SSARegister::operator=(const SSARegister& v) @@ -434,19 +394,13 @@ bool SSARegister::operator<(const SSARegister& v) const } -SSARegisterStack::SSARegisterStack(): regStack(BN_INVALID_REGISTER), version(0) -{ -} +SSARegisterStack::SSARegisterStack() : regStack(BN_INVALID_REGISTER), version(0) {} -SSARegisterStack::SSARegisterStack(const uint32_t r, size_t i): regStack(r), version(i) -{ -} +SSARegisterStack::SSARegisterStack(const uint32_t r, size_t i) : regStack(r), version(i) {} -SSARegisterStack::SSARegisterStack(const SSARegisterStack& v): regStack(v.regStack), version(v.version) -{ -} +SSARegisterStack::SSARegisterStack(const SSARegisterStack& v) : regStack(v.regStack), version(v.version) {} SSARegisterStack& SSARegisterStack::operator=(const SSARegisterStack& v) @@ -481,19 +435,13 @@ bool SSARegisterStack::operator<(const SSARegisterStack& v) const } -SSAFlag::SSAFlag(): flag(BN_INVALID_REGISTER), version(0) -{ -} +SSAFlag::SSAFlag() : flag(BN_INVALID_REGISTER), version(0) {} -SSAFlag::SSAFlag(const uint32_t f, size_t i): flag(f), version(i) -{ -} +SSAFlag::SSAFlag(const uint32_t f, size_t i) : flag(f), version(i) {} -SSAFlag::SSAFlag(const SSAFlag& v): flag(v.flag), version(v.version) -{ -} +SSAFlag::SSAFlag(const SSAFlag& v) : flag(v.flag), version(v.version) {} SSAFlag& SSAFlag::operator=(const SSAFlag& v) @@ -528,29 +476,19 @@ bool SSAFlag::operator<(const SSAFlag& v) const } -SSARegisterOrFlag::SSARegisterOrFlag(): version(0) -{ -} +SSARegisterOrFlag::SSARegisterOrFlag() : version(0) {} -SSARegisterOrFlag::SSARegisterOrFlag(const RegisterOrFlag& rf, size_t i): regOrFlag(rf), version(i) -{ -} +SSARegisterOrFlag::SSARegisterOrFlag(const RegisterOrFlag& rf, size_t i) : regOrFlag(rf), version(i) {} -SSARegisterOrFlag::SSARegisterOrFlag(const SSARegister& v): regOrFlag(false, v.reg), version(v.version) -{ -} +SSARegisterOrFlag::SSARegisterOrFlag(const SSARegister& v) : regOrFlag(false, v.reg), version(v.version) {} -SSARegisterOrFlag::SSARegisterOrFlag(const SSAFlag& v): regOrFlag(true, v.flag), version(v.version) -{ -} +SSARegisterOrFlag::SSARegisterOrFlag(const SSAFlag& v) : regOrFlag(true, v.flag), version(v.version) {} -SSARegisterOrFlag::SSARegisterOrFlag(const SSARegisterOrFlag& v): regOrFlag(v.regOrFlag), version(v.version) -{ -} +SSARegisterOrFlag::SSARegisterOrFlag(const SSARegisterOrFlag& v) : regOrFlag(v.regOrFlag), version(v.version) {} SSARegisterOrFlag& SSARegisterOrFlag::operator=(const SSARegisterOrFlag& v) @@ -633,8 +571,8 @@ uint64_t LowLevelILIntegerList::ListIterator::operator*() } -LowLevelILIntegerList::LowLevelILIntegerList(LowLevelILFunction* func, -const BNLowLevelILInstruction& instr, size_t count) +LowLevelILIntegerList::LowLevelILIntegerList( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) { m_start.function = func; #ifdef BINARYNINJACORE_LIBRARY @@ -695,10 +633,9 @@ size_t LowLevelILIndexList::ListIterator::operator*() } -LowLevelILIndexList::LowLevelILIndexList(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count): m_list(func, instr, count) -{ -} +LowLevelILIndexList::LowLevelILIndexList(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) : + m_list(func, instr, count) +{} LowLevelILIndexList::const_iterator LowLevelILIndexList::begin() const @@ -753,10 +690,9 @@ const pair LowLevelILIndexMap::ListIterator::operator*() } -LowLevelILIndexMap::LowLevelILIndexMap(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count): m_list(func, instr, count & (~1)) -{ -} +LowLevelILIndexMap::LowLevelILIndexMap(LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) : + m_list(func, instr, count & (~1)) +{} LowLevelILIndexMap::const_iterator LowLevelILIndexMap::begin() const @@ -803,16 +739,16 @@ LowLevelILIndexMap::operator map() const const LowLevelILInstruction LowLevelILInstructionList::ListIterator::operator*() { - return LowLevelILInstruction(pos.GetFunction(), pos.GetFunction()->GetRawExpr((size_t)*pos), - (size_t)*pos, instructionIndex); + return LowLevelILInstruction( + pos.GetFunction(), pos.GetFunction()->GetRawExpr((size_t)*pos), (size_t)*pos, instructionIndex); } -LowLevelILInstructionList::LowLevelILInstructionList(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count, size_t instrIndex): - m_list(func, instr, count), m_instructionIndex(instrIndex) -{ -} +LowLevelILInstructionList::LowLevelILInstructionList( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count, size_t instrIndex) : + m_list(func, instr, count), + m_instructionIndex(instrIndex) +{} LowLevelILInstructionList::const_iterator LowLevelILInstructionList::begin() const @@ -865,10 +801,10 @@ const RegisterOrFlag LowLevelILRegisterOrFlagList::ListIterator::operator*() } -LowLevelILRegisterOrFlagList::LowLevelILRegisterOrFlagList(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count): m_list(func, instr, count) -{ -} +LowLevelILRegisterOrFlagList::LowLevelILRegisterOrFlagList( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) : + m_list(func, instr, count) +{} LowLevelILRegisterOrFlagList::const_iterator LowLevelILRegisterOrFlagList::begin() const @@ -923,10 +859,10 @@ const SSARegister LowLevelILSSARegisterList::ListIterator::operator*() } -LowLevelILSSARegisterList::LowLevelILSSARegisterList(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count): m_list(func, instr, count & (~1)) -{ -} +LowLevelILSSARegisterList::LowLevelILSSARegisterList( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) : + m_list(func, instr, count & (~1)) +{} LowLevelILSSARegisterList::const_iterator LowLevelILSSARegisterList::begin() const @@ -981,10 +917,10 @@ const SSARegisterStack LowLevelILSSARegisterStackList::ListIterator::operator*() } -LowLevelILSSARegisterStackList::LowLevelILSSARegisterStackList(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count): m_list(func, instr, count & (~1)) -{ -} +LowLevelILSSARegisterStackList::LowLevelILSSARegisterStackList( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) : + m_list(func, instr, count & (~1)) +{} LowLevelILSSARegisterStackList::const_iterator LowLevelILSSARegisterStackList::begin() const @@ -1039,10 +975,10 @@ const SSAFlag LowLevelILSSAFlagList::ListIterator::operator*() } -LowLevelILSSAFlagList::LowLevelILSSAFlagList(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count): m_list(func, instr, count & (~1)) -{ -} +LowLevelILSSAFlagList::LowLevelILSSAFlagList( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) : + m_list(func, instr, count & (~1)) +{} LowLevelILSSAFlagList::const_iterator LowLevelILSSAFlagList::begin() const @@ -1097,10 +1033,10 @@ const SSARegisterOrFlag LowLevelILSSARegisterOrFlagList::ListIterator::operator* } -LowLevelILSSARegisterOrFlagList::LowLevelILSSARegisterOrFlagList(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t count): m_list(func, instr, count & (~1)) -{ -} +LowLevelILSSARegisterOrFlagList::LowLevelILSSARegisterOrFlagList( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t count) : + m_list(func, instr, count & (~1)) +{} LowLevelILSSARegisterOrFlagList::const_iterator LowLevelILSSARegisterOrFlagList::begin() const @@ -1145,9 +1081,10 @@ LowLevelILSSARegisterOrFlagList::operator vector() const } -LowLevelILOperand::LowLevelILOperand(const LowLevelILInstruction& instr, - LowLevelILOperandUsage usage, size_t operandIndex): - m_instr(instr), m_usage(usage), m_operandIndex(operandIndex) +LowLevelILOperand::LowLevelILOperand( + const LowLevelILInstruction& instr, LowLevelILOperandUsage usage, size_t operandIndex) : + m_instr(instr), + m_usage(usage), m_operandIndex(operandIndex) { auto i = LowLevelILInstructionBase::operandTypeForUsage.find(m_usage); if (i == LowLevelILInstructionBase::operandTypeForUsage.end()) @@ -1244,8 +1181,8 @@ SSARegister LowLevelILOperand::GetSSARegister() const { if (m_type != SSARegisterLowLevelOperand) throw LowLevelILInstructionAccessException(); - if ((m_usage == HighSSARegisterLowLevelOperandUsage) || (m_usage == LowSSARegisterLowLevelOperandUsage) || - (m_usage == StackSSARegisterLowLevelOperandUsage) || (m_usage == TopSSARegisterLowLevelOperandUsage)) + if ((m_usage == HighSSARegisterLowLevelOperandUsage) || (m_usage == LowSSARegisterLowLevelOperandUsage) + || (m_usage == StackSSARegisterLowLevelOperandUsage) || (m_usage == TopSSARegisterLowLevelOperandUsage)) return m_instr.GetRawOperandAsExpr(m_operandIndex).GetRawOperandAsSSARegister(0); return m_instr.GetRawOperandAsSSARegister(m_operandIndex); } @@ -1356,11 +1293,11 @@ const LowLevelILOperand LowLevelILOperandList::ListIterator::operator*() LowLevelILOperandList::LowLevelILOperandList(const LowLevelILInstruction& 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) +{} LowLevelILOperandList::const_iterator LowLevelILOperandList::begin() const @@ -1419,8 +1356,8 @@ LowLevelILInstruction::LowLevelILInstruction() } -LowLevelILInstruction::LowLevelILInstruction(LowLevelILFunction* func, - const BNLowLevelILInstruction& instr, size_t expr, size_t instrIdx) +LowLevelILInstruction::LowLevelILInstruction( + LowLevelILFunction* func, const BNLowLevelILInstruction& instr, size_t expr, size_t instrIdx) { operation = instr.operation; sourceOperand = instr.sourceOperand; @@ -1492,7 +1429,8 @@ BNLowLevelILFlagCondition LowLevelILInstructionBase::GetRawOperandAsFlagConditio LowLevelILInstruction LowLevelILInstructionBase::GetRawOperandAsExpr(size_t operand) const { - return LowLevelILInstruction(function, function->GetRawExpr(operands[operand]), operands[operand], instructionIndex); + return LowLevelILInstruction( + function, function->GetRawExpr(operands[operand]), operands[operand], instructionIndex); } @@ -1534,8 +1472,8 @@ LowLevelILIndexMap LowLevelILInstructionBase::GetRawOperandAsIndexMap(size_t ope LowLevelILInstructionList LowLevelILInstructionBase::GetRawOperandAsExprList(size_t operand) const { - return LowLevelILInstructionList(function, function->GetRawExpr(operands[operand + 1]), operands[operand], - instructionIndex); + return LowLevelILInstructionList( + function, function->GetRawExpr(operands[operand + 1]), operands[operand], instructionIndex); } @@ -1573,7 +1511,7 @@ map LowLevelILInstructionBase::GetRawOperandAsRegisterStackAd { LowLevelILIntegerList list(function, function->GetRawExpr(operands[operand + 1]), operands[operand]); map result; - for (auto i = list.begin(); i != list.end(); ) + for (auto i = list.begin(); i != list.end();) { uint32_t regStack = (uint32_t)*i; ++i; @@ -1601,8 +1539,8 @@ void LowLevelILInstructionBase::UpdateRawOperandAsSSARegisterList(size_t operand } -void LowLevelILInstructionBase::UpdateRawOperandAsSSARegisterOrFlagList(size_t operandIndex, - const vector& outputs) +void LowLevelILInstructionBase::UpdateRawOperandAsSSARegisterOrFlagList( + size_t operandIndex, const vector& outputs) { UpdateRawOperand(operandIndex, outputs.size() * 2); UpdateRawOperand(operandIndex + 1, function->AddSSARegisterOrFlagList(outputs)); @@ -2004,14 +1942,12 @@ void LowLevelILInstruction::VisitExprs(const std::function& subExprHandler) const +ExprId LowLevelILInstruction::CopyTo( + LowLevelILFunction* dest, const std::function& subExprHandler) const { vector params; BNLowLevelILLabel* labelA; @@ -2021,99 +1957,99 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest, case LLIL_NOP: return dest->Nop(); case LLIL_SET_REG: - return dest->SetRegister(size, GetDestRegister(), - subExprHandler(GetSourceExpr()), flags, *this); + return dest->SetRegister( + size, GetDestRegister(), subExprHandler(GetSourceExpr()), flags, *this); case LLIL_SET_REG_SPLIT: return dest->SetRegisterSplit(size, GetHighRegister(), GetLowRegister(), - subExprHandler(GetSourceExpr()), flags, *this); + subExprHandler(GetSourceExpr()), flags, *this); case LLIL_SET_REG_SSA: - return dest->SetRegisterSSA(size, GetDestSSARegister(), - subExprHandler(GetSourceExpr()), *this); + return dest->SetRegisterSSA( + size, GetDestSSARegister(), subExprHandler(GetSourceExpr()), *this); case LLIL_SET_REG_SSA_PARTIAL: return dest->SetRegisterSSAPartial(size, GetDestSSARegister(), - GetPartialRegister(), - subExprHandler(GetSourceExpr()), *this); + GetPartialRegister(), subExprHandler(GetSourceExpr()), + *this); case LLIL_SET_REG_SPLIT_SSA: return dest->SetRegisterSplitSSA(size, GetHighSSARegister(), - GetLowSSARegister(), - subExprHandler(GetSourceExpr()), *this); + GetLowSSARegister(), subExprHandler(GetSourceExpr()), + *this); case LLIL_SET_REG_STACK_REL: return dest->SetRegisterStackTopRelative(size, GetDestRegisterStack(), - subExprHandler(GetDestExpr()), - subExprHandler(GetSourceExpr()), flags, *this); + subExprHandler(GetDestExpr()), + subExprHandler(GetSourceExpr()), flags, *this); case LLIL_REG_STACK_PUSH: return dest->RegisterStackPush(size, GetDestRegisterStack(), - subExprHandler(GetSourceExpr()), flags, *this); + subExprHandler(GetSourceExpr()), flags, *this); case LLIL_SET_REG_STACK_REL_SSA: - return dest->SetRegisterStackTopRelativeSSA(size, GetDestSSARegisterStack().regStack, - GetDestSSARegisterStack().version, - GetSourceSSARegisterStack().version, - subExprHandler(GetDestExpr()), GetTopSSARegister(), - subExprHandler(GetSourceExpr()), *this); + return dest->SetRegisterStackTopRelativeSSA(size, + GetDestSSARegisterStack().regStack, + GetDestSSARegisterStack().version, + GetSourceSSARegisterStack().version, + subExprHandler(GetDestExpr()), GetTopSSARegister(), + subExprHandler(GetSourceExpr()), *this); case LLIL_SET_REG_STACK_ABS_SSA: return dest->SetRegisterStackAbsoluteSSA(size, GetDestSSARegisterStack().regStack, - GetDestSSARegisterStack().version, - GetSourceSSARegisterStack().version, - GetDestRegister(), - subExprHandler(GetSourceExpr()), *this); + GetDestSSARegisterStack().version, + GetSourceSSARegisterStack().version, + GetDestRegister(), subExprHandler(GetSourceExpr()), + *this); case LLIL_SET_FLAG: return dest->SetFlag(GetDestFlag(), subExprHandler(GetSourceExpr()), *this); case LLIL_SET_FLAG_SSA: - return dest->SetFlagSSA(GetDestSSAFlag(), - subExprHandler(GetSourceExpr()), *this); + return dest->SetFlagSSA( + GetDestSSAFlag(), subExprHandler(GetSourceExpr()), *this); case LLIL_LOAD: return dest->Load(size, subExprHandler(GetSourceExpr()), flags, *this); case LLIL_LOAD_SSA: - return dest->LoadSSA(size, subExprHandler(GetSourceExpr()), - GetSourceMemoryVersion(), *this); + return dest->LoadSSA( + size, subExprHandler(GetSourceExpr()), GetSourceMemoryVersion(), *this); case LLIL_STORE: - return dest->Store(size, subExprHandler(GetDestExpr()), - subExprHandler(GetSourceExpr()), flags, *this); + return dest->Store( + size, subExprHandler(GetDestExpr()), subExprHandler(GetSourceExpr()), flags, *this); case LLIL_STORE_SSA: return dest->StoreSSA(size, subExprHandler(GetDestExpr()), - subExprHandler(GetSourceExpr()), - GetDestMemoryVersion(), GetSourceMemoryVersion(), *this); + subExprHandler(GetSourceExpr()), GetDestMemoryVersion(), + GetSourceMemoryVersion(), *this); case LLIL_REG: return dest->Register(size, GetSourceRegister(), *this); case LLIL_REG_SSA: return dest->RegisterSSA(size, GetSourceSSARegister(), *this); case LLIL_REG_SSA_PARTIAL: - return dest->RegisterSSAPartial(size, GetSourceSSARegister(), - GetPartialRegister(), *this); + return dest->RegisterSSAPartial( + size, GetSourceSSARegister(), GetPartialRegister(), *this); case LLIL_REG_SPLIT: - return dest->RegisterSplit(size, GetHighRegister(), - GetLowRegister(), *this); + return dest->RegisterSplit(size, GetHighRegister(), GetLowRegister(), *this); case LLIL_REG_SPLIT_SSA: - return dest->RegisterSplitSSA(size, GetHighSSARegister(), - GetLowSSARegister(), *this); + return dest->RegisterSplitSSA( + size, GetHighSSARegister(), GetLowSSARegister(), *this); case LLIL_REG_STACK_REL: return dest->RegisterStackTopRelative(size, GetSourceRegisterStack(), - subExprHandler(GetSourceExpr()), *this); + subExprHandler(GetSourceExpr()), *this); case LLIL_REG_STACK_POP: return dest->RegisterStackPop(size, GetSourceRegisterStack(), flags, *this); case LLIL_REG_STACK_FREE_REG: return dest->RegisterStackFreeReg(GetDestRegister(), *this); case LLIL_REG_STACK_FREE_REL: return dest->RegisterStackFreeTopRelative(GetDestRegisterStack(), - subExprHandler(GetDestExpr()), *this); + subExprHandler(GetDestExpr()), *this); case LLIL_REG_STACK_REL_SSA: return dest->RegisterStackTopRelativeSSA(size, GetSourceSSARegisterStack(), - subExprHandler(GetSourceExpr()), - GetTopSSARegister(), *this); + subExprHandler(GetSourceExpr()), GetTopSSARegister(), + *this); case LLIL_REG_STACK_ABS_SSA: return dest->RegisterStackAbsoluteSSA(size, GetSourceSSARegisterStack(), - GetSourceRegister(), *this); + GetSourceRegister(), *this); case LLIL_REG_STACK_FREE_REL_SSA: return dest->RegisterStackFreeTopRelativeSSA(GetDestSSARegisterStack().regStack, - GetDestSSARegisterStack().version, - GetSourceSSARegisterStack().version, - subExprHandler(GetDestExpr()), - GetTopSSARegister(), *this); + GetDestSSARegisterStack().version, + GetSourceSSARegisterStack().version, + subExprHandler(GetDestExpr()), + GetTopSSARegister(), *this); case LLIL_REG_STACK_FREE_ABS_SSA: return dest->RegisterStackFreeAbsoluteSSA(GetDestSSARegisterStack().regStack, - GetDestSSARegisterStack().version, - GetSourceSSARegisterStack().version, - GetDestRegister(), *this); + GetDestSSARegisterStack().version, + GetSourceSSARegisterStack().version, + GetDestRegister(), *this); case LLIL_FLAG: return dest->Flag(GetSourceFlag(), *this); case LLIL_FLAG_SSA: @@ -2128,29 +2064,30 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest, return dest->Call(subExprHandler(GetDestExpr()), *this); case LLIL_CALL_STACK_ADJUST: return dest->CallStackAdjust(subExprHandler(GetDestExpr()), - GetStackAdjustment(), GetRegisterStackAdjustments(), *this); + GetStackAdjustment(), GetRegisterStackAdjustments(), *this); case LLIL_TAILCALL: return dest->TailCall(subExprHandler(GetDestExpr()), *this); case LLIL_RET: return dest->Return(subExprHandler(GetDestExpr()), *this); case LLIL_JUMP_TO: + { + map labelList; + for (auto target : GetTargets()) { - map labelList; - for (auto target : GetTargets()) - { - labelA = dest->GetLabelForSourceInstruction(target.second); - if (!labelA) - return dest->Jump(subExprHandler(GetDestExpr()), *this); - labelList[target.first] = labelA; - } - return dest->JumpTo(subExprHandler(GetDestExpr()), labelList, *this); + labelA = dest->GetLabelForSourceInstruction(target.second); + if (!labelA) + return dest->Jump(subExprHandler(GetDestExpr()), *this); + labelList[target.first] = labelA; } + return dest->JumpTo(subExprHandler(GetDestExpr()), labelList, *this); + } case LLIL_GOTO: labelA = dest->GetLabelForSourceInstruction(GetTarget()); if (!labelA) { return dest->Jump(dest->ConstPointer(function->GetArchitecture()->GetAddressSize(), - function->GetInstruction(GetTarget()).address), *this); + function->GetInstruction(GetTarget()).address), + *this); } return dest->Goto(*labelA, *this); case LLIL_IF: @@ -2169,25 +2106,25 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest, for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); return dest->CallSSA(GetOutputSSARegisters(), subExprHandler(GetDestExpr()), - params, GetStackSSARegister(), GetDestMemoryVersion(), - GetSourceMemoryVersion(), *this); + params, GetStackSSARegister(), GetDestMemoryVersion(), + GetSourceMemoryVersion(), *this); case LLIL_SYSCALL_SSA: for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); - return dest->SystemCallSSA(GetOutputSSARegisters(), - params, GetStackSSARegister(), GetDestMemoryVersion(), - GetSourceMemoryVersion(), *this); + return dest->SystemCallSSA(GetOutputSSARegisters(), params, + GetStackSSARegister(), GetDestMemoryVersion(), + GetSourceMemoryVersion(), *this); case LLIL_TAILCALL_SSA: for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); - return dest->TailCallSSA(GetOutputSSARegisters(), subExprHandler(GetDestExpr()), - params, GetStackSSARegister(), GetDestMemoryVersion(), - GetSourceMemoryVersion(), *this); + return dest->TailCallSSA(GetOutputSSARegisters(), + subExprHandler(GetDestExpr()), params, GetStackSSARegister(), + GetDestMemoryVersion(), GetSourceMemoryVersion(), *this); case LLIL_REG_PHI: return dest->RegisterPhi(GetDestSSARegister(), GetSourceSSARegisters(), *this); case LLIL_REG_STACK_PHI: - return dest->RegisterStackPhi(GetDestSSARegisterStack(), - GetSourceSSARegisterStacks(), *this); + return dest->RegisterStackPhi( + GetDestSSARegisterStack(), GetSourceSSARegisterStacks(), *this); case LLIL_FLAG_PHI: return dest->FlagPhi(GetDestSSAFlag(), GetSourceSSAFlags(), *this); case LLIL_MEM_PHI: @@ -2225,8 +2162,7 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest, case LLIL_FLOOR: case LLIL_CEIL: case LLIL_FTRUNC: - return dest->AddExprWithLocation(operation, *this, size, flags, - subExprHandler(AsOneOperand().GetSourceExpr())); + return dest->AddExprWithLocation(operation, *this, size, flags, subExprHandler(AsOneOperand().GetSourceExpr())); case LLIL_ADD: case LLIL_SUB: case LLIL_AND: @@ -2272,26 +2208,26 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest, case LLIL_FCMP_GT: case LLIL_FCMP_O: case LLIL_FCMP_UO: - return dest->AddExprWithLocation(operation, *this, size, flags, - subExprHandler(AsTwoOperand().GetLeftExpr()), subExprHandler(AsTwoOperand().GetRightExpr())); + return dest->AddExprWithLocation(operation, *this, size, flags, subExprHandler(AsTwoOperand().GetLeftExpr()), + subExprHandler(AsTwoOperand().GetRightExpr())); case LLIL_ADC: case LLIL_SBB: case LLIL_RLC: case LLIL_RRC: return dest->AddExprWithLocation(operation, *this, size, flags, - subExprHandler(AsTwoOperandWithCarry().GetLeftExpr()), - subExprHandler(AsTwoOperandWithCarry().GetRightExpr()), - subExprHandler(AsTwoOperandWithCarry().GetCarryExpr())); + subExprHandler(AsTwoOperandWithCarry().GetLeftExpr()), + subExprHandler(AsTwoOperandWithCarry().GetRightExpr()), + subExprHandler(AsTwoOperandWithCarry().GetCarryExpr())); case LLIL_INTRINSIC: for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); - return dest->Intrinsic(GetOutputRegisterOrFlagList(), GetIntrinsic(), - params, flags, *this); + return dest->Intrinsic( + GetOutputRegisterOrFlagList(), GetIntrinsic(), params, flags, *this); case LLIL_INTRINSIC_SSA: for (auto i : GetParameterExprs()) params.push_back(subExprHandler(i)); - return dest->IntrinsicSSA(GetOutputSSARegisterOrFlagList(), GetIntrinsic(), - params, *this); + return dest->IntrinsicSSA( + GetOutputSSARegisterOrFlagList(), GetIntrinsic(), params, *this); default: throw LowLevelILInstructionAccessException(); } @@ -2764,73 +2700,70 @@ ExprId LowLevelILFunction::Nop(const ILSourceLocation& loc) } -ExprId LowLevelILFunction::SetRegister(size_t size, uint32_t reg, ExprId val, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegister( + size_t size, uint32_t reg, ExprId val, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG, loc, size, flags, reg, val); } -ExprId LowLevelILFunction::SetRegisterSplit(size_t size, uint32_t high, uint32_t low, ExprId val, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegisterSplit( + size_t size, uint32_t high, uint32_t low, ExprId val, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG_SPLIT, loc, size, flags, high, low, val); } -ExprId LowLevelILFunction::SetRegisterSSA(size_t size, const SSARegister& reg, ExprId val, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegisterSSA(size_t size, const SSARegister& reg, ExprId val, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG_SSA, loc, size, 0, reg.reg, reg.version, val); } -ExprId LowLevelILFunction::SetRegisterSSAPartial(size_t size, const SSARegister& fullReg, uint32_t partialReg, - ExprId val, const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegisterSSAPartial( + size_t size, const SSARegister& fullReg, uint32_t partialReg, ExprId val, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG_SSA_PARTIAL, loc, size, 0, fullReg.reg, fullReg.version, partialReg, val); } -ExprId LowLevelILFunction::SetRegisterSplitSSA(size_t size, const SSARegister& high, const SSARegister& low, - ExprId val, const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegisterSplitSSA( + size_t size, const SSARegister& high, const SSARegister& low, ExprId val, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG_SPLIT_SSA, loc, size, 0, - AddExprWithLocation(LLIL_REG_SPLIT_DEST_SSA, loc, size, 0, high.reg, high.version), - AddExprWithLocation(LLIL_REG_SPLIT_DEST_SSA, loc, size, 0, low.reg, low.version), val); + AddExprWithLocation(LLIL_REG_SPLIT_DEST_SSA, loc, size, 0, high.reg, high.version), + AddExprWithLocation(LLIL_REG_SPLIT_DEST_SSA, loc, size, 0, low.reg, low.version), val); } -ExprId LowLevelILFunction::SetRegisterStackTopRelative(size_t size, uint32_t regStack, ExprId entry, - ExprId val, uint32_t flags, const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegisterStackTopRelative( + size_t size, uint32_t regStack, ExprId entry, ExprId val, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG_STACK_REL, loc, size, flags, regStack, entry, val); } -ExprId LowLevelILFunction::RegisterStackPush(size_t size, uint32_t regStack, ExprId val, - uint32_t flags, const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterStackPush( + size_t size, uint32_t regStack, ExprId val, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_STACK_PUSH, loc, size, flags, regStack, val); } -ExprId LowLevelILFunction::SetRegisterStackTopRelativeSSA(size_t size, uint32_t regStack, - size_t destVersion, size_t srcVersion, ExprId entry, const SSARegister& top, - ExprId val, const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegisterStackTopRelativeSSA(size_t size, uint32_t regStack, size_t destVersion, + size_t srcVersion, ExprId entry, const SSARegister& top, ExprId val, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG_STACK_REL_SSA, loc, size, 0, - AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, size, 0, regStack, destVersion, srcVersion), - entry, AddExprWithLocation(LLIL_REG_SSA, loc, 0, 0, top.reg, top.version), val); + AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, size, 0, regStack, destVersion, srcVersion), entry, + AddExprWithLocation(LLIL_REG_SSA, loc, 0, 0, top.reg, top.version), val); } -ExprId LowLevelILFunction::SetRegisterStackAbsoluteSSA(size_t size, uint32_t regStack, - size_t destVersion, size_t srcVersion, uint32_t reg, ExprId val, const ILSourceLocation& loc) +ExprId LowLevelILFunction::SetRegisterStackAbsoluteSSA(size_t size, uint32_t regStack, size_t destVersion, + size_t srcVersion, uint32_t reg, ExprId val, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SET_REG_STACK_ABS_SSA, loc, size, 0, - AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, size, 0, regStack, destVersion, srcVersion), - reg, val); + AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, size, 0, regStack, destVersion, srcVersion), reg, val); } @@ -2852,22 +2785,20 @@ ExprId LowLevelILFunction::Load(size_t size, ExprId addr, uint32_t flags, const } -ExprId LowLevelILFunction::LoadSSA(size_t size, ExprId addr, size_t sourceMemoryVer, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::LoadSSA(size_t size, ExprId addr, size_t sourceMemoryVer, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_LOAD_SSA, loc, size, 0, addr, sourceMemoryVer); } -ExprId LowLevelILFunction::Store(size_t size, ExprId addr, ExprId val, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::Store(size_t size, ExprId addr, ExprId val, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_STORE, loc, size, flags, addr, val); } -ExprId LowLevelILFunction::StoreSSA(size_t size, ExprId addr, ExprId val, size_t newMemoryVer, size_t prevMemoryVer, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::StoreSSA( + size_t size, ExprId addr, ExprId val, size_t newMemoryVer, size_t prevMemoryVer, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_STORE_SSA, loc, size, 0, addr, newMemoryVer, prevMemoryVer, val); } @@ -2891,15 +2822,14 @@ ExprId LowLevelILFunction::Register(size_t size, uint32_t reg, const ILSourceLoc } -ExprId LowLevelILFunction::RegisterSSA(size_t size, const SSARegister& reg, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterSSA(size_t size, const SSARegister& reg, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_SSA, loc, size, 0, reg.reg, reg.version); } -ExprId LowLevelILFunction::RegisterSSAPartial(size_t size, const SSARegister& fullReg, uint32_t partialReg, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterSSAPartial( + size_t size, const SSARegister& fullReg, uint32_t partialReg, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_SSA_PARTIAL, loc, size, 0, fullReg.reg, fullReg.version, partialReg); } @@ -2911,15 +2841,15 @@ ExprId LowLevelILFunction::RegisterSplit(size_t size, uint32_t high, uint32_t lo } -ExprId LowLevelILFunction::RegisterSplitSSA(size_t size, const SSARegister& high, const SSARegister& low, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterSplitSSA( + size_t size, const SSARegister& high, const SSARegister& low, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_SPLIT_SSA, loc, size, 0, high.reg, high.version, low.reg, low.version); } -ExprId LowLevelILFunction::RegisterStackTopRelative(size_t size, uint32_t regStack, ExprId entry, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterStackTopRelative( + size_t size, uint32_t regStack, ExprId entry, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_STACK_REL, loc, size, 0, regStack, entry); } @@ -2943,36 +2873,35 @@ ExprId LowLevelILFunction::RegisterStackFreeTopRelative(uint32_t regStack, ExprI } -ExprId LowLevelILFunction::RegisterStackTopRelativeSSA(size_t size, const SSARegisterStack& regStack, ExprId entry, - const SSARegister& top, const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterStackTopRelativeSSA( + size_t size, const SSARegisterStack& regStack, ExprId entry, const SSARegister& top, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_STACK_REL_SSA, loc, size, 0, regStack.regStack, regStack.version, entry, - AddExprWithLocation(LLIL_REG_SSA, loc, 0, 0, top.reg, top.version)); + AddExprWithLocation(LLIL_REG_SSA, loc, 0, 0, top.reg, top.version)); } -ExprId LowLevelILFunction::RegisterStackAbsoluteSSA(size_t size, const SSARegisterStack& regStack, uint32_t reg, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterStackAbsoluteSSA( + size_t size, const SSARegisterStack& regStack, uint32_t reg, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_STACK_ABS_SSA, loc, size, 0, regStack.regStack, regStack.version, reg); } -ExprId LowLevelILFunction::RegisterStackFreeTopRelativeSSA(uint32_t regStack, - size_t destVersion, size_t srcVersion, ExprId entry, const SSARegister& top, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterStackFreeTopRelativeSSA(uint32_t regStack, size_t destVersion, size_t srcVersion, + ExprId entry, const SSARegister& top, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_STACK_FREE_REL_SSA, loc, 0, 0, - AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, 0, 0, regStack, destVersion, srcVersion), - entry, AddExprWithLocation(LLIL_REG_SSA, loc, 0, 0, top.reg, top.version)); + AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, 0, 0, regStack, destVersion, srcVersion), entry, + AddExprWithLocation(LLIL_REG_SSA, loc, 0, 0, top.reg, top.version)); } -ExprId LowLevelILFunction::RegisterStackFreeAbsoluteSSA(uint32_t regStack, - size_t destVersion, size_t srcVersion, uint32_t reg, const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterStackFreeAbsoluteSSA( + uint32_t regStack, size_t destVersion, size_t srcVersion, uint32_t reg, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_REG_STACK_FREE_ABS_SSA, loc, 0, 0, - AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, 0, 0, regStack, destVersion, srcVersion), reg); + AddExprWithLocation(LLIL_REG_STACK_DEST_SSA, loc, 0, 0, regStack, destVersion, srcVersion), reg); } @@ -3042,8 +2971,7 @@ ExprId LowLevelILFunction::FlagBit(size_t size, uint32_t flag, size_t bitIndex, } -ExprId LowLevelILFunction::FlagBitSSA(size_t size, const SSAFlag& flag, size_t bitIndex, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::FlagBitSSA(size_t size, const SSAFlag& flag, size_t bitIndex, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_FLAG_BIT_SSA, loc, size, 0, flag.flag, flag.version, bitIndex); } @@ -3055,8 +2983,8 @@ ExprId LowLevelILFunction::Add(size_t size, ExprId a, ExprId b, uint32_t flags, } -ExprId LowLevelILFunction::AddCarry(size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::AddCarry( + size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_ADC, loc, size, flags, a, b, carry); } @@ -3068,8 +2996,8 @@ ExprId LowLevelILFunction::Sub(size_t size, ExprId a, ExprId b, uint32_t flags, } -ExprId LowLevelILFunction::SubBorrow(size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::SubBorrow( + size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SBB, loc, size, flags, a, b, carry); } @@ -3093,22 +3021,20 @@ ExprId LowLevelILFunction::Xor(size_t size, ExprId a, ExprId b, uint32_t flags, } -ExprId LowLevelILFunction::ShiftLeft(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::ShiftLeft(size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_LSL, loc, size, flags, a, b); } -ExprId LowLevelILFunction::LogicalShiftRight(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::LogicalShiftRight( + size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_LSR, loc, size, flags, a, b); } -ExprId LowLevelILFunction::ArithShiftRight(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::ArithShiftRight(size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_ASR, loc, size, flags, a, b); } @@ -3120,8 +3046,8 @@ ExprId LowLevelILFunction::RotateLeft(size_t size, ExprId a, ExprId b, uint32_t } -ExprId LowLevelILFunction::RotateLeftCarry(size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RotateLeftCarry( + size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_RLC, loc, size, flags, a, b, carry); } @@ -3133,8 +3059,8 @@ ExprId LowLevelILFunction::RotateRight(size_t size, ExprId a, ExprId b, uint32_t } -ExprId LowLevelILFunction::RotateRightCarry(size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RotateRightCarry( + size_t size, ExprId a, ExprId b, ExprId carry, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_RRC, loc, size, flags, a, b, carry); } @@ -3146,29 +3072,28 @@ ExprId LowLevelILFunction::Mult(size_t size, ExprId a, ExprId b, uint32_t flags, } -ExprId LowLevelILFunction::MultDoublePrecUnsigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::MultDoublePrecUnsigned( + size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_MULU_DP, loc, size, flags, a, b); } -ExprId LowLevelILFunction::MultDoublePrecSigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::MultDoublePrecSigned( + size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_MULS_DP, loc, size, flags, a, b); } -ExprId LowLevelILFunction::DivUnsigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::DivUnsigned(size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_DIVU, loc, size, flags, a, b); } -ExprId LowLevelILFunction::DivDoublePrecUnsigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::DivDoublePrecUnsigned( + size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_DIVU_DP, loc, size, flags, a, b); } @@ -3180,22 +3105,21 @@ ExprId LowLevelILFunction::DivSigned(size_t size, ExprId a, ExprId b, uint32_t f } -ExprId LowLevelILFunction::DivDoublePrecSigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::DivDoublePrecSigned( + size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_DIVS_DP, loc, size, flags, a, b); } -ExprId LowLevelILFunction::ModUnsigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::ModUnsigned(size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_MODU, loc, size, flags, a, b); } -ExprId LowLevelILFunction::ModDoublePrecUnsigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::ModDoublePrecUnsigned( + size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_MODU_DP, loc, size, flags, a, b); } @@ -3207,8 +3131,8 @@ ExprId LowLevelILFunction::ModSigned(size_t size, ExprId a, ExprId b, uint32_t f } -ExprId LowLevelILFunction::ModDoublePrecSigned(size_t size, ExprId a, ExprId b, uint32_t flags, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::ModDoublePrecSigned( + size_t size, ExprId a, ExprId b, uint32_t flags, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_MODS_DP, loc, size, flags, a, b); } @@ -3250,8 +3174,8 @@ ExprId LowLevelILFunction::Jump(ExprId dest, const ILSourceLocation& loc) } -ExprId LowLevelILFunction::JumpTo(ExprId dest, const map& targets, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::JumpTo( + ExprId dest, const map& targets, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_JUMP_TO, loc, 0, 0, dest, targets.size() * 2, AddLabelMap(targets)); } @@ -3263,8 +3187,8 @@ ExprId LowLevelILFunction::Call(ExprId dest, const ILSourceLocation& loc) } -ExprId LowLevelILFunction::CallStackAdjust(ExprId dest, int64_t adjust, - const map& regStackAdjust, const ILSourceLocation& loc) +ExprId LowLevelILFunction::CallStackAdjust( + ExprId dest, int64_t adjust, const map& regStackAdjust, const ILSourceLocation& loc) { vector list; for (auto& i : regStackAdjust) @@ -3272,8 +3196,7 @@ ExprId LowLevelILFunction::CallStackAdjust(ExprId dest, int64_t adjust, list.push_back(i.first); list.push_back(i.second); } - return AddExprWithLocation(LLIL_CALL_STACK_ADJUST, loc, 0, 0, dest, adjust, list.size(), - AddIndexList(list)); + return AddExprWithLocation(LLIL_CALL_STACK_ADJUST, loc, 0, 0, dest, adjust, list.size(), AddIndexList(list)); } @@ -3284,38 +3207,35 @@ ExprId LowLevelILFunction::TailCall(ExprId dest, const ILSourceLocation& loc) ExprId LowLevelILFunction::CallSSA(const vector& output, ExprId dest, const vector& params, - const SSARegister& stack, size_t newMemoryVer, size_t prevMemoryVer, const ILSourceLocation& loc) + const SSARegister& stack, size_t newMemoryVer, size_t prevMemoryVer, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_CALL_SSA, loc, 0, 0, - AddExprWithLocation(LLIL_CALL_OUTPUT_SSA, loc, 0, 0, newMemoryVer, - output.size() * 2, AddSSARegisterList(output)), dest, - AddExprWithLocation(LLIL_CALL_STACK_SSA, loc, 0, 0, stack.reg, stack.version, prevMemoryVer), - AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, - params.size(), AddOperandList(params))); + AddExprWithLocation( + LLIL_CALL_OUTPUT_SSA, loc, 0, 0, newMemoryVer, output.size() * 2, AddSSARegisterList(output)), + dest, AddExprWithLocation(LLIL_CALL_STACK_SSA, loc, 0, 0, stack.reg, stack.version, prevMemoryVer), + AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); } ExprId LowLevelILFunction::SystemCallSSA(const vector& output, const vector& params, - const SSARegister& stack, size_t newMemoryVer, size_t prevMemoryVer, const ILSourceLocation& loc) + const SSARegister& stack, size_t newMemoryVer, size_t prevMemoryVer, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_SYSCALL_SSA, loc, 0, 0, - AddExprWithLocation(LLIL_CALL_OUTPUT_SSA, loc, 0, 0, newMemoryVer, - output.size() * 2, AddSSARegisterList(output)), - AddExprWithLocation(LLIL_CALL_STACK_SSA, loc, 0, 0, stack.reg, stack.version, prevMemoryVer), - AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, - params.size(), AddOperandList(params))); + AddExprWithLocation( + LLIL_CALL_OUTPUT_SSA, loc, 0, 0, newMemoryVer, output.size() * 2, AddSSARegisterList(output)), + AddExprWithLocation(LLIL_CALL_STACK_SSA, loc, 0, 0, stack.reg, stack.version, prevMemoryVer), + AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); } ExprId LowLevelILFunction::TailCallSSA(const vector& output, ExprId dest, const vector& params, - const SSARegister& stack, size_t newMemoryVer, size_t prevMemoryVer, const ILSourceLocation& loc) + const SSARegister& stack, size_t newMemoryVer, size_t prevMemoryVer, const ILSourceLocation& loc) { return AddExprWithLocation(LLIL_TAILCALL_SSA, loc, 0, 0, - AddExprWithLocation(LLIL_CALL_OUTPUT_SSA, loc, 0, 0, newMemoryVer, - output.size() * 2, AddSSARegisterList(output)), dest, - AddExprWithLocation(LLIL_CALL_STACK_SSA, loc, 0, 0, stack.reg, stack.version, prevMemoryVer), - AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, - params.size(), AddOperandList(params))); + AddExprWithLocation( + LLIL_CALL_OUTPUT_SSA, loc, 0, 0, newMemoryVer, output.size() * 2, AddSSARegisterList(output)), + dest, AddExprWithLocation(LLIL_CALL_STACK_SSA, loc, 0, 0, stack.reg, stack.version, prevMemoryVer), + AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); } @@ -3422,20 +3342,18 @@ ExprId LowLevelILFunction::SystemCall(const ILSourceLocation& loc) ExprId LowLevelILFunction::Intrinsic(const vector& outputs, uint32_t intrinsic, - const vector& params, uint32_t flags, const ILSourceLocation& loc) + const vector& params, uint32_t flags, const ILSourceLocation& loc) { - return AddExprWithLocation(LLIL_INTRINSIC, loc, 0, flags, - outputs.size(), AddRegisterOrFlagList(outputs), intrinsic, - AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); + return AddExprWithLocation(LLIL_INTRINSIC, loc, 0, flags, outputs.size(), AddRegisterOrFlagList(outputs), intrinsic, + AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); } ExprId LowLevelILFunction::IntrinsicSSA(const vector& outputs, uint32_t intrinsic, - const vector& params, const ILSourceLocation& loc) + const vector& params, const ILSourceLocation& loc) { - return AddExprWithLocation(LLIL_INTRINSIC_SSA, loc, 0, 0, - outputs.size() * 2, AddSSARegisterOrFlagList(outputs), intrinsic, - AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); + return AddExprWithLocation(LLIL_INTRINSIC_SSA, loc, 0, 0, outputs.size() * 2, AddSSARegisterOrFlagList(outputs), + intrinsic, AddExprWithLocation(LLIL_CALL_PARAM, loc, 0, 0, params.size(), AddOperandList(params))); } @@ -3469,27 +3387,26 @@ ExprId LowLevelILFunction::UnimplementedMemoryRef(size_t size, ExprId addr, cons } -ExprId LowLevelILFunction::RegisterPhi(const SSARegister& dest, const vector& sources, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterPhi( + const SSARegister& dest, const vector& sources, const ILSourceLocation& loc) { - return AddExprWithLocation(LLIL_REG_PHI, loc, 0, 0, dest.reg, dest.version, - sources.size() * 2, AddSSARegisterList(sources)); + return AddExprWithLocation( + LLIL_REG_PHI, loc, 0, 0, dest.reg, dest.version, sources.size() * 2, AddSSARegisterList(sources)); } -ExprId LowLevelILFunction::RegisterStackPhi(const SSARegisterStack& dest, const vector& sources, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::RegisterStackPhi( + const SSARegisterStack& dest, const vector& sources, const ILSourceLocation& loc) { - return AddExprWithLocation(LLIL_REG_STACK_PHI, loc, 0, 0, dest.regStack, dest.version, - sources.size() * 2, AddSSARegisterStackList(sources)); + return AddExprWithLocation(LLIL_REG_STACK_PHI, loc, 0, 0, dest.regStack, dest.version, sources.size() * 2, + AddSSARegisterStackList(sources)); } -ExprId LowLevelILFunction::FlagPhi(const SSAFlag& dest, const vector& sources, - const ILSourceLocation& loc) +ExprId LowLevelILFunction::FlagPhi(const SSAFlag& dest, const vector& sources, const ILSourceLocation& loc) { - return AddExprWithLocation(LLIL_FLAG_PHI, loc, 0, 0, dest.flag, dest.version, - sources.size() * 2, AddSSAFlagList(sources)); + return AddExprWithLocation( + LLIL_FLAG_PHI, loc, 0, 0, dest.flag, dest.version, sources.size() * 2, AddSSAFlagList(sources)); } -- cgit v1.3.1