From fc5ffbbcfbc16402583a9e05d7db3036ad587066 Mon Sep 17 00:00:00 2001 From: kat Date: Mon, 28 Oct 2024 12:58:23 -0400 Subject: [SharedCache] Warnings Cleanup --- view/sharedcache/core/DSCView.cpp | 6 ++--- view/sharedcache/core/SharedCache.cpp | 42 ++++++++++++++++------------------- 2 files changed, 22 insertions(+), 26 deletions(-) (limited to 'view/sharedcache/core') diff --git a/view/sharedcache/core/DSCView.cpp b/view/sharedcache/core/DSCView.cpp index e690f765..7a1b3677 100644 --- a/view/sharedcache/core/DSCView.cpp +++ b/view/sharedcache/core/DSCView.cpp @@ -207,8 +207,7 @@ bool DSCView::Init() if (!settings) { Ref programSettings = Settings::Instance(); - programSettings->Set("workflows.enable", true, this); - programSettings->Set("workflows.functionWorkflow", "core.function.dsc", this); + programSettings->Set("analysis.workflows.functionWorkflow", "core.function.dsc", this); } // Add Mach-O file header type info @@ -751,6 +750,7 @@ bool DSCView::Init() } AddAutoSegment(primaryBase, 0x200, 0, 0x200, SegmentReadable); + AddAutoSection("__dsc_header", primaryBase, 0x200, ReadOnlyCodeSectionSemantics); DefineType("dyld_cache_header", headerType.name, headerType.type); DefineAutoSymbolAndVariableOrFunction(GetDefaultPlatform(), new Symbol(DataSymbol, "primary_cache_header", primaryBase), headerType.type); @@ -789,7 +789,7 @@ Ref DSCViewType::GetLoadSettingsForData(BinaryView* data) } Ref programSettings = Settings::Instance(); - programSettings->Set("workflows.functionWorkflow", "core.function.dsc", viewRef); + programSettings->Set("analysis.workflows.functionWorkflow", "core.function.dsc", viewRef); settings->RegisterSetting("loader.dsc.processCFStrings", R"({ diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp index d468ff9a..a597cfb5 100644 --- a/view/sharedcache/core/SharedCache.cpp +++ b/view/sharedcache/core/SharedCache.cpp @@ -1341,33 +1341,29 @@ SharedCache::SharedCache(BinaryNinja::Ref dscView) : m_ { if (m_viewState == DSCViewStateUnloaded) { - // maybe we are getting called from UI thread. probably. do this on a separate thread just in case. - // TODO `wait` argument - WorkerEnqueue([this]() { - std::unique_lock lock(viewSpecificMutexes[m_dscView->GetFile()->GetSessionId()].viewOperationsThatInfluenceMetadataMutex); - try { - PerformInitialLoad(); - } - catch (...) - { - m_logger->LogError("Failed to perform initial load of Shared Cache"); - } + std::unique_lock lock(viewSpecificMutexes[m_dscView->GetFile()->GetSessionId()].viewOperationsThatInfluenceMetadataMutex); + try { + PerformInitialLoad(); + } + catch (...) + { + m_logger->LogError("Failed to perform initial load of Shared Cache"); + } - for (const auto& [_, header] : m_headers) + for (const auto& [_, header] : m_headers) + { + if (header.installName.find("libsystem_c.dylib") != std::string::npos) { - if (header.installName.find("libsystem_c.dylib") != std::string::npos) - { - lock.unlock(); - m_logger->LogInfo("Loading core libsystem_c.dylib library"); - LoadImageWithInstallName(header.installName); - lock.lock(); - break ; - } + lock.unlock(); + m_logger->LogInfo("Loading core libsystem_c.dylib library"); + LoadImageWithInstallName(header.installName); + lock.lock(); + break ; } + } - m_viewState = DSCViewStateLoaded; - SaveToDSCView(); - }); + m_viewState = DSCViewStateLoaded; + SaveToDSCView(); } } else -- cgit v1.3.1