注册码长度为固定的 1Eh,
说明:
1、注册码形如:XXXXX-XXXX-XXXX-XXXX-XXXX-XXXX(共30长度,即 1Eh)
2、将 ebp=lpDataTable
下面模块为将注册码转换为一个固定的 dd 值
00428C20 /$ 8B4424 0C MOV EAX,DWORD PTR SS:[ESP+C] ; 堆栈 SS:[0012F9E8]=FFFFFFFF,edi=0FFFFFFFFh,通过调用函数压栈实参 edi 的值传入
00428C24 |. 56 PUSH ESI ; eax=0FFFFFFFFh
00428C25 |. 8B7424 08 MOV ESI,DWORD PTR SS:[ESP+8] ; 注册码,堆栈 SS:[0012F9E0]=00D5D138, (ASCII "XXXXX-XXXX-XXXX-XXXX-XXXX-XXXX")
00428C29 |. 8941 04 MOV DWORD PTR DS:[ECX+4],EAX ; eax=0FFFFFFFFh,DWORD PTR DS:[ECX+4]<-eax
00428C2C |. 8B4424 0C MOV EAX,DWORD PTR SS:[ESP+C] ; 注册码的长度,堆栈 SS:[0012F9E4]=0000001E
00428C30 |. 8BD0 MOV EDX,EAX ; edx=eax=1Eh
00428C32 |. 48 DEC EAX ; eax=1Eh-1=1Dh
00428C33 |. 85D2 TEST EDX,EDX
00428C35 |. 74 31 JE SHORT 00428C68 ; 如果注册为为空,则直接在 eax 中返回 0FFFFFFFFh
00428C37 |. 53 PUSH EBX
00428C38 |. 55 PUSH EBP
00428C39 |. 8B69 0C MOV EBP,DWORD PTR DS:[ECX+C] ; ebp=09BB3F48,堆栈 DS:[0012FA1C]=09BB3F48,指向 lpDataTable
00428C3C |. 57 PUSH EDI
00428C3D |. 8D78 01 LEA EDI,DWORD PTR DS:[EAX+1] ; edi=1Eh,eax=1Eh-1,则 eax=(1Eh-1)+1=1Eh
00428C40 |> 8B41 04 /MOV EAX,DWORD PTR DS:[ECX+4] ; 初始值 eax=0FFFFFFFFh,堆栈 DS:[0012FA14]=0FFFFFFFFh
00428C43 |. 33DB |XOR EBX,EBX ; 初始化 ebx=0
00428C45 |. 8A1E |MOV BL,BYTE PTR DS:[ESI] ; 逐位读取注册码
00428C47 |. 8BD0 |MOV EDX,EAX ; edx 初始值为 0FFFFFFFFh,后来则是每次计算后的值
00428C49 |. 81E2 FF000000 |AND EDX,0FF
00428C4F |. 33D3 |XOR EDX,EBX
00428C51 |. 46 |INC ESI
00428C52 |. C1E8 08 |SHR EAX,8
00428C55 |. 8B5495 00 |MOV EDX,DWORD PTR SS:[EBP+EDX*4]
00428C59 |. 33C2 |XOR EAX,EDX
00428C5B |. 4F |DEC EDI ; edi 的初始值为 1Eh
00428C5C |. 8941 04 |MOV DWORD PTR DS:[ECX+4],EAX
00428C5F |.^ 75 DF \JNZ SHORT 00428C40 ; 循环 1Eh-1=1Dh 次,刚好读取完全部注册码,包括分隔符
00428C61 |. 5F POP EDI
00428C62 |. 5D POP EBP
00428C63 |. 5B POP EBX
00428C64 |. 5E POP ESI
00428C65 |. C2 0C00 RETN 0C
00428C68 |> 8B41 04 MOV EAX,DWORD PTR DS:[ECX+4]
00428C6B |. 5E POP ESI
00428C6C \. C2 0C00 RETN 0C
转换后的 dd 值 返回给 eax,然后与软件中的一个数据表(请下载:
软件中数据表.rar)逐双字比对,看是否存在一个与 eax 的值相等的值,如果存在,则说明注册码是完全正确的。
变换注册码计算的 lpDataTable 数据表如下:
lpDataTable dd 000000000h, 077073096h, 0ee0e612ch, 0990951bah, 0076dc419h, 0706af48fh, 0e963a535h, 09e6495a3h, 00edb8832h, 079dcb8a4h, 0e0d5e91eh, 097d2d988h, 009b64c2bh, 07eb17cbdh, 0e7b82d07h, 090bf1d91h
dd 01db71064h, 06ab020f2h, 0f3b97148h, 084be41deh, 01adad47dh, 06ddde4ebh, 0f4d4b551h, 083d385c7h, 0136c9856h, 0646ba8c0h, 0fd62f97ah, 08a65c9ech, 014015c4fh, 063066cd9h, 0fa0f3d63h, 08d080df5h
dd 03b6e20c8h, 04c69105eh, 0d56041e4h, 0a2677172h, 03c03e4d1h, 04b04d447h, 0d20d85fdh, 0a50ab56bh, 035b5a8fah, 042b2986ch, 0dbbbc9d6h, 0acbcf940h, 032d86ce3h, 045df5c75h, 0dcd60dcfh, 0abd13d59h
dd 026d930ach, 051de003ah, 0c8d75180h, 0bfd06116h, 021b4f4b5h, 056b3c423h, 0cfba9599h, 0b8bda50fh, 02802b89eh, 05f058808h, 0c60cd9b2h, 0b10be924h, 02f6f7c87h, 058684c11h, 0c1611dabh, 0b6662d3dh
dd 076dc4190h, 001db7106h, 098d220bch, 0efd5102ah, 071b18589h, 006b6b51fh, 09fbfe4a5h, 0e8b8d433h, 07807c9a2h, 00f00f934h, 09609a88eh, 0e10e9818h, 07f6a0dbbh, 0086d3d2dh, 091646c97h, 0e6635c01h
dd 06b6b51f4h, 01c6c6162h, 0856530d8h, 0f262004eh, 06c0695edh, 01b01a57bh, 08208f4c1h, 0f50fc457h, 065b0d9c6h, 012b7e950h, 08bbeb8eah, 0fcb9887ch, 062dd1ddfh, 015da2d49h, 08cd37cf3h, 0fbd44c65h
dd 04db26158h, 03ab551ceh, 0a3bc0074h, 0d4bb30e2h, 04adfa541h, 03dd895d7h, 0a4d1c46dh, 0d3d6f4fbh, 04369e96ah, 0346ed9fch, 0ad678846h, 0da60b8d0h, 044042d73h, 033031de5h, 0aa0a4c5fh, 0dd0d7cc9h
dd 05005713ch, 0270241aah, 0be0b1010h, 0c90c2086h, 05768b525h, 0206f85b3h, 0b966d409h, 0ce61e49fh, 05edef90eh, 029d9c998h, 0b0d09822h, 0c7d7a8b4h, 059b33d17h, 02eb40d81h, 0b7bd5c3bh, 0c0ba6cadh
dd 0edb88320h, 09abfb3b6h, 003b6e20ch, 074b1d29ah, 0ead54739h, 09dd277afh, 004db2615h, 073dc1683h, 0e3630b12h, 094643b84h, 00d6d6a3eh, 07a6a5aa8h, 0e40ecf0bh, 09309ff9dh, 00a00ae27h, 07d079eb1h
dd 0f00f9344h, 08708a3d2h, 01e01f268h, 06906c2feh, 0f762575dh, 0806567cbh, 0196c3671h, 06e6b06e7h, 0fed41b76h, 089d32be0h, 010da7a5ah, 067dd4acch, 0f9b9df6fh, 08ebeeff9h, 017b7be43h, 060b08ed5h
dd 0d6d6a3e8h, 0a1d1937eh, 038d8c2c4h, 04fdff252h, 0d1bb67f1h, 0a6bc5767h, 03fb506ddh, 048b2364bh, 0d80d2bdah, 0af0a1b4ch, 036034af6h, 041047a60h, 0df60efc3h, 0a867df55h, 0316e8eefh, 04669be79h
dd 0cb61b38ch, 0bc66831ah, 0256fd2a0h, 05268e236h, 0cc0c7795h, 0bb0b4703h, 0220216b9h, 05505262fh, 0c5ba3bbeh, 0b2bd0b28h, 02bb45a92h, 05cb36a04h, 0c2d7ffa7h, 0b5d0cf31h, 02cd99e8bh, 05bdeae1dh
dd 09b64c2b0h, 0ec63f226h, 0756aa39ch, 0026d930ah, 09c0906a9h, 0eb0e363fh, 072076785h, 005005713h, 095bf4a82h, 0e2b87a14h, 07bb12baeh, 00cb61b38h, 092d28e9bh, 0e5d5be0dh, 07cdcefb7h, 00bdbdf21h
dd 086d3d2d4h, 0f1d4e242h, 068ddb3f8h, 01fda836eh, 081be16cdh, 0f6b9265bh, 06fb077e1h, 018b74777h, 088085ae6h, 0ff0f6a70h, 066063bcah, 011010b5ch, 08f659effh, 0f862ae69h, 0616bffd3h, 0166ccf45h
dd 0a00ae278h, 0d70dd2eeh, 04e048354h, 03903b3c2h, 0a7672661h, 0d06016f7h, 04969474dh, 03e6e77dbh, 0aed16a4ah, 0d9d65adch, 040df0b66h, 037d83bf0h, 0a9bcae53h, 0debb9ec5h, 047b2cf7fh, 030b5ffe9h
dd 0bdbdf21ch, 0cabac28ah, 053b39330h, 024b4a3a6h, 0bad03605h, 0cdd70693h, 054de5729h, 023d967bfh, 0b3667a2eh, 0c4614ab8h, 05d681b02h, 02a6f2b94h, 0b40bbe37h, 0c30c8ea1h, 05a05df1bh, 02d02ef8dh
dd 0edb88320h, 000000000h, 05f1f12b6h, 00003a8a6h, 0045818a0h, 00453ef00h, 07705a225h, 07705cca0h