I am learning about virtual function tables and their representation by analyzing a binary of a simple program written in Visual C++ (with some optimizations on).
A few days ago I asked this question while being stuck on virtual method table content with identical COMDAT folding on.
Now I'm stuck on something else: whenever I analyze a class, I need to find its Virtual Method Table. I can do this by finding either its RTTITypeDescriptor
or _s_RTTIClassHierarchyDescriptor
, finding a cross reference on it, which should lead me to the _RTTICompleteObjectLocator
. When I find a cross reference to the Complete Object Locator, it is written just before the VMT (basically -1st entry of the VMT).
This approach works on some classes (their names start with C
in my program). Then there are classes, that are named with I
in the beginning and I am able to pair them with other classes starting with C
-- for example there is class CClass
and it inherits from IClass
. These I
-classes are probably serving as interfaces to the C
-classes and thus they probably only contain abstract methods.
By searching a cross reference to Type Descriptor or Class Hierarchy Descriptor of any of the I
-classes I cannot find anything -- there is no Complete Object Locator that would lead me to the VMT of the class (that should be full of references to pure_virtual
call if I am correct about the all-abstract methods in the I
-classes and if I understand correctly what VMT of abstract class looks like).
Why do the I
-classes have no VMT? Did the compiler optimize it out because it would just be full of references to pure_virtual
call and manages it in a different way?