看汇编语言
#include <stdio.h>
struct Date
{
int year;
int month;
int day;
};
struct Book
{
char title[128];
char author[40];
float price;
struct Date date;
char publisher[40];
};
void Fun1(struct Book book)
{
}
void Fun2(struct Book *book)
{
}
int main(void)
{
struct Book book = {0};
Fun1(book);
Fun2(&book);
return 0;
}
有符号名,看起来容易一点int main(void)
{
01011720 55 push ebp
01011721 8B EC mov ebp,esp
01011723 81 EC AC 01 00 00 sub esp,1ACh
01011729 53 push ebx
0101172A 56 push esi
0101172B 57 push edi
0101172C 8D BD 54 FE FF FF lea edi,[ebp-1ACh]
01011732 B9 6B 00 00 00 mov ecx,6Bh
01011737 B8 CC CC CC CC mov eax,0CCCCCCCCh
0101173C F3 AB rep stos dword ptr es:[edi]
0101173E A1 18 90 01 01 mov eax,dword ptr [__security_cookie (01019018h)]
01011743 33 C5 xor eax,ebp
01011745 89 45 FC mov dword ptr [ebp-4],eax
struct Book book = {0};
01011748 68 E0 00 00 00 push 0E0h
0101174D 6A 00 push 0
0101174F 8D 85 18 FF FF FF lea eax,[book]
01011755 50 push eax
01011756 E8 68 F9 FF FF call _memset (010110C3h)
0101175B 83 C4 0C add esp,0Ch
Fun1(book);
0101175E 81 EC E0 00 00 00 sub esp,0E0h
01011764 B9 38 00 00 00 mov ecx,38h
01011769 8D B5 18 FF FF FF lea esi,[book]
0101176F 8B FC mov edi,esp
01011771 F3 A5 rep movs dword ptr es:[edi],dword ptr [esi]
01011773 E8 08 FB FF FF call _Fun1 (01011280h)
01011778 81 C4 E0 00 00 00 add esp,0E0h
Fun2(&book);
0101177E 8D 85 18 FF FF FF lea eax,[book]
01011784 50 push eax
01011785 E8 FB FA FF FF call _Fun2 (01011285h)
0101178A 83 C4 04 add esp,4
return 0;
0101178D 33 C0 xor eax,eax
}
0101178F 52 push edx
01011790 8B CD mov ecx,ebp
01011792 50 push eax
01011793 8D 15 C0 17 01 01 lea edx,ds:[10117C0h]
01011799 E8 B5 FA FF FF call @_RTC_CheckStackVars@8 (01011253h)
0101179E 58 pop eax
0101179F 5A pop edx
010117A0 5F pop edi
010117A1 5E pop esi
010117A2 5B pop ebx
010117A3 8B 4D FC mov ecx,dword ptr [ebp-4]
010117A6 33 CD xor ecx,ebp
010117A8 E8 BA FA FF FF call @__security_check_cookie@4 (01011267h)
010117AD 81 C4 AC 01 00 00 add esp,1ACh
010117B3 3B EC cmp ebp,esp
010117B5 E8 63 F9 FF FF call __RTC_CheckEsp (0101111Dh)
010117BA 8B E5 mov esp,ebp
010117BC 5D pop ebp
010117BD C3 ret
没有符号名int main(void)
{
01011720 55 push ebp
01011721 8B EC mov ebp,esp
01011723 81 EC AC 01 00 00 sub esp,1ACh
01011729 53 push ebx
0101172A 56 push esi
0101172B 57 push edi
0101172C 8D BD 54 FE FF FF lea edi,[ebp+FFFFFE54h]
01011732 B9 6B 00 00 00 mov ecx,6Bh
01011737 B8 CC CC CC CC mov eax,0CCCCCCCCh
0101173C F3 AB rep stos dword ptr es:[edi]
0101173E A1 18 90 01 01 mov eax,dword ptr ds:[01019018h]
01011743 33 C5 xor eax,ebp
01011745 89 45 FC mov dword ptr [ebp-4],eax
struct Book book = {0};
01011748 68 E0 00 00 00 push 0E0h
0101174D 6A 00 push 0
0101174F 8D 85 18 FF FF FF lea eax,[ebp+FFFFFF18h]
01011755 50 push eax
01011756 E8 68 F9 FF FF call 010110C3
0101175B 83 C4 0C add esp,0Ch
Fun1(book);
0101175E 81 EC E0 00 00 00 sub esp,0E0h
01011764 B9 38 00 00 00 mov ecx,38h
01011769 8D B5 18 FF FF FF lea esi,[ebp+FFFFFF18h]
0101176F 8B FC mov edi,esp
01011771 F3 A5 rep movs dword ptr es:[edi],dword ptr [esi]
01011773 E8 08 FB FF FF call 01011280
01011778 81 C4 E0 00 00 00 add esp,0E0h
Fun2(&book);
0101177E 8D 85 18 FF FF FF lea eax,[ebp+FFFFFF18h]
01011784 50 push eax
01011785 E8 FB FA FF FF call 01011285
0101178A 83 C4 04 add esp,4
return 0;
0101178D 33 C0 xor eax,eax
}
0101178F 52 push edx
01011790 8B CD mov ecx,ebp
01011792 50 push eax
01011793 8D 15 C0 17 01 01 lea edx,ds:[010117C0h]
01011799 E8 B5 FA FF FF call 01011253
0101179E 58 pop eax
0101179F 5A pop edx
010117A0 5F pop edi
010117A1 5E pop esi
010117A2 5B pop ebx
010117A3 8B 4D FC mov ecx,dword ptr [ebp-4]
010117A6 33 CD xor ecx,ebp
010117A8 E8 BA FA FF FF call 01011267
010117AD 81 C4 AC 01 00 00 add esp,1ACh
010117B3 3B EC cmp ebp,esp
010117B5 E8 63 F9 FF FF call 0101111D
010117BA 8B E5 mov esp,ebp
010117BC 5D pop ebp
010117BD C3 ret
|