From 0840b2860069cf8d1dac47066bfdc3526720de19 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Fri, 25 Oct 2024 13:13:16 -0400 Subject: Use module workflows in MSVC RTTI MSVC RTTI information will be applied on open to all windows platforms now --- plugins/msvc_rtti/rtti.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'plugins/msvc_rtti/rtti.cpp') diff --git a/plugins/msvc_rtti/rtti.cpp b/plugins/msvc_rtti/rtti.cpp index ea129c39..cc22a890 100644 --- a/plugins/msvc_rtti/rtti.cpp +++ b/plugins/msvc_rtti/rtti.cpp @@ -548,8 +548,16 @@ std::optional MicrosoftRTTIProcessor::ProcessVFT(uint6 size_t vFuncIdx = 0; for (auto &&vFunc: virtualFunctions) { - // TODO: Identify when the functions name can be used instead of the vFunc_* placeholder. auto vFuncName = fmt::format("vFunc_{}", vFuncIdx); + // If we have a better name, use it. + auto vFuncSymName = vFunc->GetSymbol()->GetShortName(); + if (vFuncSymName.compare(0, 4, "sub_") != 0) + vFuncName = vFunc->GetSymbol()->GetShortName(); + // MyClass::func -> func + std::size_t pos = vFuncName.rfind("::"); + if (pos != std::string::npos) + vFuncName = vFuncName.substr(pos + 2); + // NOTE: The analyzed function type might not be available here. vftBuilder.AddMember( Type::PointerType(addrSize, vFunc->GetType(), true), vFuncName); -- cgit v1.3.1