Skip to content

Commit 7e96253

Browse files
committed
Fix CModule::GetVirtualTableByName method on Windows side
1 parent 9137994 commit 7e96253

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/windows/module.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ CMemory CModule::GetVirtualTableByName(const std::string_view svTableName, bool
156156
return DYNLIB_INVALID_MEMORY;
157157

158158
CMemory rttiTypeDescriptor = typeDescriptorName.Offset(-0x10);
159-
const uintptr_t rttiTDRva = rttiTypeDescriptor - GetBase(); // The RTTI gets referenced by a 4-Byte RVA address. We need to scan for that address.
159+
uintptr_t rttiTDRva = rttiTypeDescriptor.GetAddr() - GetBase().GetAddr(); // The RTTI gets referenced by a 4-Byte RVA address. We need to scan for that address.
160160

161161
CMemory reference;
162-
while ((reference = FindPattern(rttiTDRva, "xxxx", reference, pReadOnlyData))) // Get reference typeinfo in vtable
162+
while ((reference = FindPattern(&rttiTDRva, "xxxx", reference, pReadOnlyData))) // Get reference typeinfo in vtable
163163
{
164164
// Check if we got a RTTI Object Locator for this reference by checking if -0xC is 1, which is the 'signature' field which is always 1 on x64.
165165
// Check that offset of this vtable is 0

0 commit comments

Comments
 (0)