diff options
| author | Mark Rowe <mark@vector35.com> | 2026-03-24 09:05:49 -0700 |
|---|---|---|
| committer | Mark Rowe <mark@vector35.com> | 2026-03-30 13:22:34 -0700 |
| commit | ddd7aa4e7cd5a1aa07a16c3895d1f91ebf49347b (patch) | |
| tree | 6e8c27306ed57334686b413fd0ec5882846b950a /binaryninjaapi.h | |
| parent | 20adc82b8f85a78fe2cd6ddc2b3a8c78558999a5 (diff) | |
Add a hook to allow BinaryView subclasses to run code after snapshot data is applied
Snapshot data is applied when loading from a database, rebasing the
view, etc.
Diffstat (limited to 'binaryninjaapi.h')
| -rw-r--r-- | binaryninjaapi.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/binaryninjaapi.h b/binaryninjaapi.h index 7b46f97f..e62b1d3e 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -5773,6 +5773,15 @@ namespace BinaryNinja { void PerformDefineRelocation(Architecture* arch, BNRelocationInfo& info, uint64_t target, uint64_t reloc); void PerformDefineRelocation(Architecture* arch, BNRelocationInfo& info, Ref<Symbol> sym, uint64_t reloc); + /*! OnAfterSnapshotDataApplied is called when loading a view from a database, after snapshot data has been applied to it. + + \note This method **may** be overridden by custom BinaryViews. + + \warning This method **must not** be called directly. + + */ + virtual void OnAfterSnapshotDataApplied() {} + public: void NotifyDataWritten(uint64_t offset, size_t len); void NotifyDataInserted(uint64_t offset, size_t len); @@ -5780,6 +5789,7 @@ namespace BinaryNinja { private: static bool InitCallback(void* ctxt); + static void OnAfterSnapshotDataAppliedCallback(void* ctxt); static void FreeCallback(void* ctxt); static size_t ReadCallback(void* ctxt, void* dest, uint64_t offset, size_t len); static size_t WriteCallback(void* ctxt, uint64_t offset, const void* src, size_t len); |
