diff options
Diffstat (limited to 'lowlevelil.cpp')
| -rw-r--r-- | lowlevelil.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/lowlevelil.cpp b/lowlevelil.cpp index 5e985a8e..91db6ab3 100644 --- a/lowlevelil.cpp +++ b/lowlevelil.cpp @@ -217,6 +217,17 @@ ExprId LowLevelILFunction::AddIndexList(const vector<size_t> operands) } +ExprId LowLevelILFunction::AddRegisterOrFlagList(const vector<RegisterOrFlag>& regs) +{ + uint64_t* operandList = new uint64_t[regs.size()]; + for (size_t i = 0; i < regs.size(); i++) + operandList[i] = regs[i].ToIdentifier(); + ExprId result = (ExprId)BNLowLevelILAddOperandList(m_object, operandList, regs.size()); + delete[] operandList; + return result; +} + + ExprId LowLevelILFunction::AddSSARegisterList(const vector<SSARegister>& regs) { uint64_t* operandList = new uint64_t[regs.size() * 2]; @@ -231,6 +242,20 @@ ExprId LowLevelILFunction::AddSSARegisterList(const vector<SSARegister>& regs) } +ExprId LowLevelILFunction::AddSSARegisterStackList(const vector<SSARegisterStack>& regStacks) +{ + uint64_t* operandList = new uint64_t[regStacks.size() * 2]; + for (size_t i = 0; i < regStacks.size(); i++) + { + operandList[i * 2] = regStacks[i].regStack; + operandList[(i * 2) + 1] = regStacks[i].version; + } + ExprId result = (ExprId)BNLowLevelILAddOperandList(m_object, operandList, regStacks.size() * 2); + delete[] operandList; + return result; +} + + ExprId LowLevelILFunction::AddSSAFlagList(const vector<SSAFlag>& flags) { uint64_t* operandList = new uint64_t[flags.size() * 2]; @@ -245,6 +270,20 @@ ExprId LowLevelILFunction::AddSSAFlagList(const vector<SSAFlag>& flags) } +ExprId LowLevelILFunction::AddSSARegisterOrFlagList(const vector<SSARegisterOrFlag>& regs) +{ + uint64_t* operandList = new uint64_t[regs.size() * 2]; + for (size_t i = 0; i < regs.size(); i++) + { + operandList[i * 2] = regs[i].regOrFlag.ToIdentifier(); + operandList[(i * 2) + 1] = regs[i].version; + } + ExprId result = (ExprId)BNLowLevelILAddOperandList(m_object, operandList, regs.size() * 2); + delete[] operandList; + return result; +} + + ExprId LowLevelILFunction::GetExprForRegisterOrConstant(const BNRegisterOrConstant& operand, size_t size) { if (operand.constant) |
