我计划对以面向对象方式编写的应用程序进行一些逆向工程。现在我有点好奇 C++ 类在汇编中会是什么样子。我已经找到了有关函数及其调用约定的基础知识。但是类可能要复杂得多,对吗?
所以假设我们有这个类:
class Rectangle {
int width, height;
public:
void set_values (int,int);
int area() {return width*height;}
};
void Rectangle::set_values (int x, int y) {
width = x;
height = y;
}
和这个对象:
Rectangle rect;
rect.set_values (3,4);
组装时会/可能会是什么样子?