summaryrefslogtreecommitdiff
path: root/view/sharedcache/core/SharedCache.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-04-08 14:16:05 -0400
committerMason Reed <mason@vector35.com>2025-04-08 14:16:16 -0400
commit0f26e9236d52e5e2f0a8e64114d954a516cbeb95 (patch)
tree3f011a89ae1f486eec1641a5c01a9dfc392086ba /view/sharedcache/core/SharedCache.cpp
parenta45466fc3227c615c72e77eb7368d7e83220b325 (diff)
[SharedCache] Apply demangled names and types more broadly
Fixes the case of stub functions being applied with mangled names.
Diffstat (limited to 'view/sharedcache/core/SharedCache.cpp')
-rw-r--r--view/sharedcache/core/SharedCache.cpp11
1 files changed, 9 insertions, 2 deletions
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<Symbol> CacheSymbol::ToBNSymbol(BinaryView& view) const
+std::pair<std::string, Ref<Type>> CacheSymbol::DemangledName(BinaryView &view) const
{
QualifiedName qname;
Ref<Type> 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<Symbol>, Ref<Type>> 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<std::string> CacheImage::GetDependencies() const