- 13


push esi ; ESI = *b

push edi ; ECX = *c

mov esi, ecx ; ESI = *c

call Get_A_VTBL ; c[0]=*A_VTBL

; C A

lea edi, [esi+4] ; EDI = *c[4]

mov ecx, edi ; ECX = **_C_F

call Get_B_VTBL ; c[4]=*B_VTBL

; C

B

; .. C

; . ,

;

mov dword ptr [edi], offset C_VTBL_FORM_B ; c[4]=*_C_VTBL

; ! B

; C

( )

mov dword ptr [esi], offset C_VTBL ; c[0]=C_VTBL

; , A

; C. ,

; !

mov eax, esi ; EAX = *c

pop edi

pop esi

retn

GET_C_VTBLs endp

Get_A_VTBL proc near ; CODE XREF: main+13p GET_C_VTBLs+4p

mov eax, ecx

mov dword ptr [eax], offset A_VTBL

; B

retn

Get_A_VTBL endp

A_F proc near ; DATA XREF: .rdata:004050A8o

; f() A

push offset aA_f ; "A_F\n"

call printf

pop ecx

retn

A_F endp

Get_B_VTBL proc near ; CODE XREF: main+2Ep GET_C_VTBLs+Ep

mov eax, ecx

mov dword ptr [eax], offset B_VTBL

; B

retn

Get_B_VTBL endp

B_F proc near ; DATA XREF: .rdata:004050ACo

; f() B

push offset aB_f ; "B_F\n"