I would like to ask you what the offset of the virtual function table for the class depends on. I mean, what I read at least depends on the compiler, but does it change from class to class?
Edit: by offset I mean the position of the table relative to the address of the owner object.
Edit: sample code:
void **vtable = *((void***)(((char*)object)+offset)); int **ivtable=(int **)vtable; void* firstFunction = (void*) ivtable[0];
There is a certain dependence on the exact class.
, ++ (MI). MI , . , . , 0.
MI vtables: , . vtable MI.
MI , . , SecondBase* Derived sizeof(FirstBase), - Derived.
SecondBase*
Derived
sizeof(FirstBase)
, / ++ Windows . Microsoft COM , ++- COM- Windows ++.
, - , (1- , ), - . , "" ( virtual ).
.
Source: https://habr.com/ru/post/1729748/More articles:What is the advantage of themes over CSS in ASP.NET? - cssPHP Regular expression to search for images starting with _ - phpHow to avoid output (for XHTML) in mako? - pythonOverloaded C ++ method in a derived class - c ++Random identifier generator matching the same column - java.NET security error accessing external API - securityКак организовать приложение для приложений - pythonPhp / MySQL Store custom searches between pages so the user can return to them - phpHow can I get the Asp.net MVC browse dialog from the Views folder? - asp.net-mvcConvert duplicate binary to decimal (series expression?) - binaryAll Articles