diff options
| author | Peter LaFosse <peter@vector35.com> | 2017-07-12 16:04:28 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2017-07-12 16:04:42 -0400 |
| commit | 3d3b803d18f0d61b5e36367c9eb660b234cdc66e (patch) | |
| tree | 1d64b9c63997d6514bc86b12f26c5891a07287c9 /binaryninjaapi.h | |
| parent | 00961d39ab43a1476b449b858d00f8e43f0928cd (diff) | |
Metadata enhancements. Metadata objects are now serialized to the DB
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index f5850ad0..83f6b582 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -876,7 +876,7 @@ namespace BinaryNinja \param dest the address to write len number of bytes. \param offset the virtual offset to find and read len bytes from - ....\param len the number of bytes to read from offset and write to dest + \param len the number of bytes to read from offset and write to dest */ virtual size_t PerformRead(void* dest, uint64_t offset, size_t len) { (void)dest; (void)offset; (void)len; return 0; } virtual size_t PerformWrite(uint64_t offset, const void* data, size_t len) { (void)offset; (void)data; (void)len; return 0; } @@ -1128,8 +1128,8 @@ namespace BinaryNinja std::vector<BNAddressRange> GetAllocatedRanges(); - void StoreMetadata(const std::string& key, Metadata* inValue); - std::unique_ptr<Metadata> QueryMetadata(const std::string& key); + void StoreMetadata(const std::string& key, Ref<Metadata> value); + Ref<Metadata> QueryMetadata(const std::string& key); std::string GetStringMetadata(const std::string& key); std::vector<uint8_t> GetRawMetadata(const std::string& key); uint64_t GetUIntMetadata(const std::string& key); @@ -2929,8 +2929,15 @@ namespace BinaryNinja Metadata(const std::vector<int64_t>& data); Metadata(const std::vector<double>& data); Metadata(const std::vector<uint8_t>& data); + Metadata(const std::vector<Ref<Metadata>>& data); + Metadata(const std::map<std::string, Ref<Metadata>>& data); + Metadata(MetadataType type); virtual ~Metadata() {} + bool operator==(const Metadata& rhs); + Ref<Metadata> operator[](const std::string& key); + Ref<Metadata> operator[](size_t idx); + MetadataType GetType() const; bool GetBoolean() const; std::string GetString() const; @@ -2943,6 +2950,18 @@ namespace BinaryNinja std::vector<int64_t> GetSignedIntegerList() const; std::vector<double> GetDoubleList() const; std::vector<uint8_t> GetRaw() const; + std::vector<Ref<Metadata>> GetArray(); + std::map<std::string, Ref<Metadata>> GetKeyValueStore(); + + //For key-value data only + Ref<Metadata> Get(const std::string& key); + bool SetValueForKey(const std::string& key, Ref<Metadata> data); + + //For array data only + Ref<Metadata> Get(size_t idx); + bool Append(Ref<Metadata> data); + + size_t Size() const; bool IsBoolean() const; bool IsString() const; @@ -2955,5 +2974,7 @@ namespace BinaryNinja bool IsSignedIntegerList() const; bool IsDoubleList() const; bool IsRaw() const; + bool IsArray() const; + bool IsKeyValueStore() const; }; } |
