1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
| 19: int main(int argc, char* argv[]) 20: { 00401010 push ebp 00401011 mov ebp,esp 00401013 sub esp,6Ch 00401016 push ebx 00401017 push esi 00401018 push edi 00401019 lea edi,[ebp-6Ch] 0040101C mov ecx,1Bh 00401021 mov eax,0CCCCCCCCh 00401026 rep stos dword ptr [edi] 21: tagPerson p = { 22: "jack", //+0 00401028 mov eax,[string "jack" (00426024)] ;内存地址赋值给eax寄存器 0040102D mov dword ptr [ebp-28h],eax 00401030 mov cl,byte ptr [string "jack"+4 (00426028)] ;补个\0,对齐 00401036 mov byte ptr [ebp-24h],cl 23: 15, //+8 00401039 mov dword ptr [ebp-20h],0Fh ;赋值 24: 250.0, //+16 00401040 mov dword ptr [ebp-18h],0 00401047 mov dword ptr [ebp-14h],406F4000h ;double类型占8字节,所以需要两次赋值 25: 172, //+24 0040104E mov word ptr [ebp-10h],offset main+42h (00401052) 26: 3.14, //+28 00401054 mov dword ptr [ebp-0Ch],4048F5C3h 27: 'M' //+32 28: }; 0040105B mov byte ptr [ebp-8],4Dh 29: struct tagPerson *pPer = &p; 0040105F lea edx,[ebp-28h] 00401062 mov dword ptr [ebp-2Ch],edx ;将p的地址赋值给指针变量pPer 30: printf("%d\n",sizeof(p)); 00401065 push 28h 00401067 push offset string "%d\n" (00426020) 0040106C call printf (004010e0) 00401071 add esp,8 31: printf("%d\n",p.wHeight); //+24 00401074 movsx eax,word ptr [ebp-10h] 00401078 push eax 00401079 push offset string "%d\n" (00426020) 0040107E call printf (004010e0) 00401083 add esp,8 32: printf("%f\n",pPer->f); //+28 00401086 mov ecx,dword ptr [ebp-2Ch] 00401089 fld dword ptr [ecx+1Ch] 0040108C sub esp,8 0040108F fstp qword ptr [esp] 00401092 push offset string "%f\n" (0042601c) 00401097 call printf (004010e0) 0040109C add esp,0Ch 33: return 0; 0040109F xor eax,eax 34: }
|