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 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
void fp(int *a){
004113A0 push ebp
004113A1 mov ebp,esp
004113A3 sub esp,0C0h
004113A9 push ebx
004113AA push esi
004113AB push edi
004113AC lea edi,[ebp-0C0h]
004113B2 mov ecx,30h
004113B7 mov eax,0CCCCCCCCh
004113BC rep stos dword ptr es:[edi]
(*a)++;
004113BE mov eax,dword ptr [a]
004113C1 mov ecx,dword ptr [eax]
004113C3 add ecx,1
004113C6 mov edx,dword ptr [a]
004113C9 mov dword ptr [edx],ecx
}
004113CB pop edi
004113CC pop esi
004113CD pop ebx
004113CE mov esp,ebp
004113D0 pop ebp
004113D1 ret
//...
void fr(int &a){
004113E0 push ebp
004113E1 mov ebp,esp
004113E3 sub esp,0C0h
004113E9 push ebx
004113EA push esi
004113EB push edi
004113EC lea edi,[ebp-0C0h]
004113F2 mov ecx,30h
004113F7 mov eax,0CCCCCCCCh
004113FC rep stos dword ptr es:[edi]
a++;
004113FE mov eax,dword ptr [a]
00411401 mov ecx,dword ptr [eax]
00411403 add ecx,1
00411406 mov edx,dword ptr [a]
00411409 mov dword ptr [edx],ecx
}
0041140B pop edi
0041140C pop esi
0041140D pop ebx
0041140E mov esp,ebp
00411410 pop ebp
00411411 ret
//...
int main(){
00413040 push ebp
00413041 mov ebp,esp
00413043 sub esp,0E4h
00413049 push ebx
0041304A push esi
0041304B push edi
0041304C lea edi,[ebp-0E4h]
00413052 mov ecx,39h
00413057 mov eax,0CCCCCCCCh
0041305C rep stos dword ptr es:[edi]
int a=0;
0041305E mov dword ptr [a],0
int &b=a;
00413065 lea eax,[a]
00413068 mov dword ptr [b],eax
int *c=&a;
0041306B lea eax,[a]
0041306E mov dword ptr [c],eax
fp(c);
00413071 mov eax,dword ptr [c]
00413074 push eax
00413075 call fp (4111D1h)
0041307A add esp,4
fr(b);
0041307D mov eax,dword ptr [b]
00413080 push eax
00413081 call fr (4111D6h)
00413086 add esp,4
b++;
00413089 mov eax,dword ptr [b]
0041308C mov ecx,dword ptr [eax]
0041308E add ecx,1
00413091 mov edx,dword ptr [b]
00413094 mov dword ptr [edx],ecx
return 0;
00413096 xor eax,eax
}
00413098 push edx
00413099 mov ecx,ebp
0041309B push eax
0041309C lea edx,[ (4130C0h)]
004130A2 call @ILT+130(@_RTC_CheckStackVars@8) (411087h)
004130A7 pop eax
004130A8 pop edx
004130A9 pop edi
004130AA pop esi
004130AB pop ebx
004130AC add esp,0E4h
004130B2 cmp ebp,esp
004130B4 call @ILT+310(__RTC_CheckEsp) (41113Bh)
004130B9 mov esp,ebp
004130BB pop ebp
004130BC ret
|