欢迎来到 嗅灵易学

零基础也能上手的脚本技术课,一对一答疑带你入门

3Dmark2003算法研究 (14千字)

3Dmark2003算法研究 (14千字)

标题:3Dmark2003注册号的算法研究
软件:3Dmark 2003
版本:3.1.3.0
下载网站:www.mydrivers.com
破解者:  火翼[CCG]
组织 :    [CCG]  (China Cracking Group)
使用软件: OllyDbg+Ida430
昨天才出来的软件,官方下载地址没提供注册号(官方当然不会提供)。
用IDA反汇编,搜索"Incorrect registration code."在41D8CA找到对这个字符串的调用,向上可以在0041D81E找到关键判断
.text:0041D81E                call    sub_405190 //关键判断
.text:0041D823                add    esp, 4
.text:0041D826                test    al, al
.text:0041D828                lea    ecx, [ebp+var_6C]
.text:0041D82B                jz      loc_41D8CA
跟进去之后,代码如下
.text:00405190                push    0FFFFFFFFh
.text:00405192                push    offset loc_596D31
.text:00405197                mov    eax, large fs:0
.text:0040519D                push    eax
.text:0040519E                mov    large fs:0, esp
.text:004051A5                sub    esp, 40h
.text:004051A8                mov    eax, dword_611F00
.text:004051AD                xor    eax, [esp+4Ch]
.text:004051B1                push    ebx
.text:004051B2                push    ebp
.text:004051B3                push    esi
.text:004051B4                push    edi
.text:004051B5                mov    edi, [esp+5Ch+arg_0]
.text:004051B9                mov    ecx, edi
.text:004051BB                mov    [esp+5Ch+var_10], eax
.text:004051BF                call    ?size@?
              $basic_string@DU?$char_traits@D@std@@V?
              $allocator@D@2@@std@@QBEIXZ //MFC字符串类的方法
                                          //得到字符串长度
.text:004051C5                cmp    eax, 17h
                                          //看输入的是否是23
                                          //个字符
.text:004051C8                jnz    loc_40540C
.text:004051CE                push    5
.text:004051D0                mov    ecx, edi
.text:004051D2                call    ??A?$basic_string@DU?
                          $char_traits@D@std@@V?$allocator@D
                          @2@@std@@QBEABDI@Z //取字符串的第6
                                              //个字符
.text:004051D8                cmp    byte ptr [eax], 2Dh
                                              //和"-"比较
以下还有两处,判断第12位和第18位是不是"-"
.text:00405207                push    offset
            a5azuhNzcd6La83 ; "5AZUH-NZCD6-LA83C-RW5KS"
                                //黑名单
.text:0040520C                push    edi
.text:0040520D                call    ds:??8std@@YA_NABV?
                $basic_string@DU?$char_traits@D@std@@V?
                $allocator@D@2@@0@PBD@Z //字符串比较
.text:00405213                add    esp, 8
.text:00405216                test    al, al
.text:00405218                jnz    loc_40540C //相等就跳
现在开始时注册号的计算过程
一共分为3段
(1)把输入的字符串在字符表B2CD6FHJ1LN4RSTE3VWX8YZA0Q7MUK9P5
  中的位置写道内存中
  对应ZA5UH-NZCD6-LA83C-RW5KS
  在内存中的数字就是
  16 17 20 1C 06 - 
  0A 16 02 03 04 -
  09 17 14 10 02 -
  0C 12 20 1D 0D
每个数字占32位,“-“用ffffffff代表
代码如下
.text:0040521E                lea    ecx, [esp+30h]
.text:00405222                call    ds:??0?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@XZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::basic_string<char,std::char_traits<char>,std::allocator<char>>(void)
.text:00405228                lea    esi, [esp+30h]
.text:0040522C                mov    dword ptr [esp+58h], 0
.text:00405234                call    sub_404A20
.text:00405239                mov    ecx, edi
.text:0040523B                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:00405241                push    eax
.text:00405242                lea    ecx, [esp+5Ch+var_38]
.text:00405246                call    sub_405160
.text:0040524B                mov    ecx, edi
.text:0040524D                mov    byte ptr [esp+58h], 1
.text:00405252                xor    ebx, ebx
.text:00405254                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:0040525A                test    eax, eax
.text:0040525C                mov    esi, [esp+24h]
.text:00405260                jbe    short loc_405298
.text:00405262
.text:00405262 loc_405262:                            ; CODE XREF: sub_405190+106j
.text:00405262                push    ebx
.text:00405263                mov    ecx, edi
.text:00405265                call    ds:??A?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEABDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::operator[](uint)
.text:0040526B                movsx  eax, byte ptr [eax]
.text:0040526E                push    0
.text:00405270                push    eax
.text:00405271                lea    ecx, [esp+5Ch+var_24]
.text:00405275                call    ds:?find@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIDI@Z ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::find(char,uint)
.text:0040527B                mov    ecx, ds:?npos@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@2IB ; uint const std::basic_string<char,std::char_traits<char>,std::allocator<char>>::npos
.text:00405281                cmp    eax, [ecx]
.text:00405283                jnz    short loc_405288
.text:00405285                or      eax, 0FFFFFFFFh
.text:00405288
.text:00405288 loc_405288:                            ; CODE XREF: sub_405190+F3j
.text:00405288                mov    [esi+ebx*4], eax
.text:0040528B                mov    ecx, edi
.text:0040528D                inc    ebx
.text:0040528E                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:00405294                cmp    ebx, eax
.text:00405296                jb      short loc_405262
.text:00405298
.text:00405298 loc_405298:                            ;
(2)对内存中的编号进行运算得到正确的8个数
算法如下
前三个数是把前三段的头四个字符对应的编号相加再对21取余,
第4个数是把第5,11,17个字符的编号相加再对21取余,
第5个数是第11,17,19个字符的编号相加再对21取余,
第6个数是把第17,19,20个字符的编号相加再对21取余,
第7个数是把第19,20,21个字符的编号相加再对21取余,
第8个数是把第20,21,22个字符的编号相加再对21取余,
对应ZA5UH-NZCD6-LA83C-RW5KS
第一个
1  2  3  4       
16+17+20+1C=69 %21=06
第二个
9  8  10  7       
02+16+03+0A=25 %21=04
第三个
15 14 13 16         
14+17+09+10=44 %21=02
第四个
5  17 11       
06+02+04=0C %21=0C
第五个
17 11 19       
02+04+0C=12 %21=12
第六个
20 17 19       
12+02+0C=20 %21=20
第七个
19 20 21       
0C+12+20=3E %21=1D
第八个
22 20 21       
1D+12+20=4F %21=0D
CODE XREF: sub_405190+D0j
.text:00405298                lea    ecx, [esp+54h+var_24]
.text:0040529C                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:004052A2                mov    ebx, [esi+4]
.text:004052A5                mov    edi, [esi+0Ch]
.text:004052A8                mov    edx, [esi]
.text:004052AA                mov    ecx, eax
.text:004052AC                mov    eax, [esi+8]
.text:004052AF                add    eax, ebx
.text:004052B1                add    eax, edi
.text:004052B3                add    eax, edx
.text:004052B5                xor    edx, edx
.text:004052B7                div    ecx
.text:004052B9                lea    ecx, [esp+4Ch+var_1C]
.text:004052BD                mov    edi, edx
.text:004052BF                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:004052C5                mov    ebp, [esi+20h]
.text:004052C8                mov    ebx, [esi+1Ch]
.text:004052CB                mov    edx, [esi+24h]
.text:004052CE                mov    ecx, eax
.text:004052D0                mov    eax, [esi+18h]
.text:004052D3                add    eax, ebp
.text:004052D5                add    eax, ebx
.text:004052D7                add    eax, edx
.text:004052D9                xor    edx, edx
.text:004052DB                div    ecx
.text:004052DD                lea    ecx, [esp+30h]
.text:004052E1                mov    ebx, edx
.text:004052E3                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:004052E9                mov    ebp, [esi+38h]
.text:004052EC                mov    edx, [esi+34h]
.text:004052EF                mov    ecx, eax
.text:004052F1                mov    eax, [esi+30h]
.text:004052F4                add    eax, ebp
.text:004052F6                mov    ebp, [esi+3Ch]
.text:004052F9                add    eax, edx
.text:004052FB                add    eax, ebp
.text:004052FD                xor    edx, edx
.text:004052FF                div    ecx
.text:00405301                lea    ecx, [esp+30h]
.text:00405305                mov    ebp, edx
.text:00405307                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:0040530D                mov    edx, [esi+40h]
.text:00405310                mov    ecx, eax
.text:00405312                mov    eax, [esi+10h]
.text:00405315                add    eax, edx
.text:00405317                add    eax, [esi+28h]
.text:0040531A                xor    edx, edx
.text:0040531C                div    ecx
.text:0040531E                lea    ecx, [esp+30h]
.text:00405322                mov    [esp+34h+var_24], edx
.text:00405326                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:0040532C                mov    edx, [esi+28h]
.text:0040532F                mov    ecx, eax
.text:00405331                mov    eax, [esi+40h]
.text:00405334                add    eax, edx
.text:00405336                add    eax, [esi+48h]
.text:00405339                xor    edx, edx
.text:0040533B                div    ecx
.text:0040533D                lea    ecx, [esp+2Ch+arg_0]
.text:00405341                mov    [esp+2Ch+var_18], edx
.text:00405345                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:0040534B                mov    edx, [esi+4Ch]
.text:0040534E                mov    ecx, eax
.text:00405350                mov    eax, [esi+40h]
.text:00405353                add    eax, edx
.text:00405355                add    eax, [esi+48h]
.text:00405358                xor    edx, edx
.text:0040535A                div    ecx
.text:0040535C                lea    ecx, [esp+30h]
.text:00405360                mov    [esp+18h], edx
.text:00405364                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:0040536A                mov    edx, [esi+48h]
.text:0040536D                mov    ecx, eax
.text:0040536F                mov    eax, [esi+4Ch]
.text:00405372                add    eax, edx
.text:00405374                add    eax, [esi+50h]
.text:00405377                xor    edx, edx
.text:00405379                div    ecx
.text:0040537B                lea    ecx, [esp+30h]
.text:0040537F                mov    [esp+1Ch], edx
.text:00405383                call    ds:?size@?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QBEIXZ ; std::basic_string<char,std::char_traits<char>,std::allocator<char>>::size(void)
.text:00405389                mov    edx, [esi+54h]
.text:0040538C                mov    ecx, eax
.text:0040538E                mov    eax, [esi+4Ch]
.text:00405391                add    eax, edx
.text:00405393                add    eax, [esi+50h]
.text:00405396                xor    edx, edx
.text:00405398                div    ecx
(3)把这八个数和输入注册号的对应位编号比较
第一个 5位
第二个 11位
第三位 17位
第四个 19位
第五个 20位
第六个 21位
第七个 22位
第八个 23位
代码如下
.text:0040539A                cmp    [esi+10h], edi //1
.text:0040539D                jnz    short loc_4053F1
.text:0040539F                cmp    [esi+28h], ebx//2
.text:004053A2                jnz    short loc_4053F1
.text:004053A4                cmp    [esi+40h], ebp//3
.text:004053A7                jnz    short loc_4053F1
.text:004053A9                mov    eax, [esp+10h]
.text:004053AD                cmp    [esi+48h], eax//4
.text:004053B0                jnz    short loc_4053F1
.text:004053B2                mov    ecx, [esp+14h]
.text:004053B6                cmp    [esi+4Ch], ecx//5
.text:004053B9                jnz    short loc_4053F1
.text:004053BB                mov    eax, [esp+14h+arg_0]
.text:004053BF                cmp    [esi+50h], eax//6
.text:004053C2                jnz    short loc_4053F1
.text:004053C4                mov    ecx, [esp+1Ch]
.text:004053C8                cmp    [esi+54h], ecx//7
.text:004053CB                jnz    short loc_4053F1
.text:004053CD                cmp    [esi+58h], edx//8
.text:004053D0                jnz    short loc_4053F1
.text:004053D2                lea    ecx, [esp+20h]
总结
注册号生成算法如下
先在字符串B2CD6FHJ1LN4RSTE3VWX8YZA0Q7MUK9P5中任取12位
组成XXXXa-XXXXb-XXXXc-defgh形的字串,X为任取的字符,
a,b,c位对应的前面4个字符在字符串B2CD6FHJ1LN4RSTE3VWX8YZA0Q7MUK9P5中的位置编号(16进制)相加再对21(16进制)取余得到数字对应位置的字符,d为a,b,c位置编号相加再对21取余得到数字对应位置的字符,e为b,c,d位置编号相加再对21取余得到数字对应位置的字符,f为c,d,e位置编号相加再对21取余得到数字对应位置的字符,g为d,e,f位置编号相加再对21取余得到数字对应位置的字符,h为e,f,g位置编号相加再对21取余得到数字对应位置的字符。

注意:上传附件及图片大小不得大于30M。

⚠️ 版权声明:
本博客所有内容(含教程、源码、工具)仅供个人技术学习与研究交流使用,严禁商用、倒卖、二次分发及非法用途
未经作者书面授权,任何组织或个人不得转载、复制或用于其他平台,违者将追究相关责任。

0 0 0 举报
复制成功