From 052b1ea7871c3bfd780a73bcac942db54c95422e Mon Sep 17 00:00:00 2001 From: Peter LaFosse Date: Thu, 19 Sep 2019 17:31:44 -0400 Subject: Tag notifications & tag type list optimized --- binaryninjaapi.h | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 0a775ac8..1728774d 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -908,6 +908,8 @@ namespace BinaryNinja struct DataVariable; class Symbol; class Tag; + class TagType; + struct TagReference; class BinaryDataNotification { @@ -928,6 +930,10 @@ namespace BinaryNinja static void SymbolUpdatedCallback(void* ctxt, BNBinaryView* view, BNSymbol* sym); static void SymbolRemovedCallback(void* ctxt, BNBinaryView* view, BNSymbol* sym); static void DataMetadataUpdatedCallback(void* ctxt, BNBinaryView* object, uint64_t offset); + static void TagTypeUpdatedCallback(void* ctxt, BNBinaryView* object, BNTagType* tagType); + static void TagAddedCallback(void* ctxt, BNBinaryView* object, BNTagReference* tagRef); + static void TagUpdatedCallback(void* ctxt, BNBinaryView* object, BNTagReference* tagRef); + static void TagRemovedCallback(void* ctxt, BNBinaryView* object, BNTagReference* tagRef); static void StringFoundCallback(void* ctxt, BNBinaryView* data, BNStringType type, uint64_t offset, size_t len); static void StringRemovedCallback(void* ctxt, BNBinaryView* data, BNStringType type, uint64_t offset, size_t len); static void TypeDefinedCallback(void* ctxt, BNBinaryView* data, BNQualifiedName* name, BNType* type); @@ -950,6 +956,10 @@ namespace BinaryNinja virtual void OnDataVariableRemoved(BinaryView* view, const DataVariable& var) { (void)view; (void)var; } virtual void OnDataVariableUpdated(BinaryView* view, const DataVariable& var) { (void)view; (void)var; } virtual void OnDataMetadataUpdated(BinaryView* view, uint64_t offset) { (void)view; (void)offset; } + virtual void OnTagTypeUpdated(BinaryView* view, Ref tagTypeRef) { (void)view; (void)tagTypeRef; } + virtual void OnTagAdded(BinaryView* view, const TagReference& tagRef) { (void)view; (void)tagRef; } + virtual void OnTagUpdated(BinaryView* view, const TagReference& tagRef) { (void)view; (void)tagRef; } + virtual void OnTagRemoved(BinaryView* view, const TagReference& tagRef) { (void)view; (void)tagRef; } virtual void OnSymbolAdded(BinaryView* view, Symbol* sym) { (void)view; (void)sym; } virtual void OnSymbolUpdated(BinaryView* view, Symbol* sym) { (void)view; (void)sym; } virtual void OnSymbolRemoved(BinaryView* view, Symbol* sym) { (void)view; (void)sym; } @@ -1559,8 +1569,8 @@ namespace BinaryNinja Ref GetTagType(const std::string& name, TagType::Type type); std::vector> GetTagTypes(); - void AddTag(Ref tag); - void RemoveTag(Ref tag); + void AddTag(Ref tag, bool user = false); + void RemoveTag(Ref tag, bool user = false); Ref GetTag(uint64_t tagId); std::vector GetAllTagReferences(); @@ -1569,6 +1579,9 @@ namespace BinaryNinja std::vector GetAllTagReferencesOfType(Ref tagType); std::vector GetTagReferencesOfType(Ref tagType); + size_t GetTagReferencesOfTypeCount(Ref tagType); + size_t GetAllTagReferencesOfTypeCount(Ref tagType); + std::vector GetDataTagReferences(); std::vector> GetDataTags(uint64_t addr); std::vector> GetDataTagsOfType(uint64_t addr, Ref tagType); @@ -2880,6 +2893,7 @@ namespace BinaryNinja std::vector GetAllTagReferences(); std::vector GetTagReferencesOfType(Ref tagType); + size_t GetTagReferencesOfTypeCount(Ref tagType); std::vector GetAddressTagReferences(); std::vector> GetAddressTags(Architecture* arch, uint64_t addr); -- cgit v1.3.1