- UID
- 2198
注册时间2005-6-29
阅读权限255
最后登录1970-1-1
副坛主
该用户从未签到
|
软件名称:Skin++ for Visual C++ 2.0
更新时间:2007-02-08
HomePage:http://www.uipower.com/SPDownload.php
下载地址:http://www.uipower.com/skin/vcd/SkinPPDemo-VC.zip
支持的开发语言
Visual C++ 5.0
Visual C++ 6.0
Visual C++ .NET 2002 (7.0)
Visual C++ .NET 2003 (7.1)
Visual C++ .NET 2005 (8.x)
晚上写代码正好要用皮肤控件,所以简单分析一下,网上只有试用版,试用版程序启动的时候弹出一个大大的NAG,我们的目标就是要去掉照顾NAG:
10033081 B8 F8640510 MOV EAX,SkinPPWT.100564F8
10033086 E8 95E60100 CALL <JMP.&MSVCRT._EH_prolog>
1003308B 51 PUSH ECX
1003308C 51 PUSH ECX
1003308D 6A 04 PUSH 4
1003308F 6A 65 PUSH 65
10033091 51 PUSH ECX
10033092 8BCC MOV ECX,ESP
10033094 8965 F0 MOV DWORD PTR SS:[EBP-10],ESP
10033097 68 7C120710 PUSH SkinPPWT.1007127C ; 弹出NAG上的提示信息
;ASCII "UIPower : Skin++ allows you to add skinning ability to your applications.
;For informationon obtaining a license to use this control,
;please visit www.uipower.com or e-mail [email protected]
;Are you registering skin++ now ?"
1003309C E8 F7E9FCFF CALL SkinPPWT.10001A98
100330A1 8365 FC 00 AND DWORD PTR SS:[EBP-4],0
100330A5 51 PUSH ECX
100330A6 8BCC MOV ECX,ESP
100330A8 8965 EC MOV DWORD PTR SS:[EBP-14],ESP
100330AB 68 10030710 PUSH SkinPPWT.10070310 ; ASCII "UIPOWER"
100330B0 E8 E3E9FCFF CALL SkinPPWT.10001A98
100330B5 FF35 A8270710 PUSH DWORD PTR DS:[100727A8] ; SkinPPWT.10000000
100330BB 834D FC FF OR DWORD PTR SS:[EBP-4],FFFFFFFF
100330BF E8 B7F10000 CALL SkinPPWT.1004227B ; 这里弹出NAG
100330C4 83C4 14 ADD ESP,14
100330C7 83F8 06 CMP EAX,6
100330CA 75 18 JNZ SHORT SkinPPWT.100330E4
100330CC 6A 05 PUSH 5
100330CE 6A 00 PUSH 0
100330D0 6A 00 PUSH 0
100330D2 68 64120710 PUSH SkinPPWT.10071264 ; ASCII "http://www.uipower.com"
100330D7 68 5C120710 PUSH SkinPPWT.1007125C ; ASCII "open"
进入CALL看一下:
100422B1 50 PUSH EAX
100422B2 FF15 90850510 CALL DWORD PTR DS:[<&USER32.MessageBoxInd>; user32.MessageBoxIndirectA
哈原来调DX接口了 ~~ 我们一路F8回去,返回该函数后,发现总机关原来在这里:
100331D2 E8 AAFEFFFF CALL SkinPPWT.10033081 ; 调用NAG的函数
于是把这个CALL干掉 ~~ 本以为已经Over了 结果发现程序的标题都被修改为SKIN++ UNREGISTERED!!!
搜索一下ASCII看一下 发现端倪 :
1002AC57 83B8 5C010000 0>CMP DWORD PTR DS:[EAX+15C],0 // 这里作为DLL是否修改的依据
1002AC5E 0F85 C2000000 JNZ SkinPPWT.1002AD26
1002AC64 8B83 90010000 MOV EAX,DWORD PTR DS:[EBX+190]
1002AC6A 6A 0B PUSH 0B
1002AC6C 59 POP ECX
1002AC6D 8DBD 3CFFFFFF LEA EDI,DWORD PTR SS:[EBP-C4]
1002AC73 6A 02 PUSH 2
1002AC75 8DB0 B8100000 LEA ESI,DWORD PTR DS:[EAX+10B8]
1002AC7B 5A POP EDX
1002AC7C F3:A5 REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS:>
1002AC7E 6A 0B PUSH 0B
1002AC80 8DB0 E4100000 LEA ESI,DWORD PTR DS:[EAX+10E4]
1002AC86 59 POP ECX
1002AC87 8DBD 10FFFFFF LEA EDI,DWORD PTR SS:[EBP-F0]
1002AC8D 33C0 XOR EAX,EAX
1002AC8F 8995 3CFFFFFF MOV DWORD PTR SS:[EBP-C4],EDX
1002AC95 3983 40010000 CMP DWORD PTR DS:[EBX+140],EAX
1002AC9B F3:A5 REP MOVS DWORD PTR ES:[EDI],DWORD PTR DS:>
1002AC9D 8995 10FFFFFF MOV DWORD PTR SS:[EBP-F0],EDX
1002ACA3 74 08 JE SHORT SkinPPWT.1002ACAD
1002ACA5 8B8B F4000000 MOV ECX,DWORD PTR DS:[EBX+F4]
1002ACAB EB 1E JMP SHORT SkinPPWT.1002ACCB
1002ACAD 3983 3C010000 CMP DWORD PTR DS:[EBX+13C],EAX
1002ACB3 75 10 JNZ SHORT SkinPPWT.1002ACC5
1002ACB5 3983 38010000 CMP DWORD PTR DS:[EBX+138],EAX
1002ACBB 75 08 JNZ SHORT SkinPPWT.1002ACC5
1002ACBD 8B8B D4000000 MOV ECX,DWORD PTR DS:[EBX+D4]
1002ACC3 EB 06 JMP SHORT SkinPPWT.1002ACCB
1002ACC5 8B8B B4000000 MOV ECX,DWORD PTR DS:[EBX+B4]
1002ACCB 83E9 05 SUB ECX,5
1002ACCE 3943 68 CMP DWORD PTR DS:[EBX+68],EAX
1002ACD1 894D AC MOV DWORD PTR SS:[EBP-54],ECX
1002ACD4 8DB5 3CFFFFFF LEA ESI,DWORD PTR SS:[EBP-C4]
1002ACDA 75 06 JNZ SHORT SkinPPWT.1002ACE2
1002ACDC 8DB5 10FFFFFF LEA ESI,DWORD PTR SS:[EBP-F0]
1002ACE2 68 84070710 PUSH SkinPPWT.10070784 ; SKIN++ UNREGISTERED!!!
初始的赋值来自这里:
1001E30B 833D A4270710 0>CMP DWORD PTR DS:[100727A4],0
1001E312 56 PUSH ESI
1001E313 8B7424 08 MOV ESI,DWORD PTR SS:[ESP+8]
1001E317 74 2A JE SHORT SkinPPWT.1001E343
1001E319 8B46 10 MOV EAX,DWORD PTR DS:[ESI+10]
1001E31C 68 10030710 PUSH SkinPPWT.10070310 ; UIPOWER
1001E321 50 PUSH EAX
1001E322 FF15 10840510 CALL DWORD PTR DS:[<&MSVCRT._mbscmp>] ; msvcrt._mbscmp
1001E328 59 POP ECX
1001E329 85C0 TEST EAX,EAX
1001E32B 59 POP ECX
1001E32C 75 15 JNZ SHORT SkinPPWT.1001E343
1001E32E 837E 18 65 CMP DWORD PTR DS:[ESI+18],65
1001E332 75 0F JNZ SHORT SkinPPWT.1001E343
1001E334 A1 A4270710 MOV EAX,DWORD PTR DS:[100727A4] // 让程序CALL到这里
1001E339 C780 5C010000 0>MOV DWORD PTR DS:[EAX+15C],1 // 这里做的写入
1001E343 56 PUSH ESI // 把这里修改为retn
1001E344 E8 4AF3FFFF CALL SkinPPWT.1001D693
1001E349 5E POP ESI
1001E34A C2 0400 RETN 4
综上所述,我们将弹出NAG的CALL的代码修改:
100331D2 E8 AAFEFFFF CALL SkinPPWT.10033081 // 修改为我们处理过的赋值函数 CALL 1001E334
一共修改四个字节,去掉NAG和效检 应该是比较简约的该法了 ~~
从软件上来看,很不错,从加密上来看作者还是很照顾大家的,我们权当是一个分析案例,当我们能看懂一些流程的时候,尽量不要再使用NOP、JMP之类的方法去处理流程,要善于观察,找出最佳接替方案。
使用上:
在 stdAfx.h 文件中添加:
#include "SkinPPWTL.h"
#pragma comment (lib,"SkinPPWTL.lib")
在App类中的添加所包含的资源文件:
BOOL CMFCMAINSkinApp::InitInstance()
{
skinppLoadSkin(_T("AquaOS.ssk")); // 加上该代码
AfxEnableControlContainer();
……
} |
|