From 00fc6c96d415bd31ee5ecbec70a8e4de141674cd Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Thu, 16 Aug 2018 22:30:15 -0400 Subject: Adding EXTERN_PTR type --- lowlevelilinstruction.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lowlevelilinstruction.h') diff --git a/lowlevelilinstruction.h b/lowlevelilinstruction.h index 2d1429c9..09cae9f4 100644 --- a/lowlevelilinstruction.h +++ b/lowlevelilinstruction.h @@ -218,7 +218,8 @@ namespace BinaryNinja OutputSSARegisterOrFlagListLowLevelOperandUsage, SourceMemoryVersionsLowLevelOperandUsage, TargetListLowLevelOperandUsage, - RegisterStackAdjustmentsLowLevelOperandUsage + RegisterStackAdjustmentsLowLevelOperandUsage, + OffsetLowLevelOperandUsage }; } @@ -711,6 +712,7 @@ namespace BinaryNinja template SSARegister GetLowSSARegister() const { return As().GetLowSSARegister(); } template uint32_t GetIntrinsic() const { return As().GetIntrinsic(); } template int64_t GetConstant() const { return As().GetConstant(); } + template uint64_t GetOffset() const { return As().GetOffset(); } template int64_t GetVector() const { return As().GetVector(); } template size_t GetStackAdjustment() const { return As().GetStackAdjustment(); } template size_t GetTarget() const { return As().GetTarget(); } @@ -775,6 +777,7 @@ namespace BinaryNinja SSARegister GetLowSSARegister() const; uint32_t GetIntrinsic() const; int64_t GetConstant() const; + uint64_t GetOffset() const; int64_t GetVector() const; size_t GetStackAdjustment() const; size_t GetTarget() const; @@ -870,6 +873,11 @@ namespace BinaryNinja int64_t GetConstant() const { return GetRawOperandAsInteger(0); } }; + struct LowLevelILOffsetInstruction: public LowLevelILInstructionBase + { + int64_t GetOffset() const { return GetRawOperandAsInteger(1); } + }; + struct LowLevelILOneOperandInstruction: public LowLevelILInstructionBase { LowLevelILInstruction GetSourceExpr() const { return GetRawOperandAsExpr(0); } @@ -1216,6 +1224,12 @@ namespace BinaryNinja LowLevelILIndexList GetSourceMemoryVersions() const { return GetRawOperandAsIndexList(1); } }; + template <> struct LowLevelILInstructionAccessor: public LowLevelILConstantInstruction + { + size_t GetConstant() const { return GetRawOperandAsIndex(0); } + size_t GetOffset() const { return GetRawOperandAsIndex(1); } + }; + template <> struct LowLevelILInstructionAccessor: public LowLevelILInstructionBase {}; template <> struct LowLevelILInstructionAccessor: public LowLevelILInstructionBase {}; template <> struct LowLevelILInstructionAccessor: public LowLevelILInstructionBase {}; @@ -1226,7 +1240,6 @@ namespace BinaryNinja template <> struct LowLevelILInstructionAccessor: public LowLevelILConstantInstruction {}; template <> struct LowLevelILInstructionAccessor: public LowLevelILConstantInstruction {}; - template <> struct LowLevelILInstructionAccessor: public LowLevelILConstantInstruction {}; template <> struct LowLevelILInstructionAccessor: public LowLevelILConstantInstruction {}; template <> struct LowLevelILInstructionAccessor: public LowLevelILTwoOperandInstruction {}; -- cgit v1.3.1