From 0f26e9236d52e5e2f0a8e64114d954a516cbeb95 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Tue, 8 Apr 2025 14:16:05 -0400 Subject: [SharedCache] Apply demangled names and types more broadly Fixes the case of stub functions being applied with mangled names. --- view/sharedcache/core/MachOProcessor.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'view/sharedcache/core/MachOProcessor.cpp') diff --git a/view/sharedcache/core/MachOProcessor.cpp b/view/sharedcache/core/MachOProcessor.cpp index 7f3da817..fdb56516 100644 --- a/view/sharedcache/core/MachOProcessor.cpp +++ b/view/sharedcache/core/MachOProcessor.cpp @@ -62,7 +62,10 @@ void SharedCacheMachOProcessor::ApplyHeader(SharedCacheMachOHeader& header) // NOTE: This table is read relative to the link edit segment file base. const auto symbols = header.ReadSymbolTable(*m_view, *m_vm); for (const auto& sym : symbols) - ApplySymbol(m_view, typeLib, sym.ToBNSymbol(*m_view)); + { + auto [symbol, symbolType] = sym.GetBNSymbolAndType(*m_view); + ApplySymbol(m_view, typeLib, symbol, symbolType); + } } // Apply symbols from export trie. @@ -72,7 +75,10 @@ void SharedCacheMachOProcessor::ApplyHeader(SharedCacheMachOHeader& header) // TODO: Remove this and use the m_symbols in the cache? const auto exportSymbols = header.ReadExportSymbolTrie(*m_vm); for (const auto& sym : exportSymbols) - ApplySymbol(m_view, typeLib, sym.ToBNSymbol(*m_view)); + { + auto [symbol, symbolType] = sym.GetBNSymbolAndType(*m_view); + ApplySymbol(m_view, typeLib, symbol, symbolType); + } } m_view->EndBulkModifySymbols(); } -- cgit v1.3.1