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.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/view/sharedcache/api/sharedcache.cpp b/view/sharedcache/api/sharedcache.cpp
index 8c9b2234..b92a0e64 100644
--- a/view/sharedcache/api/sharedcache.cpp
+++ b/view/sharedcache/api/sharedcache.cpp
@@ -125,6 +125,16 @@ std::string SharedCacheAPI::GetRegionTypeAsString(const BNSharedCacheRegionType
}
}
+Ref<Symbol> CacheSymbol::GetBNSymbol(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);
+}
+
std::string SharedCacheAPI::GetSymbolTypeAsString(const BNSymbolType &type)
{
// NOTE: We currently only use the function and data symbol for cache symbols.
diff --git a/view/sharedcache/api/sharedcacheapi.h b/view/sharedcache/api/sharedcacheapi.h
index ee49140e..db5eeefc 100644
--- a/view/sharedcache/api/sharedcacheapi.h
+++ b/view/sharedcache/api/sharedcacheapi.h
@@ -287,6 +287,8 @@ namespace SharedCacheAPI {
BNSymbolType type;
uint64_t address;
std::string name;
+
+ BinaryNinja::Ref<BinaryNinja::Symbol> GetBNSymbol(BinaryNinja::BinaryView& view) const;
};
std::string GetSymbolTypeAsString(const BNSymbolType& type);