????c++?е???????????
???????????? ???????[ 2013/5/24 9:53:45 ] ????????
??????c++???????????????????п???????????????????????????????????????????????????????????????????
??????????????????X????????????????忽??????????c++??????£?
class X {
private:
int i;
int j;
};
int main() {
X x1;//????????x1
X x2 = x1;//??x1??????x2
}
?????????????????
_main PROC
; 7 : int main() {
push ebp
mov ebp?? esp
sub esp?? 16 ; ?????x1??x2???16byte??????
; 8 : X x1;//????????x1
; 9 : X x2 = x1;//??x1??????x2
mov eax?? DWORD PTR _x1$[ebp];??x1?????????????????????eax?????x1?е???????i?????eax
mov DWORD PTR _x2$[ebp]?? eax;??eax??????д??x2????????????eax??????д??x2????????i
mov ecx?? DWORD PTR _x1$[ebp+4];?????x1????4byte??????????????????eax??????x1?е???????j?????ecx
mov DWORD PTR _x2$[ebp+4]?? ecx;??ecx??????д?????x2????4byte????????棬????ecx??????д??x2????????j
; 10 : }
xor eax?? eax
mov esp?? ebp
pop ebp
ret 0
_main ENDP
?????????????????????????????к?????????????е?????????????????????????????????ɡ?????????????????????????????????????????????????????????????????????
?????????????????????????????????????????????????????????
????????????????????X???溬????????????
????c++???
class X {
private:
int i;
int j;
public:
virtual ~X() {}//??????????
};
int main() {
X x1;//????????x1
X x2 = x1;//??x1??????x2
}
???????????????????????????????????????main???????????????????
????????????????main??????????
_main PROC
; 9 : int main() {
push ebp
mov ebp?? esp
sub esp?? 24 ; ???????????麯??????????????????12byte ???????i??j8byte vptr???4byte ????????x1 x2???24byte
; 10 : X x1;//????????x1
lea ecx?? DWORD PTR _x1$[ebp];???x1????????????ecx??????ù????????????????????this
call ??0X@@QAE@XZ;???ù?????
; 11 : X x2 = x1;//??x1??????x2
lea eax?? DWORD PTR _x1$[ebp];???x1????????????????eax
push eax;??eax??????????????????????
lea ecx?? DWORD PTR _x2$[ebp];???x2????????????????ecx?????????????????????????????????this
call ??0X@@QAE@ABV0@@Z;?????????????
; 12 : }
lea ecx?? DWORD PTR _x2$[ebp];???x2????????????ecx??????????????????????????????????????this
call ??1X@@UAE@XZ ; ????????????
lea ecx?? DWORD PTR _x1$[ebp];???x1????????????ecx??????????????????????????????????????this
;????????????????????
call ??1X@@UAE@XZ ; ????????????
xor eax?? eax
mov esp?? ebp
pop ebp
ret 0
_main ENDP
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11