From a45466fc3227c615c72e77eb7368d7e83220b325 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 8 Apr 2025 13:17:30 -0400 Subject: Remove notion of image name from objective-c processor This made the macho objective-c processor aware of images and was passed around everywhere, instead we have an overridable section getter that gives the control over the section retrieval to the derived processor. In the case of shared cache this means we can store the image to be processed and then use the header to locate the relevant sections. Fixes: https://github.com/Vector35/binaryninja-api/issues/6594 --- view/sharedcache/core/SharedCacheController.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'view/sharedcache/core/SharedCacheController.cpp') diff --git a/view/sharedcache/core/SharedCacheController.cpp b/view/sharedcache/core/SharedCacheController.cpp index 13afb476..8d036b4a 100644 --- a/view/sharedcache/core/SharedCacheController.cpp +++ b/view/sharedcache/core/SharedCacheController.cpp @@ -215,16 +215,14 @@ bool SharedCacheController::ApplyImage(BinaryView& view, const CacheImage& image machoProcessor.ApplyHeader(*image.header); view.SetFunctionAnalysisUpdateDisabled(prevDisabledState); - // TODO: Passing in an image name here is weird considering this is shared with the MACHO view. - // TODO: We should abstract out the "image" into an objc image type that represents what is required, which ig is the name? // Load objective-c information. - auto objcProcessor = DSCObjC::SharedCacheObjCProcessor(&view, false); + auto objcProcessor = DSCObjC::SharedCacheObjCProcessor(&view, false, image.headerAddress); try { if (m_processObjC) - objcProcessor.ProcessObjCData(image.GetName()); + objcProcessor.ProcessObjCData(); if (m_processCFStrings) - objcProcessor.ProcessCFStrings(image.GetName()); + objcProcessor.ProcessCFStrings(); } catch (std::exception& e) { -- cgit v1.3.1