Developer knowledge network · moderated exchange

UnreliableCode-Community

Community für Entwicklerforschung, Reverse Engineering und Codierung

Knowledge indexLive
4Categories
919Threads
2.8KBeiträge
Analysis

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

ptr_arithmetic
C++ Wizard
MEMBER
Vertreter: 162
Beitrittsdatum: May 2018
Beiträge: 73
Danke: 42
Vor 1 Monaten · 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
Vertreter: 215
Beitrittsdatum: Mar 2018
Beiträge: 86
Danke: 61
Vor 1 Monaten · 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
Vertreter: 63
Beitrittsdatum: Nov 2021
Beiträge: 11
Danke: 57
Vor 1 Monaten · Jul 17, 2026 12:58 AM
#3

Great comparison of ABI specifications.