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/api/sharedcache.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'view/sharedcache/api/sharedcache.cpp') diff --git a/view/sharedcache/api/sharedcache.cpp b/view/sharedcache/api/sharedcache.cpp index b92a0e64..922a7ff3 100644 --- a/view/sharedcache/api/sharedcache.cpp +++ b/view/sharedcache/api/sharedcache.cpp @@ -125,13 +125,19 @@ std::string SharedCacheAPI::GetRegionTypeAsString(const BNSharedCacheRegionType } } -Ref CacheSymbol::GetBNSymbol(BinaryView &view) const +std::pair> CacheSymbol::DemangledName(BinaryView &view) const { QualifiedName qname; - Ref outType; + Ref outType = nullptr; std::string shortName = name; if (DemangleGeneric(view.GetDefaultArchitecture(), name, outType, qname, &view, true)) shortName = qname.GetString(); + return {shortName, outType}; +} + +Ref CacheSymbol::GetBNSymbol(BinaryView &view) const +{ + auto [shortName, _] = DemangledName(view); return new Symbol(type, shortName, shortName, name, address, nullptr); } -- cgit v1.3.1