diff options
| author | Peter LaFosse <peter@vector35.com> | 2018-10-17 17:37:15 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2018-10-19 10:05:09 -0400 |
| commit | 4bb4a2016d90176938bc8737fd9f29e2d6ea2737 (patch) | |
| tree | c3a4f4573fbceafd1eb07cf0a7beaea528c79d83 /binaryninjaapi.h | |
| parent | 8de8bad6f2f5517d858568a9871dd99f7e8d5d4b (diff) | |
Expose DataRender APIs, allow setting const on types, and allow type comparison
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 2b3273a8..958697c7 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -2185,6 +2185,9 @@ namespace BinaryNinja public: Type(BNType* type); + bool operator==(const Type& other); + bool operator!=(const Type& other); + BNTypeClass GetClass() const; uint64_t GetWidth() const; size_t GetAlignment() const; @@ -2209,6 +2212,7 @@ namespace BinaryNinja void SetVolatile(const Confidence<bool>& vltl); void SetTypeName(const QualifiedName& name); Confidence<int64_t> GetStackAdjustment() const; + QualifiedName GetStructureName() const; uint64_t GetElementCount() const; uint64_t GetOffset() const; @@ -4324,4 +4328,30 @@ namespace BinaryNinja bool IsArray() const; bool IsKeyValueStore() const; }; + + class DataRenderer: public CoreRefCountObject<BNDataRenderer, BNNewDataRendererReference, BNFreeDataRenderer> + { + static bool IsValidForDataCallback(void* ctxt, BNBinaryView* data, uint64_t addr, BNType* type, + BNType** typeCtx, size_t ctxCount); + static BNDisassemblyTextLine* GetLinesForDataCallback(void* ctxt, BNBinaryView* data, uint64_t addr, BNType* type, + const BNInstructionTextToken* prefix, size_t prefixCount, size_t width, size_t* count, BNType** typeCxt, + size_t ctxCount); + static void FreeCallback(void* ctxt); + public: + DataRenderer(); + DataRenderer(BNDataRenderer* renderer); + virtual bool IsValidForData(BinaryView* data, uint64_t addr, Type* type, std::vector<Type*>& context); + virtual std::vector<DisassemblyTextLine> GetLinesForData(BinaryView* data, uint64_t addr, Type* type, + const std::vector<InstructionTextToken>& prefix, size_t width, std::vector<Type*>& context); + + static bool IsStructOfTypeName(Type* type, const QualifiedName& name, std::vector<Type*>& context); + static bool IsStructOfTypeName(Type* type, const std::string& name, std::vector<Type*>& context); + }; + + class DataRendererContainer + { + public: + static void RegisterGenericDataRenderer(DataRenderer* renderer); + static void RegisterTypeSpecificDataRenderer(DataRenderer* renderer); + }; } |
