From fe925b01df7934785aa5dc67d23c577f13ad42e6 Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Sun, 26 Aug 2018 15:31:12 -0400 Subject: Add support for new constant type EXTERN_PTR --- binaryninjaapi.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 7b1e31ff..b6d41825 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2417,6 +2417,7 @@ namespace BinaryNinja { BNRegisterValueType state; int64_t value; + int64_t offset; RegisterValue(); static RegisterValue FromAPIObject(const BNRegisterValue& value); @@ -2427,6 +2428,7 @@ namespace BinaryNinja { BNRegisterValueType state; int64_t value; + int64_t offset; std::vector ranges; std::set valueSet; std::vector table; @@ -3421,27 +3423,30 @@ namespace BinaryNinja BNRelocationInfo* result, size_t resultCount); static bool ApplyRelocationCallback(void* ctxt, BNBinaryView* view, BNArchitecture* arch, BNRelocation* reloc, uint8_t* dest, size_t len); - + static size_t GetOperandForExternalRelocationCallback(void* ctxt, const uint8_t* data, uint64_t addr, + size_t length, BNLowLevelILFunction* il, BNRelocation* relocation); protected: RelocationHandler(); RelocationHandler(BNRelocationHandler* handler); static void FreeCallback(void* ctxt); public: - virtual bool GetRelocationInfo(Ref view, Ref arch, std::vector& result); virtual bool ApplyRelocation(Ref view, Ref arch, Ref reloc, uint8_t* dest, size_t len); + virtual size_t GetOperandForExternalRelocation(const uint8_t* data, uint64_t addr, size_t length, + Ref il, Ref relocation); }; class CoreRelocationHandler: public RelocationHandler { public: CoreRelocationHandler(BNRelocationHandler* handler); - virtual bool GetRelocationInfo(Ref view, Ref arch, std::vector& result) override; virtual bool ApplyRelocation(Ref view, Ref arch, Ref reloc, uint8_t* dest, size_t len) override; + virtual size_t GetOperandForExternalRelocation(const uint8_t* data, uint64_t addr, size_t length, + Ref il, Ref relocation) override; }; class UpdateException: public std::exception -- cgit v1.3.1