summaryrefslogtreecommitdiff
path: root/lowlevelilinstruction.cpp
diff options
context:
space:
mode:
authorPeter LaFosse <peter@vector35.com>2018-08-16 22:30:15 -0400
committerPeter LaFosse <peter@vector35.com>2018-08-16 22:30:15 -0400
commit00fc6c96d415bd31ee5ecbec70a8e4de141674cd (patch)
tree0a6ed958eb313fa54727fb8bc0d3afdcef4d83cd /lowlevelilinstruction.cpp
parent1ce780cd6a66a289b0422298871d61392ad3ec2a (diff)
Adding EXTERN_PTR type
Diffstat (limited to 'lowlevelilinstruction.cpp')
-rw-r--r--lowlevelilinstruction.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/lowlevelilinstruction.cpp b/lowlevelilinstruction.cpp
index 4e0901f3..1522596b 100644
--- a/lowlevelilinstruction.cpp
+++ b/lowlevelilinstruction.cpp
@@ -171,7 +171,7 @@ unordered_map<BNLowLevelILOperation, vector<LowLevelILOperandUsage>>
{LLIL_MEM_PHI, {DestMemoryVersionLowLevelOperandUsage, SourceMemoryVersionsLowLevelOperandUsage}},
{LLIL_CONST, {ConstantLowLevelOperandUsage}},
{LLIL_CONST_PTR, {ConstantLowLevelOperandUsage}},
- {LLIL_RELOC_PTR, {ConstantLowLevelOperandUsage}},
+ {LLIL_EXTERN_PTR, {ConstantLowLevelOperandUsage, OffsetLowLevelOperandUsage}},
{LLIL_FLOAT_CONST, {ConstantLowLevelOperandUsage}},
{LLIL_ADD, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}},
{LLIL_SUB, {LeftExprLowLevelOperandUsage, RightExprLowLevelOperandUsage}},
@@ -2114,8 +2114,8 @@ ExprId LowLevelILInstruction::CopyTo(LowLevelILFunction* dest,
return dest->Const(size, GetConstant<LLIL_CONST>(), *this);
case LLIL_CONST_PTR:
return dest->ConstPointer(size, GetConstant<LLIL_CONST_PTR>(), *this);
- case LLIL_RELOC_PTR:
- return dest->ConstPointer(size, GetConstant<LLIL_RELOC_PTR>(), *this);
+ case LLIL_EXTERN_PTR:
+ return dest->ExternPointer(size, GetConstant<LLIL_EXTERN_PTR>(), GetOffset<LLIL_EXTERN_PTR>(), *this);
case LLIL_FLOAT_CONST:
return dest->FloatConstRaw(size, GetConstant<LLIL_FLOAT_CONST>(), *this);
case LLIL_POP:
@@ -2492,6 +2492,15 @@ int64_t LowLevelILInstruction::GetConstant() const
}
+uint64_t LowLevelILInstruction::GetOffset() const
+{
+ size_t operandIndex;
+ if (GetOperandIndexForUsage(OffsetLowLevelOperandUsage, operandIndex))
+ return GetRawOperandAsInteger(operandIndex);
+ throw LowLevelILInstructionAccessException();
+}
+
+
int64_t LowLevelILInstruction::GetVector() const
{
size_t operandIndex;
@@ -2897,9 +2906,9 @@ ExprId LowLevelILFunction::ConstPointer(size_t size, uint64_t val, const ILSourc
}
-ExprId LowLevelILFunction::RelocationPointer(size_t size, uint64_t val, const ILSourceLocation& loc)
+ExprId LowLevelILFunction::ExternPointer(size_t size, uint64_t val, uint64_t offset, const ILSourceLocation& loc)
{
- return AddExprWithLocation(LLIL_RELOC_PTR, loc, size, 0, val);
+ return AddExprWithLocation(LLIL_EXTERN_PTR, loc, size, 0, val, offset);
}