summaryrefslogtreecommitdiff
path: root/plugins/rtti/itanium.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/rtti/itanium.cpp')
-rw-r--r--plugins/rtti/itanium.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/plugins/rtti/itanium.cpp b/plugins/rtti/itanium.cpp
index cc632045..f2b773b0 100644
--- a/plugins/rtti/itanium.cpp
+++ b/plugins/rtti/itanium.cpp
@@ -321,10 +321,18 @@ std::optional<TypeInfoVariant> ReadTypeInfoVariant(BinaryView *view, uint64_t ob
uint64_t typeInfoAddr = reader.ReadPointer();
if (!view->IsValidOffset(typeInfoAddr))
return std::nullopt;
- auto vftSym = view->GetSymbolByAddress(typeInfoAddr);
- if (vftSym == nullptr)
- return std::nullopt;
- baseSym = vftSym;
+ auto typeInfoSym = view->GetSymbolByAddress(typeInfoAddr);
+ if (typeInfoSym == nullptr)
+ {
+ // For stripped binaries there will be no symbol, contruct a type info object and check.
+ auto rootTypeInfo = GetTypeInfo(view, typeInfoAddr);
+ if (!rootTypeInfo.has_value())
+ return std::nullopt;
+ if (rootTypeInfo->type_name.find("__cxxabiv1") == std::string::npos)
+ return std::nullopt;
+ typeInfoSym = new Symbol(DataSymbol, fmt::format("_typeinfo_for_{}", rootTypeInfo->type_name), typeInfoAddr);
+ }
+ baseSym = typeInfoSym;
}
auto baseSymName = baseSym->GetShortName();