#include
#include
class baseA
{
public:
virtual void PrintScreen()
{
int c = 5;
printf("a100 = %d\n", c);
};
virtual void Add(int a, int b)
{
int c = a+b;
printf("a100 = %d\n", c);
};
void PrintScreen(int a, int b, int c)
{
int d = a+b+c;
char name[16];
strcpy(name, "aspedit");
double dd = 12.34;
printf("a100 = %d\n", d);
};
int temp;
};
class baseB : public baseA
{
public:
virtual void PrintScreen()
{
printf("b200\n");
};
virtual void Add(int a, int b)
{
int c = a+b;
printf("b200 = %d\n", c);
};
};
class baseC : public baseB
{
public:
virtual void PrintScreen()
{
printf("C300\n");
};
virtual void Add(int a, int b)
{
int c = a+b;
printf("C300 = %d\n", c);
};
};
int main(int argc, char * argv[])
{
baseA *p = new baseC;
baseB *pB = new baseB;
baseC *pC = new baseC;
p->PrintScreen(2, 3, 10);
pB->PrintScreen();
//baseB *pb = dynamic_cast(p);
//baseC *pC = (baseC *)(p);
baseB *pb = new baseB;
p = (baseA *)pb;
pb->PrintScreen();
return 0;
}
/********************************************/
EAX = 00AEF050 EBX = 7FFDA000 ECX = 00AEDB80 EDX = 00AEF050 ESI = 7C91005D EDI = 00161378
EIP = 00401200 ESP = 0013FE9C EBP = 0013FEDC EFL = 00000206
ESP = 0013FE98
参数空间
返回地址
push ebp
mov ebp, esp
stack空间
类地址
u winmain 反汇编
bc 0-1 清除断点
bp winmain 加断点
u printscreen
bu winmain
u main
bu main
bl
u test!baseA::PrintScreen
u test!baseA::PrintScreen (void)
u 00401440
k
r
ed 0013fe94 0
.restart /f
.detach
?6d1
t
p
.restart
阅读(999) | 评论(1) | 转发(0) |