| 412 | |
| 413 | |
| 414 | std::optional<BaseClassInfo> ItaniumRTTIProcessor::ProcessVFTBaseClassInfo(uint64_t vftAddr, ClassInfo &classInfo) |
| 415 | { |
| 416 | BinaryReader reader = BinaryReader(m_view); |
| 417 | // Because we have this we _need_ to have the adjustment stuff. |
| 418 | // NOTE: We assume two field sized ints with the first being what we want. |
| 419 | // Two 0x4 ints and the pointer to the type info. |
| 420 | reader.Seek(vftAddr - ((ArchFieldSize(m_view) * 2) + m_view->GetAddressSize())); |
| 421 | |
| 422 | auto adjustmentOffset = static_cast<int32_t>(reader.Read32()); |
| 423 | [[maybe_unused]] |
| 424 | auto baseIdx = static_cast<int32_t>(reader.Read32()); |
| 425 | uint64_t classOffset = std::abs(adjustmentOffset); |
| 426 | |
| 427 | std::optional<BaseClassInfo> selectedBaseClassInfo = std::nullopt; |
| 428 | // Assuming we do not have a baseClassInfo already passed we can deduce it here. |
| 429 | for (auto& baseClass : classInfo.baseClasses) |
| 430 | { |
| 431 | if (baseClass.offset == classOffset) |
| 432 | { |
| 433 | // Found the appropriate base class for this vtable. |
| 434 | selectedBaseClassInfo = baseClass; |
| 435 | } |
| 436 | } |
| 437 | |
| 438 | // Return the selected base class for use in later processing such as `ProcessVFT`. |
| 439 | return selectedBaseClassInfo; |
| 440 | } |
| 441 | |
| 442 | |
| 443 | std::optional<ClassInfo> ItaniumRTTIProcessor::ProcessRTTI(uint64_t objectAddr) |
nothing calls this directly
no test coverage detected