summaryrefslogtreecommitdiff
path: root/plugins/rtti
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-05-23 13:03:11 +0200
committerMason Reed <mason@vector35.com>2025-05-23 13:03:11 +0200
commit6cb57b017d2efbc3104ed2260d55e2d02fa721e8 (patch)
tree87909ec36d21ed36942440dfdb7dfb348852c7f9 /plugins/rtti
parent2cb16dfcffb232d275276cfe0a2e006ef8df91f0 (diff)
[RTTI] Fix exception in binary with a erroneous class hierarchy descriptor
Diffstat (limited to 'plugins/rtti')
-rw-r--r--plugins/rtti/microsoft.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/plugins/rtti/microsoft.cpp b/plugins/rtti/microsoft.cpp
index 1299170c..d5e14648 100644
--- a/plugins/rtti/microsoft.cpp
+++ b/plugins/rtti/microsoft.cpp
@@ -431,6 +431,16 @@ std::optional<ClassInfo> MicrosoftRTTIProcessor::ProcessRTTI(uint64_t coLocatorA
auto classInfo = ClassInfo{RTTIProcessorType::Microsoft, className.value()};
auto classHierarchyDescAddr = resolveAddr(coLocator->pClassHierarchyDescriptor);
+
+ // Verify the class hierarchy descriptor signature is zero.
+ auto reader = BinaryReader(m_view);
+ reader.Seek(classHierarchyDescAddr);
+ if (auto signature = reader.Read32(); signature != 0)
+ {
+ m_logger->LogWarn("Skipping CompleteObjectorLocator with non-zero hierarchy descriptor signature %llx", coLocatorAddr);
+ return std::nullopt;
+ }
+
classInfo.baseClasses = ProcessClassHierarchyDescriptor(classHierarchyDescAddr, coLocator.value(), classInfo);
// Locate the current base class if we are in one.