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 /binaryview.cpp | |
| 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 'binaryview.cpp')
| -rw-r--r-- | binaryview.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/binaryview.cpp b/binaryview.cpp index 85a7cfbe..c1886ab9 100644 --- a/binaryview.cpp +++ b/binaryview.cpp @@ -1365,6 +1365,7 @@ BinaryView::BinaryView(const std::string& typeName, FileMetadata* file, BinaryVi view.isRelocatable = IsRelocatableCallback; view.getAddressSize = GetAddressSizeCallback; view.save = SaveCallback; + view.onAfterSnapshotDataApplied = OnAfterSnapshotDataAppliedCallback; m_file = file; AddRefForRegistration(); m_object = BNCreateCustomBinaryView( @@ -1388,6 +1389,13 @@ bool BinaryView::InitCallback(void* ctxt) } +void BinaryView::OnAfterSnapshotDataAppliedCallback(void* ctxt) +{ + CallbackRef<BinaryView> view(ctxt); + view->OnAfterSnapshotDataApplied(); +} + + void BinaryView::FreeCallback(void* ctxt) { BinaryView* view = (BinaryView*)ctxt; |
