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/SharedCache.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'view/sharedcache/core/SharedCache.cpp') diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp index 0b8653d7..2e902056 100644 --- a/view/sharedcache/core/SharedCache.cpp +++ b/view/sharedcache/core/SharedCache.cpp @@ -11,14 +11,21 @@ using namespace BinaryNinja; // The next id to use when calling Cache::AddEntry static CacheEntryId nextId = 1; -Ref CacheSymbol::ToBNSymbol(BinaryView& view) const +std::pair> CacheSymbol::DemangledName(BinaryView &view) const { QualifiedName qname; Ref outType; std::string shortName = name; if (DemangleGeneric(view.GetDefaultArchitecture(), name, outType, qname, &view, true)) shortName = qname.GetString(); - return new Symbol(type, shortName, shortName, name, address, nullptr); + return { shortName, outType }; +} + +std::pair, Ref> CacheSymbol::GetBNSymbolAndType(BinaryView& view) const +{ + auto [shortName, demangledType] = DemangledName(view); + auto symbol = new Symbol(type, shortName, shortName, name, address, nullptr); + return {symbol, demangledType}; } std::vector CacheImage::GetDependencies() const -- cgit v1.3.1