2 c++ virtual-functions reverse-engineering
我刚刚在VS2010上编译了以下内容(优化已关闭).
class Shape {
public:
int x,y;
Shape() {
x=10;
y=20;
}
virtual void function1() {
cout<<"function1";
}
virtual void function2() {
cout<<"function2";
}
};
int main() {
Shape *s = new Shape();
s->function1();
s->function2();
return 0;
}
Run Code Online (Sandbox Code Playgroud)
反汇编不显示与虚函数对应的代码块或对它的任何调用,因此我假设这是因为使用vftable查找虚函数的方式.我正在使用IDA Pro,因此可能无法解决此类问题.如果我错了,请纠正我.
我在这方面也有一些疑问.
| 归档时间: |
|
| 查看次数: |
1384 次 |
| 最近记录: |