From aa8dab21d44b4e0dd863f0867c7e735cfb878a4d Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Mon, 13 Apr 2026 13:07:09 -0700 Subject: Always show the triage view when opening a shared cache or kernel cache BinaryViewType gains a HasNoInitialContent function that views can use to suppress layout restoration when opening a file. The layout will still be restored when the view is loaded from a saved database. Fixes https://github.com/Vector35/binaryninja-api/issues/8083. --- binaryninjaapi.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'binaryninjaapi.h') diff --git a/binaryninjaapi.h b/binaryninjaapi.h index fe57d92d..1c482b66 100644 --- a/binaryninjaapi.h +++ b/binaryninjaapi.h @@ -8623,6 +8623,7 @@ namespace BinaryNinja { static bool IsDeprecatedCallback(void* ctxt); static bool IsForceLoadableCallback(void *ctxt); static BNSettings* GetSettingsCallback(void* ctxt, BNBinaryView* data); + static bool HasNoInitialContentCallback(void* ctxt); BinaryViewType(BNBinaryViewType* type); @@ -8775,6 +8776,18 @@ namespace BinaryNinja { */ virtual bool IsForceLoadable(); + /*! Check whether instances of this BinaryViewType start with no loaded content + + When true, the view has no meaningful default state: the user must make a + selection (e.g. load images from a shared cache) before any content exists. + Callers can use this to suppress restoring previously-saved view state for + files not being loaded from a database, since a saved layout would reference + content that isn't available on reopen. + + \return Whether instances of this BinaryViewType start with no loaded content + */ + virtual bool HasNoInitialContent(); + virtual Ref GetLoadSettingsForData(BinaryView* data); Ref GetDefaultLoadSettingsForData(BinaryView* data); @@ -8798,6 +8811,7 @@ namespace BinaryNinja { virtual bool IsTypeValidForData(BinaryView* data) override; virtual bool IsDeprecated() override; virtual bool IsForceLoadable() override; + virtual bool HasNoInitialContent() override; virtual Ref GetLoadSettingsForData(BinaryView* data) override; }; -- cgit v1.3.1