summaryrefslogtreecommitdiff
path: root/plugins/msvc_rtti/rtti.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-10-25 13:13:16 -0400
committerMason Reed <mason@vector35.com>2024-10-25 13:13:16 -0400
commit0840b2860069cf8d1dac47066bfdc3526720de19 (patch)
tree5aec655ade0d7c12bd430c2196afcc7e2fe62f1e /plugins/msvc_rtti/rtti.cpp
parent3452ee25b9aebdddf694f45b4273ab76ca1bc847 (diff)
Use module workflows in MSVC RTTI
MSVC RTTI information will be applied on open to all windows platforms now
Diffstat (limited to 'plugins/msvc_rtti/rtti.cpp')
-rw-r--r--plugins/msvc_rtti/rtti.cpp10
1 files changed, 9 insertions, 1 deletions
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<VirtualFunctionTableInfo> 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);