【文章标题】: CloneDVD Version 4.3.0.2注册算法分析
【软件名称】: CloneDVD Version 4.3.0.2算法
【下载地址】: 自己搜索下载
【保护方式】: 猛壳
【操作平台】: xp
【作者声明】: 只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
--------------------------------------------------------------------------------
【详细过程】
软件下好后,查壳,ASProtect v1.23 RC1 *。直接用fly OD带壳调试。用F12暂停法很容易找到关键代码段。
代码:
**************************************算法1部分1************************************** 60707090 /$ 6A FF push -1 60707092 |. 68 E8F97060 push Configur.6070F9E8 ; SE 句柄安装 60707097 |. 64:A1 00000000 mov eax,dword ptr fs:[0] 6070709D |. 50 push eax 6070709E |. 64:8925 00000000 mov dword ptr fs:[0],esp 607070A5 |. 83EC 0C sub esp,0C 607070A8 |. 53 push ebx 607070A9 |. 55 push ebp 607070AA |. 56 push esi 607070AB |. 57 push edi 607070AC |. 8BD9 mov ebx,ecx 607070AE |. 33ED xor ebp,ebp 607070B0 |. 8D4C24 2C lea ecx,dword ptr ss:[esp+2C] 607070B4 |. 896C24 24 mov dword ptr ss:[esp+24],ebp 607070B8 |. 33FF xor edi,edi 607070BA |. E8 495F0000 call <jmp.&MFC42.#4204> 607070BF |. 8B4424 2C mov eax,dword ptr ss:[esp+2C] ; EAX=假码 607070C3 |. 8B70 F8 mov esi,dword ptr ds:[eax-8] ; EAX的长度 607070C6 |. 4E dec esi 607070C7 |. 3BF5 cmp esi,ebp ; 判断长度是否大于0 607070C9 |. 0F8C 80000000 jl Configur.6070714F ; 注册码生成算法与邮箱无关,用户名无关 607070CF |. 83C3 04 add ebx,4 607070D2 |. 895C24 14 mov dword ptr ss:[esp+14],ebx ; EBX="3456789ABCDEFGHJKLMNPQRSTUVWXY" 60707106 |. E8 F15E0000 |call <jmp.&MFC42.#2764> ; 返回假码在字符串的位置,若不在字符串中则返回-1 6070710B |. 8D4C24 18 |lea ecx,dword ptr ss:[esp+18] 6070710F |. 8BD8 |mov ebx,eax ; (A) 60707111 |. C64424 24 01 |mov byte ptr ss:[esp+24],1 60707116 |. E8 895C0000 |call <jmp.&MFC42.#800> 6070711B |. 8BC3 |mov eax,ebx ; (A) 6070711D |. B9 1E000000 |mov ecx,1E ; ECX=0x1E 60707122 |. 99 |cdq 60707123 |. F7F9 |idiv ecx ; 带符号除法 60707125 |. 6A 00 |push 0 ; 60707127 |. 51 |push ecx ; 60707128 |. 55 |push ebp 60707129 |. 57 |push edi 6070712A |. 8BDA |mov ebx,edx ; 把结果放到EBX (B) 6070712C |. E8 6F630000 |call Configur.6070D4A0 ; 这里得出的EAX很重要 || 6070D4A0 /$ 8B4424 08 mov eax,dword ptr ss:[esp+8] ; EAX=EBP,前面压入了EBP 6070D4A4 |. 8B4C24 10 mov ecx,dword ptr ss:[esp+10] ; ECX=0 6070D4A8 |. 0BC8 or ecx,eax ; 若结果为0,ZF置1,不跳,这里跳不跳由EBP决定 6070D4AA |. 8B4C24 0C mov ecx,dword ptr ss:[esp+C] ; ECX=0x1E 6070D4AE |. 75 09 jnz short Configur.6070D4B9 6070D4B0 |. 8B4424 04 mov eax,dword ptr ss:[esp+4] ; EAX=EDI 6070D4B4 |. F7E1 mul ecx ; EAX=EDI*0x1E,EDX保存进位位 6070D4B6 |. C2 1000 retn 10 6070D4B9 |> 53 push ebx 6070D4BA |. F7E1 mul ecx ; EAX=EBP*0x1E 6070D4BC |. 8BD8 mov ebx,eax 6070D4BE |. 8B4424 08 mov eax,dword ptr ss:[esp+8] ; EAX=EDI 6070D4C2 |. F76424 14 mul dword ptr ss:[esp+14] ; [ESP+14]=0 6070D4C6 |. 03D8 add ebx,eax ; 6070D4C8 |. 8B4424 08 mov eax,dword ptr ss:[esp+8] ; EAX=EDI 6070D4CC |. F7E1 mul ecx ; EAX*=0x1E,EDX保存进位位 6070D4CE |. 03D3 add edx,ebx ; EDX+=EBX 6070D4D0 |. 5B pop ebx ; 6070D4D1 \. C2 1000 retn 10 || 60707131 |. 8BC8 |mov ecx,eax ; ECX=EAX 60707133 |. 8BC3 |mov eax,ebx ; (B) 60707135 |. 8BEA |mov ebp,edx ; EBP=EDX 60707137 |. C64424 24 00 |mov byte ptr ss:[esp+24],0 6070713C |. 99 |cdq 6070713D |. 03C8 |add ecx,eax ; 这里的结果很重要 6070713F |. 8BF9 |mov edi,ecx ; 总结果保存在EDI 60707141 |. 8D4C24 10 |lea ecx,dword ptr ss:[esp+10] 60707145 |. 13EA |adc ebp,edx ; EBP保存有关进位的运算结果 60707147 |. E8 585C0000 |call <jmp.&MFC42.#800> 6070714C |. 4E |dec esi ; ESI自减,完成循环 6070714D |.^ 79 87 \jns short Configur.607070D6 6070714F |> 8D4C24 2C lea ecx,dword ptr ss:[esp+2C] ; 60707153 |. C74424 24 FFFFFFFF mov dword ptr ss:[esp+24],-1 6070715B |. E8 445C0000 call <jmp.&MFC42.#800> 60707160 |. 8B4C24 1C mov ecx,dword ptr ss:[esp+1C] 60707164 |. 8BC7 mov eax,edi ; 返回EAX的值由EDI来决定 60707166 |. 5F pop edi 60707167 |. 8BD5 mov edx,ebp ; 注意这里,返回的EDX由EBP决定 60707169 |. 5E pop esi 6070716A |. 5D pop ebp 6070716B |. 5B pop ebx 6070716C |. 64:890D 00000000 mov dword ptr fs:[0],ecx 60707173 |. 83C4 18 add esp,18 60707176 \. C2 0400 retn 4 **************************************算法1部分2************************************** 上面的call返回到这里 || 607071CC |. B9 08000000 mov ecx,8 ; ECX=8 607071D1 |. 894424 10 mov dword ptr ss:[esp+10],eax ; (D) 607071D5 |. E8 86630000 call Configur.6070D560 || 6070D560 /$ 80F9 40 cmp cl,40 ; CL=8 6070D563 |. 73 15 jnb short Configur.6070D57A ; CL>=0x40则跳 6070D565 |. 80F9 20 cmp cl,20 6070D568 |. 73 06 jnb short Configur.6070D570 ; CL>=0x20则跳 6070D56A |. 0FADD0 shrd eax,edx,cl ; 移位 6070D56D |. D3EA shr edx,cl 6070D56F |. C3 retn 6070D570 |> 8BC2 mov eax,edx 6070D572 |. 33D2 xor edx,edx 6070D574 |. 80E1 1F and cl,1F 6070D577 |. D3E8 shr eax,cl 6070D579 |. C3 retn 6070D57A |> 33C0 xor eax,eax 6070D57C |. 33D2 xor edx,edx 6070D57E \. C3 retn || 607071DA |. 8BF8 mov edi,eax ; 将移位后的EAX保存到EDI 607071DC |. 8BEA mov ebp,edx ; 将移位后的EDX保存到EBP 607071DE |. 33F6 xor esi,esi 607071E0 |> 8BCE /mov ecx,esi ; ECX=ESI 607071E2 |. 8BC7 |mov eax,edi ; EAX=EDI 607071E4 |. 8BD5 |mov edx,ebp ; 循环取移位后的EDX::EAX字节相加 607071E6 |. E8 75630000 |call Configur.6070D560 ; 见上面一块区域 607071EB |. 83C6 08 |add esi,8 ; 8次 607071EE |. 02D8 |add bl,al 607071F0 |. 83FE 40 |cmp esi,40 607071F3 |.^ 7C EB \jl short Configur.607071E0 607071F5 |. 8A4424 10 mov al,byte ptr ss:[esp+10] ; 与上面的(D)对应 607071F9 |. F6D3 not bl ; BL取反,不等于AL就玩完! 607071FB |. 3AD8 cmp bl,al 607071FD |. 75 2B jnz short Configur.6070722A ; 跳了就完蛋 607071FF |. A1 C0E87160 mov eax,dword ptr ds:[6071E8C0] ; EAX=0x24D3,字符为"C-",反过来看 60707204 |. 99 cdq 60707205 |. 52 push edx ; EDX=0 60707206 |. 50 push eax ; 注意这里的push与下面的对应关系 60707207 |. 55 push ebp 60707208 |. 57 push edi ; 60707209 |. E8 D2620000 call Configur.6070D4E0 6070D4E0 /$ 53 push ebx 6070D4E1 |. 8B4424 14 mov eax,dword ptr ss:[esp+14] ; EAX=0 6070D4E5 |. 0BC0 or eax,eax 6070D4E7 |. 75 18 jnz short Configur.6070D501 6070D4E9 |. 8B4C24 10 mov ecx,dword ptr ss:[esp+10] ; ECX=24D3 6070D4ED |. 8B4424 0C mov eax,dword ptr ss:[esp+C] ; EAX=EBP 6070D4F1 |. 33D2 xor edx,edx ; 为除法作准备 6070D4F3 |. F7F1 div ecx ; EDX保存余数 6070D4F5 |. 8B4424 08 mov eax,dword ptr ss:[esp+8] ; EAX=EDI 6070D4F9 |. F7F1 div ecx ; EDX::EAX div ecx 6070D4FB |. 8BC2 mov eax,edx ; 上式除法余数保存到EAX 6070D4FD |. 33D2 xor edx,edx 6070D4FF |. EB 50 jmp short Configur.6070D551 6070D501 |> 8BC8 mov ecx,eax 6070D503 |. 8B5C24 10 mov ebx,dword ptr ss:[esp+10] 6070D507 |. 8B5424 0C mov edx,dword ptr ss:[esp+C] 6070D50B |. 8B4424 08 mov eax,dword ptr ss:[esp+8] 6070D50F |> D1E9 /shr ecx,1 6070D511 |. D1DB |rcr ebx,1 6070D513 |. D1EA |shr edx,1 6070D515 |. D1D8 |rcr eax,1 6070D517 |. 0BC9 |or ecx,ecx 6070D519 |.^ 75 F4 \jnz short Configur.6070D50F 6070D51B |. F7F3 div ebx 6070D51D |. 8BC8 mov ecx,eax 6070D51F |. F76424 14 mul dword ptr ss:[esp+14] 6070D523 |. 91 xchg eax,ecx 6070D524 |. F76424 10 mul dword ptr ss:[esp+10] 6070D528 |. 03D1 add edx,ecx 6070D52A |. 72 0E jb short Configur.6070D53A 6070D52C |. 3B5424 0C cmp edx,dword ptr ss:[esp+C] 6070D530 |. 77 08 ja short Configur.6070D53A 6070D532 |. 72 0E jb short Configur.6070D542 6070D534 |. 3B4424 08 cmp eax,dword ptr ss:[esp+8] 6070D538 |. 76 08 jbe short Configur.6070D542 6070D53A |> 2B4424 10 sub eax,dword ptr ss:[esp+10] 6070D53E |. 1B5424 14 sbb edx,dword ptr ss:[esp+14] 6070D542 |> 2B4424 08 sub eax,dword ptr ss:[esp+8] 6070D546 |. 1B5424 0C sbb edx,dword ptr ss:[esp+C] 6070D54A |. F7DA neg edx 6070D54C |. F7D8 neg eax 6070D54E |. 83DA 00 sbb edx,0 6070D551 |> 5B pop ebx 6070D552 \. C2 1000 retn 10 6070720E |. 0BC2 or eax,edx ; EAX必须等于0,不然玩完 60707210 |. 75 18 jnz short Configur.6070722A ; 不能跳 60707212 |. 8D4C24 28 lea ecx,dword ptr ss:[esp+28] 60707216 |. C74424 20 FFFFFFFF mov dword ptr ss:[esp+20],-1 6070721E |. E8 815B0000 call <jmp.&MFC42.#800> 60707223 |. B8 01000000 mov eax,1 60707228 |. EB 13 jmp short Configur.6070723D 6070722A |> 8D4C24 28 lea ecx,dword ptr ss:[esp+28] 6070722E |. C74424 20 FFFFFFFF mov dword ptr ss:[esp+20],-1 60707236 |. E8 695B0000 call <jmp.&MFC42.#800> 6070723B |. 33C0 xor eax,eax 6070723D |> 8B4C24 18 mov ecx,dword ptr ss:[esp+18] 60707241 |. 5F pop edi 60707242 |. 5E pop esi 60707243 |. 5D pop ebp 60707244 |. 64:890D 00000000 mov dword ptr fs:[0],ecx 6070724B |. 5B pop ebx 6070724C |. 83C4 14 add esp,14 6070724F \. C2 0400 retn 4 按照上面的分析找到了一个自以为成功的注册码,输入,弹出成功提示,重启软件,弹出出错提示!看来还有猫腻啊。用 OD载入,隐藏OD,shift+F9运行,弹出注册界面,F12暂停法快速找到下面这关键地址。 **************************************算法2部分1************************************** 6070200B |. E8 10170000 call Configur.60703720 60702010 |> 8B16 mov edx,dword ptr ds:[esi] 60702012 |. 6A 01 push 1 60702014 |. 6A 00 push 0 60702016 |. 68 4C507160 push Configur.6071504C ; ASCII "IsRegistered1" 6070201B |. 8BCE mov ecx,esi 6070201D |. FF52 0C call dword ptr ds:[edx+C] 60702020 |. 85C0 test eax,eax 60702022 |. 74 14 je short Configur.60702038 60702024 |. 8B06 mov eax,dword ptr ds:[esi] 60702026 |. 6A 01 push 1 60702028 |. 6A 00 push 0 6070202A |. 68 BC7B7160 push Configur.60717BBC ; ASCII "IsRegistered2" 6070202F |. 8BCE mov ecx,esi 60702031 |. FF50 0C call dword ptr ds:[eax+C] ; 这个Call非常重要!跟进 60702034 |. 85C0 test eax,eax ; (*) 60702036 |. 75 24 jnz short Configur.6070205C ; 这里必须跳 60702038 |> 8B16 mov edx,dword ptr ds:[esi] 6070203A |. 6A 00 push 0 6070203C |. 6A 08 push 8 6070203E |. 8BCE mov ecx,esi 60702040 |. FF52 1C call dword ptr ds:[edx+1C] ; 这里 弹出狗屎注册框了 60702043 |. 83F8 02 cmp eax,2 60702046 |. 75 14 jnz short Configur.6070205C 60702048 |. 68 A07B7160 push Configur.60717BA0 ; ASCII 09,"Cancel re" 6070204D |. 50 push eax 6070204E |. E8 3DC10000 call Configur.6070E190 60702053 |. 8B45 F0 mov eax,dword ptr ss:[ebp-10] 60702056 |. 83C4 08 add esp,8 60702059 |. 50 push eax 6070205A |. EB 75 jmp short Configur.607020D1 跟进60702031处的call,单步,忽略不重要的代码直到下面。以后重要的call都要跟进,代码紧接着贴出, 我就不再废话了。 60707260 /$ 6A FF push -1 60707262 |. 68 28FA7060 push Configur.6070FA28 ; SE 句柄安装 60707267 |. 64:A1 00000000 mov eax,dword ptr fs:[0] 6070726D |. 50 push eax 6070726E |. 64:8925 00000000 mov dword ptr fs:[0],esp 60707275 |. 51 push ecx 60707276 |. 56 push esi 60707277 |. 8BF1 mov esi,ecx 60707279 |. 51 push ecx 6070727A |. 8D4424 1C lea eax,dword ptr ss:[esp+1C] 6070727E |. 8BCC mov ecx,esp 60707280 |. 896424 08 mov dword ptr ss:[esp+8],esp 60707284 |. 50 push eax 60707285 |. C74424 18 00000000 mov dword ptr ss:[esp+18],0 6070728D |. E8 785B0000 call <jmp.&MFC42.#535> 60707292 |. 8BCE mov ecx,esi ; | 60707294 |. E8 F7FDFFFF call Configur.60707090 ; 这里返回算法1部分1的EAX值和EDX值 60707299 |. B9 08000000 mov ecx,8 6070729E |. E8 BD620000 call Configur.6070D560 6070D560 /$ 80F9 40 cmp cl,40 ; CL=8 6070D563 |. 73 15 jnb short Configur.6070D57A ; CL>=0x40则跳 6070D565 |. 80F9 20 cmp cl,20 6070D568 |. 73 06 jnb short Configur.6070D570 ; CL>=0x20则跳 6070D56A |. 0FADD0 shrd eax,edx,cl ; EDX右移8位(即一字节)到EAX 6070D56D |. D3EA shr edx,cl ; EDX右移一个字节 6070D56F |. C3 retn 6070D570 |> 8BC2 mov eax,edx 6070D572 |. 33D2 xor edx,edx 6070D574 |. 80E1 1F and cl,1F 6070D577 |. D3E8 shr eax,cl 6070D579 |. C3 retn 6070D57A |> 33C0 xor eax,eax 6070D57C |. 33D2 xor edx,edx 6070D57E \. C3 retn 607072A3 |. 8BC8 mov ecx,eax ; 移位后的EAX存到ECX (C) 607072A5 |. A1 C0E87160 mov eax,dword ptr ds:[6071E8C0] ; EAX=2D43 607072AA |. 8BF2 mov esi,edx ; 移位后的EDX存到esi (%) 607072AC |. 99 cdq 607072AD |. 52 push edx 607072AE |. 50 push eax 607072AF |. 56 push esi 607072B0 |. 51 push ecx ; (C) 607072B1 |. E8 CA620000 call Configur.6070D580 ; 6070D580 /$ 53 push ebx 6070D581 |. 56 push esi 6070D582 |. 8B4424 18 mov eax,dword ptr ss:[esp+18] ; EAX=0 6070D586 |. 0BC0 or eax,eax 6070D588 |. 75 18 jnz short Configur.6070D5A2 ; 这里不跳 6070D58A |. 8B4C24 14 mov ecx,dword ptr ss:[esp+14] ; ECX=0x2D43 6070D58E |. 8B4424 10 mov eax,dword ptr ss:[esp+10] ; 注意这里的地址与上面push的关系 6070D592 |. 33D2 xor edx,edx ; 为除法做准备 6070D594 |. F7F1 div ecx ; EAX=ESI/0x2D43 ,EDX保存余数 (%) 6070D596 |. 8BD8 mov ebx,eax ; (^) 6070D598 |. 8B4424 0C mov eax,dword ptr ss:[esp+C] ; (C) 6070D59C |. F7F1 div ecx 6070D59E |. 8BD3 mov edx,ebx ; (^) 6070D5A0 |. EB 41 jmp short Configur.6070D5E3 6070D5A2 |> 8BC8 mov ecx,eax 6070D5A4 |. 8B5C24 14 mov ebx,dword ptr ss:[esp+14] 6070D5A8 |. 8B5424 10 mov edx,dword ptr ss:[esp+10] 6070D5AC |. 8B4424 0C mov eax,dword ptr ss:[esp+C] 6070D5B0 |> D1E9 /shr ecx,1 6070D5B2 |. D1DB |rcr ebx,1 6070D5B4 |. D1EA |shr edx,1 6070D5B6 |. D1D8 |rcr eax,1 6070D5B8 |. 0BC9 |or ecx,ecx 6070D5BA |.^ 75 F4 \jnz short Configur.6070D5B0 6070D5BC |. F7F3 div ebx 6070D5BE |. 8BF0 mov esi,eax 6070D5C0 |. F76424 18 mul dword ptr ss:[esp+18] 6070D5C4 |. 8BC8 mov ecx,eax 6070D5C6 |. 8B4424 14 mov eax,dword ptr ss:[esp+14] 6070D5CA |. F7E6 mul esi 6070D5CC |. 03D1 add edx,ecx 6070D5CE |. 72 0E jb short Configur.6070D5DE 6070D5D0 |. 3B5424 10 cmp edx,dword ptr ss:[esp+10] 6070D5D4 |. 77 08 ja short Configur.6070D5DE 6070D5D6 |. 72 07 jb short Configur.6070D5DF 6070D5D8 |. 3B4424 0C cmp eax,dword ptr ss:[esp+C] 6070D5DC |. 76 01 jbe short Configur.6070D5DF 6070D5DE |> 4E dec esi 6070D5DF |> 33D2 xor edx,edx 6070D5E1 |. 8BC6 mov eax,esi 6070D5E3 |> 5E pop esi 6070D5E4 |. 5B pop ebx 6070D5E5 \. C2 1000 retn 10 607072B6 |. 83F2 00 xor edx,0 ; (^) 607072B9 |. 6A 00 push 0 607072BB |. 35 DF4F2300 xor eax,234FDF ; EAX^=0x234fdf 607072C0 |. 68 FAFF0000 push 0FFFA 607072C5 |. 52 push edx ; (^) 607072C6 |. 50 push eax ; (8) 607072C7 |. E8 14620000 call Configur.6070D4E0 6070D4E0 /$ 53 push ebx 6070D4E1 |. 8B4424 14 mov eax,dword ptr ss:[esp+14] ; EAX=0 6070D4E5 |. 0BC0 or eax,eax 6070D4E7 |. 75 18 jnz short Configur.6070D501 ; 这里没有跳 6070D4E9 |. 8B4C24 10 mov ecx,dword ptr ss:[esp+10] ; ECX=0xFFFA 6070D4ED |. 8B4424 0C mov eax,dword ptr ss:[esp+C] ; (^) 6070D4F1 |. 33D2 xor edx,edx 6070D4F3 |. F7F1 div ecx 6070D4F5 |. 8B4424 08 mov eax,dword ptr ss:[esp+8] ; (8) 6070D4F9 |. F7F1 div ecx ; EDX::EAX div ECX 6070D4FB |. 8BC2 mov eax,edx ; 6070D4FD |. 33D2 xor edx,edx 6070D4FF |. EB 50 jmp short Configur.6070D551 6070D501 |> 8BC8 mov ecx,eax 6070D503 |. 8B5C24 10 mov ebx,dword ptr ss:[esp+10] 6070D507 |. 8B5424 0C mov edx,dword ptr ss:[esp+C] 6070D50B |. 8B4424 08 mov eax,dword ptr ss:[esp+8] 6070D50F |> D1E9 /shr ecx,1 6070D511 |. D1DB |rcr ebx,1 6070D513 |. D1EA |shr edx,1 6070D515 |. D1D8 |rcr eax,1 6070D517 |. 0BC9 |or ecx,ecx 6070D519 |.^ 75 F4 \jnz short Configur.6070D50F 6070D51B |. F7F3 div ebx 6070D51D |. 8BC8 mov ecx,eax 6070D51F |. F76424 14 mul dword ptr ss:[esp+14] 6070D523 |. 91 xchg eax,ecx 6070D524 |. F76424 10 mul dword ptr ss:[esp+10] 6070D528 |. 03D1 add edx,ecx 6070D52A |. 72 0E jb short Configur.6070D53A 6070D52C |. 3B5424 0C cmp edx,dword ptr ss:[esp+C] 6070D530 |. 77 08 ja short Configur.6070D53A 6070D532 |. 72 0E jb short Configur.6070D542 6070D534 |. 3B4424 08 cmp eax,dword ptr ss:[esp+8] 6070D538 |. 76 08 jbe short Configur.6070D542 6070D53A |> 2B4424 10 sub eax,dword ptr ss:[esp+10] 6070D53E |. 1B5424 14 sbb edx,dword ptr ss:[esp+14] 6070D542 |> 2B4424 08 sub eax,dword ptr ss:[esp+8] 6070D546 |. 1B5424 0C sbb edx,dword ptr ss:[esp+C] 6070D54A |. F7DA neg edx 6070D54C |. F7D8 neg eax 6070D54E |. 83DA 00 sbb edx,0 6070D551 |> 5B pop ebx 6070D552 \. C2 1000 retn 10 607072CC |. 3D 0C7F0000 cmp eax,7F0C 607072D1 |. 75 2C jnz short Configur.607072FF ; 不能跳 607072D3 |. 85D2 test edx,edx 607072D5 |. 75 28 jnz short Configur.607072FF ; 不能跳 607072D7 |. 8D4C24 18 lea ecx,dword ptr ss:[esp+18] ; 这里EAX决定上文标示为(*)处的EAX 607072DB |. C74424 10 FFFFFFFF mov dword ptr ss:[esp+10],-1 ; 若上面两处跳了就直接玩完 607072E3 |. E8 BC5A0000 call <jmp.&MFC42.#800> 607072E8 |. B8 01000000 mov eax,1 607072ED |. 8B4C24 08 mov ecx,dword ptr ss:[esp+8] 607072F1 |. 64:890D 00000000 mov dword ptr fs:[0],ecx 607072F8 |. 5E pop esi 607072F9 |. 83C4 10 add esp,10 607072FC |. C2 0400 retn 4 607072FF |> 8D4C24 18 lea ecx,dword ptr ss:[esp+18] 60707303 |. C74424 10 FFFFFFFF mov dword ptr ss:[esp+10],-1 6070730B |. E8 945A0000 call <jmp.&MFC42.#800> 60707310 |. 8B4C24 08 mov ecx,dword ptr ss:[esp+8] 60707314 |. 33C0 xor eax,eax ; 这句代码执行了就失败 60707316 |. 64:890D 00000000 mov dword ptr fs:[0],ecx 6070731D |. 5E pop esi 6070731E |. 83C4 10 add esp,10 60707321 \. C2 0400 retn 4 -------------------------------------------------------------------------------- 【经验总结】 算法流程: A、程序根据输入的假码生成EAX EDX 生成EAX: 将输入的假码倒序,依次在特征序列中查找假码的每一位,记为A。记第n次运算结果为EAX(n),则: EAX(n)=EAX(n-1)*0x1E+A 生成EDX: 当EAX运算有溢出时EDX才为非零值,记上次的运算结果为EDX(n),本次计算EAX(n-1)*0x1E时溢出位为D,则: EDX(n)=EDX(n-1)*1E+D B、算法一要求: 步骤A生成EAX、EDX。保存AL,EDX::EAX右移一个字节,将移位后的EDX、EAX每个字节相加,和保存为BL。若 not BL != AL 则失败。 将移位后的EAX保存到EDI,EDX保存到EBP。如果(EBP % 0x2D43)::EDI % 0x2D43 != 0 失败。 (::左边表示被除数的高位, 右边表示被除数的低位) 算法二要求: 步骤A生成EAX、EDX。EDX::EAX右移一个字节.将移位后的EAX保存到EDI,EDX保存到EBP. A=((EBP % 0x2D43)::EDI / 0x2D43)^0x234FDF D=EBP / 0x2D43 % 0xFFFA EAX=(D::A) % 0xFFFA 如果EAX != 0x7F0C 失败。 不妨令步骤A生成的EDX=0,则很容易分析出可用注册码。一个可用的注册码 LNEK8YQ4 写了个简单的算法,我就不贴出来了。 分析代码不要急躁,不可一味图快,静下心来仔细分析,会有很好的效果。分析代码一定要特别注意上下代码之间的 关系,像文中我用括号标示出来的那样,这样容易把握代码的总体脉络。把脉络理顺之后再总结注册流程就容易多了。 -------------------------------------------------------------------------------- 【版权声明】: 本文原创于看雪技术论坛, 转载请注明作者并保持文章的完整, 谢谢! 2009年09月02日