summaryrefslogtreecommitdiff
path: root/view/sharedcache/api
diff options
context:
space:
mode:
Diffstat (limited to 'view/sharedcache/api')
-rw-r--r--view/sharedcache/api/sharedcache.cpp10
-rw-r--r--view/sharedcache/api/sharedcacheapi.h1
2 files changed, 9 insertions, 2 deletions
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<Symbol> CacheSymbol::GetBNSymbol(BinaryView &view) const
+std::pair<std::string, Ref<Type>> CacheSymbol::DemangledName(BinaryView &view) const
{
QualifiedName qname;
- Ref<Type> outType;
+ Ref<Type> outType = nullptr;
std::string shortName = name;
if (DemangleGeneric(view.GetDefaultArchitecture(), name, outType, qname, &view, true))
shortName = qname.GetString();
+ return {shortName, outType};
+}
+
+Ref<Symbol> CacheSymbol::GetBNSymbol(BinaryView &view) const
+{
+ auto [shortName, _] = DemangledName(view);
return new Symbol(type, shortName, shortName, name, address, nullptr);
}
diff --git a/view/sharedcache/api/sharedcacheapi.h b/view/sharedcache/api/sharedcacheapi.h
index db5eeefc..5a842cba 100644
--- a/view/sharedcache/api/sharedcacheapi.h
+++ b/view/sharedcache/api/sharedcacheapi.h
@@ -288,6 +288,7 @@ namespace SharedCacheAPI {
uint64_t address;
std::string name;
+ std::pair<std::string, BinaryNinja::Ref<BinaryNinja::Type>> DemangledName(BinaryNinja::BinaryView &view) const;
BinaryNinja::Ref<BinaryNinja::Symbol> GetBNSymbol(BinaryNinja::BinaryView& view) const;
};