Developer knowledge network · moderated exchange

Сообщество UnreliableCode

Сообщество разработчиков, обратного проектирования и кодирования

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.