国外某软件 3.47 注册算法分析
来源:互联网 发布:知乎方糖 编辑:程序博客网 时间:2024/04/28 07:48
国外某软件3.47
XXX是一个16位的程序,ne结构,以前破解过3.41版本,在98下面用trw2000破解的,现在的Ollydbg不支持NE结构的程序。奈何?
好在他升级后,加密方式也有所升级,目录下面有个wsLicmgr.exe负责授权校验,是PE结构,于是打算做注册机。
这是个vc的程序,用mfcspy可以看到按钮的事件,
这个call很关键,里面首先对key2进行检验是否合法,然后不停的test,结果影响eax,最终eax是返回值。
00407CA1 .
2个核心的地方,基本上在字符串比较里面,
00409B90 |> /8B5424 40 mov edx,dword ptr ss:[esp+40]
00409B94 |. 68 E
00409B99 |. 52 push edx
00409B
00409B
00409B
00409FC2 |> /8B4424 40 mov eax,dword ptr ss:[esp+40] ; Case C of switch
12e954=结果?
004095FD |. 50 push eax
004095FE |. 64:8925 00000000 mov dword ptr fs:[0],esp
00409605 |. 83EC 24 sub esp,24
00409608 |. 53 push ebx
00409609 |. 56 push esi
0040960B |. 8B4424 48 mov eax,dword ptr ss:[esp+48] ; 12E
12E
后来的f(key2)经过运算应该等于0
有两个小call
00414642 /$ B8 01000000 mov eax,1
00414647 |. 8B
0041464B |. FEC9 dec cl
0041464D |. D3E0 shl eax,cl
00414653 |.
00414656 |. 1BC0 sbb eax,eax
00414658 |. 40 inc eax
00414659 /. C2 0800 retn 8
上面这个call好像没有用处,仅仅是判断返回值eax是否等于1。没有对key进行变换,继续看下面一个call
00414610 /$ B8 01000000 mov eax,1
00414615 |. 8B
00414619 |. FEC9 dec cl
0041461B |. D3E0 shl eax,cl
0041461D |. 8B
00414621 |. F7D0 not eax
00414623 |. 2301 and eax,dword ptr ds:[ecx]
00414625 |. 8901 mov dword ptr ds:[ecx],eax
00414627 /. C2 0800 retn 8
E
UserKey1的码也不是固定的,根据lic种类不同有不同,影响返回值eax,然后根据eax进行跳转。
Eax=1的时候WB
Case eax of
1:WB
2:
3:default case
4:prx
5:prx
6:jmp 8196 contract service upgrade to 1.0
7:jmp
8:WL
9:default
A:83e9 PP
B:default
C:
Else
408b
校验的路径基本清楚了。
Var
Var
Idx : integer;
Idx := VerifyKey1(0x5426,code1,code2,key1);
Case idx of
1: ;
2:;
Default: ;
必须要跳到default
ebx:= VerifyKey1(0x892D,Code1,Code2,key1);
VerifyKey2(0xB5,key2);
0040867B . E8 18D90000 call <WSLICMGR.VerifyKey2> ; check key2
00408680 . 8BE8 mov ebp,eax ß----VerifyKey2的返回值
00408682 . 8BC3 mov eax,ebx ß-- VerifyKey1的返回值
00408684 . 48 dec eax ;Switch (cases 1..2)
00408685 .
0040868B . 48 dec eax
在上面,VerifyKey1必须大于2,
Ret := VerifyKey1(0x
VerifyKey2(0x6B,key2)
00408ABC . E8 09D60000 call <WSLICMGR.VerifyKey1> ; /WSLICMGR.004160CA
00408ACA . FFD7 call edi
00408ACC .
00408ACF . 50 push eax
00408AD0 . E
00408AD5 . 8BF8 mov edi,eax
00408AD7 . 8BC5 mov eax,ebp ß--verifyKey1的返回值,=1
00408AD9 . 48 dec eax ; Switch (cases 1..3)
00408ADA . 74 53 je short WSLICMGR.00408B
00408ADC . 83E8 02 sub eax,2
00408ADF . 74 18 je short WSLICMGR.00408AF9
00408B
00408B31 . 51 push ecx
00408B32 . 8D96
00408B38 . 8BCC mov ecx,esp
00408B
00408B3E . 52 push edx
00408B
00408B44 . 57 push edi
00408B45 . 8BCE mov ecx,esi
00408B47 . E8 E4090000 call <WSLICMGR.VerifySetupCode>
这个call校验SetupCode,”WDL”,成功返回1,也就是这里最终跳到成功的地方。
00408B
00408B4E .^
跟进00408B47处的call
这个函数应该有三个参数,第二个参数应该是setupCode:’WDL’,最后一个参数表示跳转的位置,也就是根据它判断去什么地方跳转,这个参数是很核心的,我也大部分是根据这个参数倒退得到的解法,因为只有这个参数=C才有可能跳转到比较WDL的地方,否则是别的类型,比如WB1,WB2等。现在有点奇怪的是第二个参数居然得不到。难道是key2还有问题?
00409530 <>/$
00409532 |. 68 48344200 push WSLICMGR.00423448 ; SE handler installation
00409537 |. 64:A1 00000000 mov eax,dword ptr fs:[0]
0040953D |. 50 push eax
0040953E |. 64:8925 00000000 mov dword ptr fs:[0],esp
00409545 |. 51 push ecx
00409546 |. 53 push ebx
00409547 |. 55 push ebp
00409548 |. 56 push esi ; "haB"
00409549 |. 57 push edi ; f(key2)
00409550 |. C74424
00409558 |. 50 push eax ; /s
00409559 |. B3 01 mov bl,1 ; |here, assign bl=1
0040955B |. FF15
00409561 |. 8B3D 00544200 mov edi,dword ptr ds:[<&MSVCRT.strtok>] ; MSVCRT.strtok
00409567 |. 8BE8 mov ebp,eax
00409569 |. 68
0040956E |. 55 push ebp ; |s1
00409573 |. FFD7 call edi ; /strtok
00409575 |.
00409578 |.
00409580 |> 8D
00409584 |. 55 |push ebp
00409585 |. 51 |push ecx
00409586 |. 51 |push ecx
00409587 |. 8BCC |mov ecx,esp
00409589 |. 896424 38 |mov dword ptr ss:[esp+38],esp
0040958D |. 50 |push eax
0040958E |. E8 2D7E0100 |call <WSLICMGR.CString::CString(char c>; jmp to MFC42.#537
00409593 |. 8BCE |mov ecx,esi ; |
00409595 |. E8 56000000 |call <WSLICMGR.GetSetupCodeType> ; /check userid in this call
0040959E |. 32DB |xor bl,bl ; fail
004095AE |.^ 75 D0 /jnz short WSLICMGR.00409580
004095B0 |. 8B
004095B4 |> 8B4424 24 mov eax,dword ptr ss:[esp+24] ; f(key2)12E954,very important address
004095B8 |.
004095BA |. 74 02 je short WSLICMGR.004095BE
004095BC |. 32DB xor bl,bl ; fail
004095BE |> 55 push ebp ; /block
004095BF |. FF15 08544200 call dword ptr ds:[<&MSVCRT.free>] ; /free
004095CC |. C74424
004095D4 |. E8 CF7D0100 call <WSLICMGR.CString::~CString(void)> ; jmp to MFC42.#800
004095D9 |. 8B
004095DD |.
004095DE |. 5E pop esi
004095DF |.
004095E1 |. 5D pop ebp
004095E2 |. 64:890D 00000000 mov dword ptr fs:[0],ecx
004095E9 |. 5B pop ebx
004095EA |.
004095ED /. C2
Key1=5270131 (根据第三次的verifyKey1必须=1得到)
Key2=0x52343023 or 0x20000 = 52363023 ->1379282979
(key2 and C284249=42042021) and (key2 and 10311282=111280) and (key2 and 10311282=10301002)
后面2个条件好像没法同时成立,所以取第一个和第三个,因为第三个校验有用。
整理:
根据VerifyKey1写出key1的算法
根据Verifykey2写出key2的算法。
修改VerifySetupCode里面见上
- 国外某软件 3.47 注册算法分析
- 某国外报表软件 Version 5.00 Release Notes注册算法分析
- 某机器人编程软件注册算法分析
- 软件注册算法
- 一款网页模板小偷软件的注册分析(算法+注册机源码)
- DatabaseTool注册算法分析
- LeapFTP注册算法分析
- 注册算法的分析
- flashtools注册算法分析过程
- 密码监听器注册算法分析
- 国外十大著名股票金融分析软件
- 国外域名注册商
- 对某一个软件的注册分析
- 软件保护之注册算法篇
- 一个软件的MD5注册算法
- 软件保护之注册算法篇
- XoftSpy 4.13的注册算法分析 zz
- WebPageMaker 2.2.0 注册算法分析
- 在RHFC3下配置sendmail服务器
- 服务器端文件夹拷贝
- Struts+Spring+Hibernate快速入门
- 一次郁闷的招标会
- 软键盘保护客户密码
- 国外某软件 3.47 注册算法分析
- 使用 JFreeChart来创建基于web的图表
- 软件的需求会变化吗?
- Digester学习笔记
- 开发软件的状态
- blog中的英语资源
- 难得有好心情的一天
- 对package的理解
- 获取分区类型(U盘、硬盘)