diff options
| -rw-r--r-- | binaryninjaapi.h | 2 | ||||
| -rw-r--r-- | binaryninjacore.h | 8 | ||||
| -rw-r--r-- | database.cpp | 26 |
3 files changed, 18 insertions, 18 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 6098510d..5027d283 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -1558,6 +1558,7 @@ namespace BinaryNinja { std::vector<UndoEntry> GetUndoEntries(const std::function<bool(size_t, size_t)>& progress); Ref<KeyValueStore> ReadData(); Ref<KeyValueStore> ReadData(const std::function<bool(size_t, size_t)>& progress); + bool StoreData(const Ref<KeyValueStore>& data, const std::function<bool(size_t, size_t)>& progress); bool HasAncestor(Ref<Snapshot> other); }; @@ -1579,7 +1580,6 @@ namespace BinaryNinja { Ref<Snapshot> GetCurrentSnapshot(); int64_t WriteSnapshotData(std::vector<int64_t> parents, Ref<BinaryView> file, const std::string& name, const Ref<KeyValueStore>& data, bool autoSave, const std::function<bool(size_t, size_t)>& progress); - bool StoreDataForSnapshot(int64_t id, const Ref<KeyValueStore>& data, const std::function<bool(size_t, size_t)>& progress); void TrimSnapshot(int64_t id); void RemoveSnapshot(int64_t id); diff --git a/binaryninjacore.h b/binaryninjacore.h index 3044d4a4..3c7a8659 100644 --- a/binaryninjacore.h +++ b/binaryninjacore.h @@ -36,14 +36,14 @@ // Current ABI version for linking to the core. This is incremented any time // there are changes to the API that affect linking, including new functions, // new types, or modifications to existing functions or types. -#define BN_CURRENT_CORE_ABI_VERSION 29 +#define BN_CURRENT_CORE_ABI_VERSION 30 // Minimum ABI version that is supported for loading of plugins. Plugins that // are linked to an ABI version less than this will not be able to load and // will require rebuilding. The minimum version is increased when there are // incompatible changes that break binary compatibility, such as changes to // existing types or functions. -#define BN_MINIMUM_CORE_ABI_VERSION 29 +#define BN_MINIMUM_CORE_ABI_VERSION 30 #ifdef __GNUC__ #ifdef BINARYNINJACORE_LIBRARY @@ -3177,8 +3177,6 @@ extern "C" BINARYNINJACOREAPI int64_t BNWriteDatabaseSnapshotData(BNDatabase* database, int64_t* parents, size_t parentCount, BNBinaryView* file, const char* name, BNKeyValueStore* data, bool autoSave, void* ctxt, bool (*progress)(void*, size_t, size_t)); - BINARYNINJACOREAPI bool BNStoreDataForSnapshot(BNDatabase* database, int64_t id, BNKeyValueStore* data, - void* ctxt, bool (*progress)(void*, size_t, size_t)); BINARYNINJACOREAPI bool BNTrimDatabaseSnapshot(BNDatabase* database, int64_t id); BINARYNINJACOREAPI bool BNRemoveDatabaseSnapshot(BNDatabase* database, int64_t id); BINARYNINJACOREAPI char** BNGetDatabaseGlobalKeys(BNDatabase* database, size_t* count); @@ -3215,6 +3213,8 @@ extern "C" BINARYNINJACOREAPI BNUndoEntry* BNGetSnapshotUndoEntriesWithProgress( BNSnapshot* snapshot, void* ctxt, bool (*progress)(void* ctxt, size_t progress, size_t total), size_t* count); BINARYNINJACOREAPI bool BNSnapshotHasAncestor(BNSnapshot* snapshot, BNSnapshot* other); + BINARYNINJACOREAPI bool BNSnapshotStoreData(BNSnapshot* snapshot, BNKeyValueStore* data, + void* ctxt, bool (*progress)(void*, size_t, size_t)); BINARYNINJACOREAPI bool BNRebase(BNBinaryView* data, uint64_t address); diff --git a/database.cpp b/database.cpp index 4f284f15..af2a8a29 100644 --- a/database.cpp +++ b/database.cpp @@ -334,6 +334,19 @@ Ref<KeyValueStore> Snapshot::ReadData(const std::function<bool(size_t, size_t)>& } +bool Snapshot::StoreData(const Ref<KeyValueStore>& data, const std::function<bool(size_t, size_t)>& progress) +{ + ProgressContext pctxt; + pctxt.callback = progress; + bool result = BNSnapshotStoreData(m_object, data->GetObject(), &pctxt, ProgressCallback); + if (!result) + { + throw DatabaseException("BNSnapshotStoreData"); + } + return result; +} + + bool Snapshot::HasAncestor(Ref<Snapshot> other) { return BNSnapshotHasAncestor(m_object, other->GetObject()); @@ -396,19 +409,6 @@ int64_t Database::WriteSnapshotData(std::vector<int64_t> parents, Ref<BinaryView } -bool Database::StoreDataForSnapshot(int64_t id, const Ref<KeyValueStore>& data, const std::function<bool(size_t, size_t)>& progress) -{ - ProgressContext pctxt; - pctxt.callback = progress; - bool result = BNStoreDataForSnapshot(m_object, id, data->GetObject(), &pctxt, ProgressCallback); - if (!result) - { - throw DatabaseException("BNStoreDataForSnapshot"); - } - return result; -} - - void Database::TrimSnapshot(int64_t id) { if (!BNTrimDatabaseSnapshot(m_object, id)) |
