summaryrefslogtreecommitdiff
path: root/view/kernelcache
diff options
context:
space:
mode:
authorMark Rowe <mark@vector35.com>2025-11-13 22:37:30 -0800
committerMark Rowe <mark@vector35.com>2025-11-26 00:12:34 -0800
commitb33cd4b0a3dde42f04d1de8ada563cdde8a750a2 (patch)
tree25a44b4c8fe1ab14b9464a15a5be27a923d01181 /view/kernelcache
parent1daa5154ac5abfce19132c27d91ff255d2194683 (diff)
[KernelCache] Place synthetic sections after the cache's address range
This ensures they do not overlap with any images that may later be loaded from the kernel cache. Fixes https://github.com/Vector35/binaryninja-api/issues/7634.
Diffstat (limited to 'view/kernelcache')
-rw-r--r--view/kernelcache/core/KernelCacheView.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/view/kernelcache/core/KernelCacheView.cpp b/view/kernelcache/core/KernelCacheView.cpp
index 3535eec9..8e942268 100644
--- a/view/kernelcache/core/KernelCacheView.cpp
+++ b/view/kernelcache/core/KernelCacheView.cpp
@@ -74,6 +74,11 @@ Ref<Settings> KernelCacheViewType::GetLoadSettingsForData(BinaryView* data)
"description" : "Add function starts sourced from the Function Starts tables to the core for analysis."
})");
+ // Place the synthetic sections well after the kernel cache to ensure they do
+ // not collide with any images that are later loaded from the kernel cache.
+ constexpr uint64_t syntheticSectionsOffset = 256 * 1024 * 1024;
+ settings->UpdateProperty("loader.syntheticSectionBase", "default", viewRef->GetStart() + syntheticSectionsOffset);
+
// Merge existing load settings if they exist. This allows for the selection of a specific object file from a Mach-O
// Universal file. The 'Universal' BinaryViewType generates a schema with 'loader.universal.architectures'. This
// schema contains an appropriate 'Mach-O' load schema for selecting a specific object file. The embedded schema