[其它语言] 转-类的逆向分析

907 0
狼毛 2024-5-24 20:24:47 | 显示全部楼层 |阅读模式
类的权限控制只是编译器的产物,在汇编层次无法体现

类的构造函数VC特征
1.调用时,传递this指针。例如:lea     ecx, [ebp+testb] ; this
2.函数内部,先处理this指针。例如:mov     [ebp+this], ecx
3.若是有虚函数,则虚函数表赋值.例如:mov     dword ptr [eax], offset ??_7CTestA@@6B@ ; const CTestA::`vftable'
4.返回this指针.例如:mov     eax, [ebp+this]

类的析构函数VC特征
1.调用时,传递this指针。例如:lea     ecx, [ebp+testb] ; this
2.函数内部,先处理this指针。例如:mov     [ebp+this], ecx
3.若是有虚函数,则虚函数表赋值.mov     dword ptr [eax], offset ??_7CTestA@@6B@ ; const CTestA::`vftable'
4.无返回值

类的成员函数VC特征
1.调用时,传递this指针。例如:lea     ecx, [ebp+testb] ; this
2.函数内部,先处理this指针。例如:mov     [ebp+this], ecx
3.函数地址引用,只有CALL指令。

类的内联成员函数VC特征
与类的成员函数VC特征一样

类的虚成员函数VC特征
1.调用时,传递this指针。例如:lea     ecx, [ebp+testb] ; this
2.函数内部,先处理this指针。例如:mov     [ebp+this], ecx
3.函数地址引用,能在虚表中找到。例如:
.rdata:00402394 ; const CTestA::`vftable'
.rdata:00402394 ??_7CTestA@@6B@ dd offset ?Sub@CTestA@@UAEHHH@Z
.rdata:00402394                                         ; DATA XREF: CTestA::CTestA(int,char,int)+Ao
.rdata:00402394                                         ; CTestA::CTestA(void)+Ao ...
.rdata:00402394                                         ; CTestA::Sub(int,int)
.rdata:00402398                 dd offset ?Sub@CTestA@@UAEHXZ ; CTestA::Sub(void)
.rdata:0040239C                 dd 0
类的内联虚成员函数VC特征
与类的虚成员函数VC特征一样

类的静态成员函数VC特征
1.与普通函数无异。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

狼毛

精英红客

关注
  • 206
    主题
  • 2
    粉丝
  • 1
    关注
这家伙很懒,什么都没留下!

中国红客联盟公众号

联系站长QQ:5520533

admin@chnhonker.com
Copyright © 2001-2025 Discuz Team. Powered by Discuz! X3.5 ( 粤ICP备13060014号 )|天天打卡 本站已运行