From b33cd4b0a3dde42f04d1de8ada563cdde8a750a2 Mon Sep 17 00:00:00 2001 From: Mark Rowe Date: Thu, 13 Nov 2025 22:37:30 -0800 Subject: [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. --- view/kernelcache/core/KernelCacheView.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'view/kernelcache/core/KernelCacheView.cpp') 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 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 -- cgit v1.3.1