summaryrefslogtreecommitdiff
path: root/binaryviewtype.cpp
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2026-04-13 13:07:09 -0700
committerMark Rowe <mark@vector35.com>2026-04-22 15:20:52 -0700
commitaa8dab21d44b4e0dd863f0867c7e735cfb878a4d (patch)
tree256ca89364716afed1735521106130571b0fdb9b /binaryviewtype.cpp
parent84d66dc7e6244e6ef78ebb3a2aa24b57a6ed4345 (diff)
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.
Diffstat (limited to 'binaryviewtype.cpp')
-rw-r--r--binaryviewtype.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/binaryviewtype.cpp b/binaryviewtype.cpp
index f06218b1..dd542b2b 100644
--- a/binaryviewtype.cpp
+++ b/binaryviewtype.cpp
@@ -68,6 +68,13 @@ bool BinaryViewType::IsForceLoadableCallback(void* ctxt)
}
+bool BinaryViewType::HasNoInitialContentCallback(void* ctxt)
+{
+ CallbackRef<BinaryViewType> type(ctxt);
+ return type->HasNoInitialContent();
+}
+
+
BNSettings* BinaryViewType::GetSettingsCallback(void* ctxt, BNBinaryView* data)
{
CallbackRef<BinaryViewType> type(ctxt);
@@ -102,6 +109,7 @@ void BinaryViewType::Register(BinaryViewType* type)
callbacks.isDeprecated = IsDeprecatedCallback;
callbacks.isForceLoadable = IsForceLoadableCallback;
callbacks.getLoadSettingsForData = GetSettingsCallback;
+ callbacks.hasNoInitialContent = HasNoInitialContentCallback;
type->AddRefForRegistration();
type->m_object =
@@ -272,6 +280,12 @@ bool BinaryViewType::IsForceLoadable()
}
+bool BinaryViewType::HasNoInitialContent()
+{
+ return false;
+}
+
+
void BinaryViewType::RegisterBinaryViewFinalizationEvent(const function<void(BinaryView* view)>& callback)
{
BinaryViewEvent* event = new BinaryViewEvent;
@@ -378,6 +392,12 @@ bool CoreBinaryViewType::IsForceLoadable()
}
+bool CoreBinaryViewType::HasNoInitialContent()
+{
+ return BNBinaryViewTypeHasNoInitialContent(m_object);
+}
+
+
Ref<Settings> CoreBinaryViewType::GetLoadSettingsForData(BinaryView* data)
{
BNSettings* settings = BNGetBinaryViewLoadSettingsForData(m_object, data->GetObject());