请各位看以下常量定义。(system)
{ Virtual method table entries }
vmtSelfPtr = -76;
vmtIntfTable = -72;
vmtAutoTable = -68;
vmtInitTable = -64;
vmtTypeInfo = -60;
vmtFieldTable = -56;
vmtMethodTable = -52;
vmtDynamicTable = -48;
vmtClassName = -44;
vmtInstanceSize = -40;
vmtParent = -36;
vmtSafeCallException = -32;
vmtAfterConstruction = -28;
vmtBeforeDestruction = -24;
vmtDispatch = -20;
vmtDefaultHandler = -16;
vmtNewInstance = -12;
vmtFreeInstance = -8;
vmtDestroy = -4;
vmtQueryInterface = 0;
vmtAddRef = 4;
vmtRelease = 8;
vmtCreateObject = 12;
以上定义负偏移是相对于self指针的。如
class function TObject.GetInterfaceTable: PInterfaceTable;
begin
Result := PPointer(Integer(Self) + vmtIntfTable)^;
end;
self指针正偏移前四字节,如你们说是Vtable 指针.那么 , 这里定义的正偏移是相对于哪个地址的,能否介绍一下哪本书中有这方面的介绍?