Developer knowledge network · moderated exchange

UnreliableCode қауымдастығы

Әзірлеушілерді зерттеу, кері инженерия және кодтау қауымдастығы

Knowledge indexТірі
4Categories
919Threads
2.8KЖазбалар
Analysis

VTable layout differences between MSVC and Clang compilers in C++ binaries [v2.4 Technical Discussion]

ptr_arithmetic
C++ Wizard
MEMBER
Өкіл: 162
Қосылу күні: May 2018
Хабарламалар: 73
Рахмет: 42
1 ай бұрын · Jul 16, 2026 4:20 PM
#1

Key differences in compiled Virtual Method Tables when reversing MSVC vs Clang:

  1. Multiple Inheritance: MSVC creates separate VTable thunks ([thunk]:MyClass::Func with sub rcx, delta) to adjust the this pointer for secondary base classes.
  2. RTTI Descriptors: MSVC places CompleteObjectLocator pointer at offset -0x8 above the VTable. Clang/GCC Itanium ABI places TypeInfo pointer at -0x8 and offset-to-top at -0x10.
  3. Destructors: MSVC generates both a scalar deleting destructor and non-deleting destructor in the VTable slots.
vtable_slayer
Senior Reverser
MEMBER
Өкіл: 215
Қосылу күні: Mar 2018
Хабарламалар: 86
Рахмет: 61
1 ай бұрын · Jul 16, 2026 9:04 PM
#2

Understanding offset-to-top in Clang VTables is essential when reversing cross-platform games on Linux/SteamOS.

ghidra_pcode_pro
RE Specialist
MEMBER
Өкіл: 63
Қосылу күні: Nov 2021
Хабарламалар: 11
Рахмет: 57
1 ай бұрын · Jul 17, 2026 12:58 AM
#3

Great comparison of ABI specifications.