summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCacheController.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'view/sharedcache/core/SharedCacheController.cpp')
-rw-r--r--view/sharedcache/core/SharedCacheController.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/view/sharedcache/core/SharedCacheController.cpp b/view/sharedcache/core/SharedCacheController.cpp
index 8886748f..8ed011bd 100644
--- a/view/sharedcache/core/SharedCacheController.cpp
+++ b/view/sharedcache/core/SharedCacheController.cpp
@@ -292,3 +292,27 @@ void SharedCacheController::LoadMetadata(const Metadata& metadata)
m_loadedImages.insert(region);
}
}
+
+
+void SharedCacheController::ProcessObjCForLoadedImages(BinaryView& view)
+{
+ if (!m_processObjC || m_loadedImages.empty())
+ return;
+
+ for (const auto& headerAddress : m_loadedImages)
+ {
+ auto image = m_cache.GetImageAt(headerAddress);
+ if (!image)
+ continue;
+
+ auto objcProcessor = DSCObjC::SharedCacheObjCProcessor(&view, image->headerAddress);
+ try
+ {
+ objcProcessor.ProcessObjCData();
+ }
+ catch (std::exception& e)
+ {
+ m_logger->LogErrorForExceptionF(e, "Failed to restore ObjC metadata for image at {:#x}: {}", headerAddress, e.what());
+ }
+ }
+}