复制代码
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看代码 #include "stdafx.h" #include <iostream> using namespace std; class CTestA { public: CTestA(){cout<<"CTestA()n";} ~CTestA(){cout<<"~CTestA()n";} int fun(){ return 10; //eax存放函数返回值 //this指针存放在ecx中 } }; class CTestB { public: CTestB(){cout<<"CTestB()n";} ~CTestB(){cout<<"~CTestB()n";} }; int _tmain(int argc, _TCHAR* argv[]) { CTestA a; a.fun(); CTestB b; return 0; } 查看反汇编代码 int fun(){ 00FC1690 push ebp 00FC1691 mov ebp,esp 00FC1693 sub esp,0CCh 00FC1699 push ebx 00FC169A push esi 00FC169B push edi 00FC169C push ecx 00FC169D lea edi,[ebp-0CCh] 00FC16A3 mov ecx,33h 00FC16A8 mov eax,0CCCCCCCCh 00FC16AD rep stos dword ptr es:[edi] 00FC16AF pop ecx // ecx 0x00b3fe5f unsigned long this指针 + // this 0x00b3fe5f CTestA * const 00FC16B0 mov dword ptr [ebp-8],ecx return 10; 00FC16B3 mov eax,0Ah //此段汇编指令是将0ah 及10 存放在eax中 // eax 0x0000000a unsigned long } 结果是 1、eax常用来存放函数返回值。 2、ecx寄存器用来存放this指针。
最后
以上就是执着咖啡最近收集整理的关于在windbg调试的时候 针对ecx和eax说明的全部内容,更多相关在windbg调试的时候内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复