diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/rtti/itanium.cpp | 16 | ||||
| -rw-r--r-- | plugins/rtti/rtti.cpp | 1 |
2 files changed, 13 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(); diff --git a/plugins/rtti/rtti.cpp b/plugins/rtti/rtti.cpp index 57cd52cf..f0cde410 100644 --- a/plugins/rtti/rtti.cpp +++ b/plugins/rtti/rtti.cpp @@ -39,6 +39,7 @@ std::string RemoveItaniumPrefix(std::string &name) { // Remove numerical prefixes. // TODO: We might want to use the numbers for figuring out the class info. + // TODO: NSt6locale5facetE is not demangled. N and St seem to be prefixes. while (!name.empty() && std::isdigit(name[0])) name = name.substr(1); return name; |
