wofan 发表于 2006-9-4 15:56:51

其实本贴已经发在看雪了, 不过这里的任务也要完成呀

软件名称:Menu Maker 4
下载地址:http://www.selteco.com/?src=smmk2a
购买价格:¥29.00
简介:The easiest way to create pull-down web menus without coding.

编译语言:Microsoft Visual C++ 6.0
本文档由 :wofan 制作,虽然是国外软件,还是不允许制作并发放注册机,违者后果自负。
本程序虽然没有采用加密算法,但是要很好地描述它的算法,还真有点麻烦。
填入注册码:
123456-787878787
我把它们分别叫做regone 和 regtwo
bpx GetWindowTextA 可以断下

00416B8A    8B4424 0C       mov eax,dword ptr ss:
00416B8E    8378 F8 06      cmp dword ptr ds:,6========第一个注册框中实际上也只能填写6个字符
00416B92    75 25         jnz short menumake.00416BB9
00416B94    8B4C24 08       mov ecx,dword ptr ss:
00416B98    8379 F8 09      cmp dword ptr ds:,9========第二个注册框中实际上也只能填写9个字符
00416B9C    75 1B         jnz short menumake.00416BB9
00416B9E    50            push eax
00416B9F    E8 72D40000   call menumake.00424016=================== 将regone转为十六进制0x1E240
00416BA4    8B5424 0C       mov edx,dword ptr ss:
00416BA8    8946 60         mov dword ptr ds:,eax
00416BAB    52            push edx
00416BAC    E8 65D40000   call menumake.00424016====================将regtwo转为十六进制0x2EF61383
00416BB1    83C4 08         add esp,8
……
00416BF4    C3            retn

以后居然不知跑到那里去了,我靠,难找了
换个断点:
bp MessageBoxA
来到:
00408314    6A 10         push 10
00408316    68 94064700   push menumake.00470694                      ; ASCII "Selteco Menu Maker"
0040831B    68 2C064700   push menumake.0047062C                      ; ASCII "Invalid serial number."
00408320    6A 00         push 0
00408322    FF15 E8954500   call dword ptr ds:[<&USER32.MessageBoxA>]   ; USER32.MessageBoxA------这里

右击,分析代码,看它从那里来的。

0040814A   .52            push edx                                    ; /Arg2
0040814B   .51            push ecx                                    ; |Arg1
0040814C   .8BCE          mov ecx,esi                                 ; |
0040814E   .E8 0D0B0000   call menumake.00408C60                      ; \menumake.00408C60---这才是关键Call,F7跟进
00408153   .85C0          test eax,eax
00408155   .0F84 B9010000 je menumake.00408314-----------------出错MessageboxA来自这里的跳转,向上找


======================================================================
======================================================================
关键Call,F7跟进,算法在这里:
===========================================================================================================
==特别说明:本算法,不好描述,我估且:                                                               ======
==常数前面加const,例如出现的第一个常数,我就记为const_one                                          ======
==注册码分为两部分, 我就分别记为:regone,regtwo                                                   ======
==由regone 和常数运算得到的数就记为,例如:conone_regone 就是第一个常数和注册码第一部分运算得到和结果======
==没有其它大常数参加运算,只是处理注册码,得到的数,记为,如regone_num 就是由注册码第一部分产生的数据======
===========================================================================================================
00408C60/$83EC 3C       sub esp,3C
00408C63|.8B4C24 40   mov ecx,dword ptr ss:==regone的十六进制:0x1E240
00408C67|.B8 8F588B4F   mov eax,4F8B588F---------------const_one
00408C6C|.F7E1          mul ecx----------------------------regone mul const_one=95D8 3F9361C0
00408C6E|.8BC1          mov eax,ecx
00408C70|.53            push ebx
00408C71|.2BC2          sub eax,edx------------------------regone - 0x95D8=0x14C68
00408C73|.55            push ebp
00408C74|.D1E8          shr eax,1--------------------------0x1FC68 shr 1=0xA634
00408C76|.03C2          add eax,edx------------------------0xA634+0x95D8=0x13C0C
00408C78|.56            push esi
00408C79|.C1E8 10       shr eax,10-------------------------0x13C0C shr 0x10=1
00408C7C|.33D2          xor edx,edx
00408C7E|.BE 0A000000   mov esi,0A------------------------------常数
00408C83|.F7F6          div esi----------------------------1 div 0xA=> EAX=0 EDX=1
00408C85|.B8 5917B7D1   mov eax,D1B71759--------------const_two
00408C8A|.57            push edi
00408C8B|.BF 0A000000   mov edi,0A
00408C90|.BB 0A000000   mov ebx,0A
00408C95|.BD 0A000000   mov ebp,0A
00408C9A|.8BF2          mov esi,edx=========保存余数,记为conone_regone,它其实就是 N1_1(第一组注册码的第一位)
00408C9C|.F7E1          mul ecx----------------------------const_two mul regone=18B0F 27BB6840
00408C9E|.8BC2          mov eax,edx
00408CA0|.33D2          xor edx,edx
00408CA2|.C1E8 0D       shr eax,0D-------------------------0x18B0F shr 0xD=0xC
00408CA5|.F7F7          div edi----------------------------同样,它也div 0xA=1 余 2
00408CA7|.B8 D34D6210   mov eax,10624DD3--------------const_three
00408CAC|.895424 14   mov dword ptr ss:,edx===保存余数,记为contwo_regone即:N1_2
00408CB0|.F7E1          mul ecx----------------------------const_three mul regone=1EDD 2F1ABAC0
00408CB2|.8BC2          mov eax,edx------------------------同样,提取Hiword
00408CB4|.33D2          xor edx,edx
00408CB6|.C1E8 06       shr eax,6--------------------------Hiword shr 6=7B
00408CB9|.F7F7          div edi----------------------------同样 div 0xA=C 余 3
00408CBB|.B8 1F85EB51   mov eax,51EB851F--------------const_four
00408CC0|.895424 18   mov dword ptr ss:,edx===保存余数,记为conthree_regone,即N1_3
00408CC4|.F7E1          mul ecx----------------------------const_four mul regone=9A51EB85A5C0
00408CC6|.8BC2          mov eax,edx
00408CC8|.33D2          xor edx,edx
00408CCA|.C1E8 05       shr eax,5--------------------------9A51 shr 5=4D2
00408CCD|.F7F7          div edi----------------------------div 0xA=7B 余 4
00408CCF|.B8 CDCCCCCC   mov eax,CCCCCCCD--------------const_five
00408CD4|.8BFA          mov edi,edx==========保存余数,记为confour_regone,即 N1_4
00408CD6|.F7E1          mul ecx---------------------------const_five mul regone=181CC CCCD2D40
00408CD8|.8BC2          mov eax,edx
00408CDA|.33D2          xor edx,edx
00408CDC|.C1E8 03       shr eax,3-------------------------181CC shr 3=3039
00408CDF|.F7F3          div ebx---------------------------div 0xA=4D2 余 5
00408CE1|.8BC1          mov eax,ecx
00408CE3|.B9 0A000000   mov ecx,0A
00408CE8|.8BDA          mov ebx,edx>>>>>>>>>>>>>>>保存余数5,记为confive_regone,即N1_5
00408CEA|.33D2          xor edx,edx
00408CEC|.F7F1          div ecx---------------------------regone div 0xA=3039 余 6,
00408CEE|.8B4C24 54   mov ecx,dword ptr ss:=======regtwo 的十六进制
00408CF2|.B8 893BE655   mov eax,55E63B89-------const_six
00408CF7|.895424 24   mov dword ptr ss:,edx====保存余数regone_num,即N1_6
00408CFB|.F7E1          mul ecx--------------regtwo mul const_six=FC1F07B DEE1A21B
00408CFD|.8BC2          mov eax,edx
00408CFF|.33D2          xor edx,edx
00408D01|.C1E8 19       shr eax,19------------FC1F07B shr 19=7
00408D04|.F7F5          div ebp--------------div 0xA=0 余 7
00408D06|.B8 6BCA5F6B   mov eax,6B5FCA6B-------const_seven
00408D0B|.895424 28   mov dword ptr ss:,edx====保存余数,记为:consix_regtwo,即N2_1
00408D0F|.F7E1          mul ecx---------------const_seven mul regtwo=13B26C9A CADC85C1
00408D11|.8BC2          mov eax,edx
00408D13|.33D2          xor edx,edx
00408D15|.C1E8 16       shr eax,16-------------13B26C9A shr 16=4E
00408D18|.F7F5          div ebp---------------div 0xA=7 余 8
00408D1A|.B8 83DE1B43   mov eax,431BDE83-------const_eight
00408D1F|.895424 2C   mov dword ptr ss:,edx===保存余数,记为:conseven_regtwo,即N2_2
00408D23|.F7E1          mul ecx--------------const_eight mul regtwo=C4F83E0 C4A89609
00408D25|.8BC2          mov eax,edx
00408D27|.33D2          xor edx,edx
00408D29|.C1E8 12       shr eax,12-------------------------C4F83E0 shr 12=313
00408D2C|.F7F5          div ebp----------------------------div 0xA=4E 余 7
00408D2E|.B8 8F588B4F   mov eax,4F8B588F------const_one
00408D33|.895424 30   mov dword ptr ss:,edx===保存余数,记为:coneight_regtwo,即N2_3
00408D37|.F7E1          mul ecx--------------const_one mul regtwo=E977FE0 D74AEE2D
00408D39|.8BC1          mov eax,ecx
00408D3B|.2BC2          sub eax,edx------------------------regtwo-E977FE0=205E93A3
00408D3D|.D1E8          shr eax,1--------------------------205E93A3 shr 1=102F49D1
00408D3F|.03C2          add eax,edx------------------------102F49D1+E977FE0=1EC6C9B1
00408D41|.C1E8 10       shr eax,10-------------------------shr 10=1EC6
00408D44|.33D2          xor edx,edx
00408D46|.F7F5          div ebp----------------------------div 0xA=313 余 8
00408D48|.B8 5917B7D1   mov eax,D1B71759------const_two
00408D4D|.895424 34   mov dword ptr ss:,edx===保存余数,记为:conone_regtwo,即N2_4
00408D51|.F7E1          mul ecx--------------const_two mul regtwo=26787C1E 54F28D8B
00408D53|.8BC2          mov eax,edx
00408D55|.33D2          xor edx,edx
00408D57|.C1E8 0D       shr eax,0D-------------------------26787C1E shr 0xD=133C3
00408D5A|.F7F5          div ebp----------------------------div 0xA=1EC6 余 7
00408D5C|.B8 D34D6210   mov eax,10624DD3-----const_three
00408D61|.895424 38   mov dword ptr ss:,edx===保存余数,记为:contwo_regtwo,即N2_5
00408D65|.F7E1          mul ecx-------------const_threemul regtwo=30169B2 60D67BF9
00408D67|.8BC2          mov eax,edx
00408D69|.33D2          xor edx,edx
00408D6B|.C1E8 06       shr eax,6------------------------30169B2 shr 6=C05A6
00408D6E|.F7F5          div ebp--------------------------div 0xA=133C3 余 8
00408D70|.B8 1F85EB51   mov eax,51EB851F-----const_four
00408D75|.895424 3C   mov dword ptr ss:,edx===保存余数,记为:conthree_regtwo,即N2_6
00408D79|.F7E1          mul ecx-------------const_four mul regtwo=F07107B E4306BDD
00408D7B|.8BC2          mov eax,edx
00408D7D|.33D2          xor edx,edx
00408D7F|.C1E8 05       shr eax,5------------------------F07107B shr 5=783883
00408D82|.F7F5          div ebp--------------------------div 0xA=C05A6 余 7
00408D84|.B8 CDCCCCCC   mov eax,CCCCCCCD----const_five
00408D89|.895424 40   mov dword ptr ss:,edx===保存余数,记为:confour_regtwo,即N2_7
00408D8D|.F7E1          mul ecx-------------------------const_five mul regtwo=2591A935 A2FE03E9
00408D8F|.8BC2          mov eax,edx
00408D91|.33D2          xor edx,edx
00408D93|.C1E8 03       shr eax,3----------------------2591A935 shr 3=4B23526
00408D96|.F7F5          div ebp------------------------div 0xA=783883 余 8
00408D98|.8BC1          mov eax,ecx
00408D9A|.B9 0A000000   mov ecx,0A
00408D9F|.8BEA          mov ebp,edx===================保存余数,记为:confive_regtwo,即N2_8
00408DA1|.33D2          xor edx,edx
00408DA3|.F7F1          div ecx---regtwo div 0xA=04B23526 余 7====被置于EDX中,记为regtwo_num,即N2_9
00408DA5|.8B4424 3C   mov eax,dword ptr ss:
00408DA9|.8D0C02      lea ecx,dword ptr ds:
00408DAC|.8B4424 34   mov eax,dword ptr ss:
00408DB0|.8B5424 30   mov edx,dword ptr ss:
00408DB4|.03C8          add ecx,eax
00408DB6|.8B4424 28   mov eax,dword ptr ss:
00408DBA|.03CA          add ecx,edx
00408DBC|.8B5424 24   mov edx,dword ptr ss:
00408DC0|.03C8          add ecx,eax
00408DC2|.03CA          add ecx,edx
00408DC4|.03CF          add ecx,edi
00408DC6|.03CE          add ecx,esi
///////////////////////////////////////////////////////////////////////////
==============》conthree_regtwo=8
edx   ==============》regtwo_num   =7
==============》conone_regtwo=8
==============》coneight_regtwo=7
==============》consix_regtwo=7
==============》regone_num   =6
edi   ==============》confour_regone =4
esi   ==============》conone_regone=1
累加:
这里是:8+7+8+7+7+6+4+1=0x30
即:N2_6+N2_9+N2_4+N2_3+N2_1+N1_6+N1_4+N1_1

///////////////////////////////////////////////////////////////////////////
00408DC8|.BE 0A000000   mov esi,0A
00408DCD|.8D41 04       lea eax,dword ptr ds:====0x30+4=0x34
00408DD0|.99            cdq
00408DD1|.F7FE          idiv esi===============0x34对0xA取余得到2
00408DD3|.3BD3          cmp edx,ebx>>>>>>>>第一次比较,EBX中是confive_regone,即常数0xCCCCCCCD和注册码第一部分运算的结果
00408DD5|.74 0C         je short menumake.00408DE3
00408DD7|.5F            pop edi
00408DD8|.5E            pop esi
00408DD9|.5D            pop ebp
00408DDA|.33C0          xor eax,eax
00408DDC|.5B            pop ebx
00408DDD|.83C4 3C       add esp,3C
00408DE0|.C2 0800       retn 8
00408DE3|> \03CA          add ecx,edx==================如果上面跳转成功,这里加上余数,0x30+2=0x32
00408DE5|.BE 0A000000   mov esi,0A
00408DEA|.8D41 01       lea eax,dword ptr ds:===再加1
00408DED|.99            cdq
00408DEE|.F7FE          idiv esi=======================依旧对0xA取余
00408DF0|.3B5424 18   cmp edx,dword ptr ss:==conthree_regone
00408DF4|.74 0C         je short menumake.00408E02
00408DF6|.5F            pop edi
00408DF7|.5E            pop esi
00408DF8|.5D            pop ebp
00408DF9|.33C0          xor eax,eax
00408DFB|.5B            pop ebx
00408DFC|.83C4 3C       add esp,3C
00408DFF|.C2 0800       retn 8
00408E02|>03CA          add ecx,edx
00408E04|.BE 0A000000   mov esi,0A
00408E09|.8D41 08       lea eax,dword ptr ds:
00408E0C|.99            cdq
00408E0D|.F7FE          idiv esi
00408E0F|.3B5424 2C   cmp edx,dword ptr ss:===conseven_regtwo:>>>>第二次比较
00408E13|.74 0C         je short menumake.00408E21
00408E15|.5F            pop edi
00408E16|.5E            pop esi
00408E17|.5D            pop ebp
00408E18|.33C0          xor eax,eax
00408E1A|.5B            pop ebx
00408E1B|.83C4 3C       add esp,3C
00408E1E|.C2 0800       retn 8
00408E21|>03CA          add ecx,edx
00408E23|.BE 0A000000   mov esi,0A
00408E28|.8D41 05       lea eax,dword ptr ds:
00408E2B|.99            cdq
00408E2C|.F7FE          idiv esi
00408E2E|.3B5424 40   cmp edx,dword ptr ss:====confour_regtwo:>>>>>第三次比较
00408E32|.74 0C         je short menumake.00408E40
00408E34|.5F            pop edi
00408E35|.5E            pop esi
00408E36|.5D            pop ebp
00408E37|.33C0          xor eax,eax
00408E39|.5B            pop ebx
00408E3A|.83C4 3C       add esp,3C
00408E3D|.C2 0800       retn 8
00408E40|>03CA          add ecx,edx
00408E42|.BE 0A000000   mov esi,0A
00408E47|.8D41 09       lea eax,dword ptr ds:
00408E4A|.99            cdq
00408E4B|.F7FE          idiv esi
00408E4D|.3BD5          cmp edx,ebp==============confive_regtwo:>>>>第四次比较
00408E4F|.74 0C         je short menumake.00408E5D
00408E51|.5F            pop edi
00408E52|.5E            pop esi
00408E53|.5D            pop ebp
00408E54|.33C0          xor eax,eax
00408E56|.5B            pop ebx
00408E57|.83C4 3C       add esp,3C
00408E5A|.C2 0800       retn 8
00408E5D|>03CA          add ecx,edx
00408E5F|.BE 0A000000   mov esi,0A
00408E64|.8D41 01       lea eax,dword ptr ds:
00408E67|.99            cdq
00408E68|.F7FE          idiv esi
00408E6A|.3B5424 38   cmp edx,dword ptr ss:======contwo_regtwo:>>>>第五次比较
00408E6E|.74 0C         je short menumake.00408E7C
00408E70|.5F            pop edi
00408E71|.5E            pop esi
00408E72|.5D            pop ebp
00408E73|.33C0          xor eax,eax
00408E75|.5B            pop ebx
00408E76|.83C4 3C       add esp,3C
00408E79|.C2 0800       retn 8
00408E7C|>8D440A 02   lea eax,dword ptr ds:
00408E80|.B9 0A000000   mov ecx,0A
00408E85|.99            cdq
00408E86|.F7F9          idiv ecx
00408E88|.8B4C24 14   mov ecx,dword ptr ss:======contwo_regone:>>>>第六次比较
00408E8C|.33C0          xor eax,eax
00408E8E|.5F            pop edi
00408E8F|.5E            pop esi
00408E90|.5D            pop ebp
00408E91|.5B            pop ebx
00408E92|.3BD1          cmp edx,ecx
00408E94|.0F94C0      sete al==================全部比较通过,则置标志,置al为1
00408E97|.83C4 3C       add esp,3C
00408E9A\.C2 0800       retn 8


=====================================================================================
全部的je都跳过来了,就开始写注册表

00408EA0/$83EC 08       sub esp,8
00408EA3|.8D4424 04   lea eax,dword ptr ss:
00408EA7|.8D4C24 00   lea ecx,dword ptr ss:
00408EAB|.56            push esi
00408EAC|.50            push eax                            ; /pDisposition
00408EAD|.51            push ecx                            ; |pHandle
00408EAE|.6A 00         push 0                              ; |pSecurity = NULL
00408EB0|.68 3F000F00   push 0F003F                         ; |Access = KEY_ALL_ACCESS
00408EB5|.6A 00         push 0                              ; |Options = REG_OPTION_NON_VOLATILE
00408EB7|.68 506C4700   push menumake.00476C50            ; |Class = ""
00408EBC|.6A 00         push 0                              ; |Reserved = 0
00408EBE|.68 68074700   push menumake.00470768            ; |Subkey = "SOFTWARE\Selteco\Menu Maker"
00408EC3|.68 02000080   push 80000002                     ; |hKey = HKEY_LOCAL_MACHINE
00408EC8|.FF15 10904500 call dword ptr ds:[<&ADVAPI32.RegCr>; \RegCreateKeyExA

wofan 发表于 2006-9-4 15:57:57

对照上面的贴子看,会看得明白些

重新表述如下:
00408C60/$83EC 3C       sub esp,3C
00408C63|.8B4C24 40   mov ecx,dword ptr ss:       ;第一组注册码:123456 的十六进制0x1E240
00408C67|.B8 8F588B4F   mov eax,4F8B588F
00408C6C|.F7E1          mul ecx
00408C6E|.8BC1          mov eax,ecx
00408C70|.53            push ebx
00408C71|.2BC2          sub eax,edx
00408C73|.55            push ebp
00408C74|.D1E8          shr eax,1
00408C76|.03C2          add eax,edx
00408C78|.56            push esi
00408C79|.C1E8 10       shr eax,10
00408C7C|.33D2          xor edx,edx
00408C7E|.BE 0A000000   mov esi,0A
00408C83|.F7F6          div esi
00408C85|.B8 5917B7D1   mov eax,D1B71759
00408C8A|.57            push edi
00408C8B|.BF 0A000000   mov edi,0A
00408C90|.BB 0A000000   mov ebx,0A
00408C95|.BD 0A000000   mov ebp,0A
00408C9A|.8BF2          mov esi,edx                         ;余1,即ESI为n1_1
00408C9C|.F7E1          mul ecx
00408C9E|.8BC2          mov eax,edx
00408CA0|.33D2          xor edx,edx
00408CA2|.C1E8 0D       shr eax,0D
00408CA5|.F7F7          div edi
00408CA7|.B8 D34D6210   mov eax,10624DD3
00408CAC|.895424 14   mov dword ptr ss:,edx       ;余2,ESP+14为n1_2
00408CB0|.F7E1          mul ecx
00408CB2|.8BC2          mov eax,edx
00408CB4|.33D2          xor edx,edx
00408CB6|.C1E8 06       shr eax,6
00408CB9|.F7F7          div edi
00408CBB|.B8 1F85EB51   mov eax,51EB851F
00408CC0|.895424 18   mov dword ptr ss:,edx       ;余3,ESP+18为n1_3
00408CC4|.F7E1          mul ecx
00408CC6|.8BC2          mov eax,edx
00408CC8|.33D2          xor edx,edx
00408CCA|.C1E8 05       shr eax,5
00408CCD|.F7F7          div edi
00408CCF|.B8 CDCCCCCC   mov eax,CCCCCCCD
00408CD4|.8BFA          mov edi,edx                         ;余4,EDI为n1_4
00408CD6|.F7E1          mul ecx
00408CD8|.8BC2          mov eax,edx
00408CDA|.33D2          xor edx,edx
00408CDC|.C1E8 03       shr eax,3
00408CDF|.F7F3          div ebx
00408CE1|.8BC1          mov eax,ecx
00408CE3|.B9 0A000000   mov ecx,0A
00408CE8|.8BDA          mov ebx,edx                         ;余5,EBX为n1_5
00408CEA|.33D2          xor edx,edx
00408CEC|.F7F1          div ecx
00408CEE|.8B4C24 54   mov ecx,dword ptr ss:       ;第二组注册码787878787的十六进制:2EF61383
00408CF2|.B8 893BE655   mov eax,55E63B89
00408CF7|.895424 24   mov dword ptr ss:,edx       ;余6,ESP+24为n1_6可以发现,其实就是取出各注册码
00408CFB|.F7E1          mul ecx
00408CFD|.8BC2          mov eax,edx
00408CFF|.33D2          xor edx,edx
00408D01|.C1E8 19       shr eax,19
00408D04|.F7F5          div ebp
00408D06|.B8 6BCA5F6B   mov eax,6B5FCA6B
00408D0B|.895424 28   mov dword ptr ss:,edx       ;余7, ESP+28 为n2_1
00408D0F|.F7E1          mul ecx
00408D11|.8BC2          mov eax,edx
00408D13|.33D2          xor edx,edx
00408D15|.C1E8 16       shr eax,16
00408D18|.F7F5          div ebp
00408D1A|.B8 83DE1B43   mov eax,431BDE83
00408D1F|.895424 2C   mov dword ptr ss:,edx       ;余8,ESP+2C 为 n2_2
00408D23|.F7E1          mul ecx
00408D25|.8BC2          mov eax,edx
00408D27|.33D2          xor edx,edx
00408D29|.C1E8 12       shr eax,12
00408D2C|.F7F5          div ebp
00408D2E|.B8 8F588B4F   mov eax,4F8B588F
00408D33|.895424 30   mov dword ptr ss:,edx       ;余7,ESP+30 为n2_3
00408D37|.F7E1          mul ecx
00408D39|.8BC1          mov eax,ecx
00408D3B|.2BC2          sub eax,edx
00408D3D|.D1E8          shr eax,1
00408D3F|.03C2          add eax,edx
00408D41|.C1E8 10       shr eax,10
00408D44|.33D2          xor edx,edx
00408D46|.F7F5          div ebp
00408D48|.B8 5917B7D1   mov eax,D1B71759
00408D4D|.895424 34   mov dword ptr ss:,edx       ;余8,ESP+34 为 n2_4
00408D51|.F7E1          mul ecx
00408D53|.8BC2          mov eax,edx
00408D55|.33D2          xor edx,edx
00408D57|.C1E8 0D       shr eax,0D
00408D5A|.F7F5          div ebp
00408D5C|.B8 D34D6210   mov eax,10624DD3
00408D61|.895424 38   mov dword ptr ss:,edx       ;余7,ESP+38 为 n2_5
00408D65|.F7E1          mul ecx
00408D67|.8BC2          mov eax,edx
00408D69|.33D2          xor edx,edx
00408D6B|.C1E8 06       shr eax,6
00408D6E|.F7F5          div ebp
00408D70|.B8 1F85EB51   mov eax,51EB851F
00408D75|.895424 3C   mov dword ptr ss:,edx       ;余8,ESP+3C 为 n2_6
00408D79|.F7E1          mul ecx
00408D7B|.8BC2          mov eax,edx
00408D7D|.33D2          xor edx,edx
00408D7F|.C1E8 05       shr eax,5
00408D82|.F7F5          div ebp
00408D84|.B8 CDCCCCCC   mov eax,CCCCCCCD
00408D89|.895424 40   mov dword ptr ss:,edx       ;余7, ESP+40 为 n2_7
00408D8D|.F7E1          mul ecx
00408D8F|.8BC2          mov eax,edx
00408D91|.33D2          xor edx,edx
00408D93|.C1E8 03       shr eax,3
00408D96|.F7F5          div ebp
00408D98|.8BC1          mov eax,ecx
00408D9A|.B9 0A000000   mov ecx,0A
00408D9F|.8BEA          mov ebp,edx                         ;余8, EBP 为 n2_8
00408DA1|.33D2          xor edx,edx
00408DA3|.F7F1          div ecx
00408DA5|.8B4424 3C   mov eax,dword ptr ss:
00408DA9|.8D0C02      lea ecx,dword ptr ds:      ;EDX:余9为 n2_9
00408DAC|.8B4424 34   mov eax,dword ptr ss:
00408DB0|.8B5424 30   mov edx,dword ptr ss:
00408DB4|.03C8          add ecx,eax
00408DB6|.8B4424 28   mov eax,dword ptr ss:
00408DBA|.03CA          add ecx,edx
00408DBC|.8B5424 24   mov edx,dword ptr ss:
00408DC0|.03C8          add ecx,eax
00408DC2|.03CA          add ecx,edx
00408DC4|.03CF          add ecx,edi
00408DC6|.03CE          add ecx,esi                         ;累加:N2_6+N2_9+N2_4+N2_3+N2_1+N1_6+N1_4+N1_1记为:累加
////////////////////////////////////////////////////////////
8+7+8+7+7+6+4+1=0x30

////////////////////////////////////////////////////////////
00408DC8|.BE 0A000000   mov esi,0A
00408DCD|.8D41 04       lea eax,dword ptr ds:
00408DD0|.99            cdq
00408DD1|.F7FE          idiv esi
00408DD3|.3BD3          cmp edx,ebx=========>前已述及:EBX就是N1_5,它应该等于:(累加+4) mod 0xA=2
00408DD5|.74 0C         je short menumake.00408DE3
00408DD7|.5F            pop edi
00408DD8|.5E            pop esi
00408DD9|.5D            pop ebp
00408DDA|.33C0          xor eax,eax
00408DDC|.5B            pop ebx
00408DDD|.83C4 3C       add esp,3C
00408DE0|.C2 0800       retn 8
00408DE3|>03CA          add ecx,edx
00408DE5|.BE 0A000000   mov esi,0A
00408DEA|.8D41 01       lea eax,dword ptr ds:
00408DED|.99            cdq
00408DEE|.F7FE          idiv esi
00408DF0|.3B5424 18   cmp edx,dword ptr ss:===>esp+18就是N1_3:(累加+N1_5+1) mod 0xA=1
00408DF4|.74 0C         je short menumake.00408E02
00408DF6|.5F            pop edi
00408DF7|.5E            pop esi
00408DF8|.5D            pop ebp
00408DF9|.33C0          xor eax,eax
00408DFB|.5B            pop ebx
00408DFC|.83C4 3C       add esp,3C
00408DFF|.C2 0800       retn 8
00408E02|>03CA          add ecx,edx
00408E04|.BE 0A000000   mov esi,0A
00408E09|.8D41 08       lea eax,dword ptr ds:
00408E0C|.99            cdq
00408E0D|.F7FE          idiv esi
00408E0F|.3B5424 2C   cmp edx,dword ptr ss:===>ESP+2C就是N2_2:(累加+N1_5+N1_3+8)mod 0xA=9
00408E13|.74 0C         je short menumake.00408E21
00408E15|.5F            pop edi
00408E16|.5E            pop esi
00408E17|.5D            pop ebp
00408E18|.33C0          xor eax,eax
00408E1A|.5B            pop ebx
00408E1B|.83C4 3C       add esp,3C
00408E1E|.C2 0800       retn 8
00408E21|>03CA          add ecx,edx
00408E23|.BE 0A000000   mov esi,0A
00408E28|.8D41 05       lea eax,dword ptr ds:
00408E2B|.99            cdq
00408E2C|.F7FE          idiv esi
00408E2E|.3B5424 40   cmp edx,dword ptr ss:===>ESP+40就是N2_7:(累加+N1_5+N1_3+N2_2+5) mod 0xA=5
00408E32|.74 0C         je short menumake.00408E40
00408E34|.5F            pop edi
00408E35|.5E            pop esi
00408E36|.5D            pop ebp
00408E37|.33C0          xor eax,eax
00408E39|.5B            pop ebx
00408E3A|.83C4 3C       add esp,3C
00408E3D|.C2 0800       retn 8
00408E40|>03CA          add ecx,edx
00408E42|.BE 0A000000   mov esi,0A
00408E47|.8D41 09       lea eax,dword ptr ds:
00408E4A|.99            cdq
00408E4B|.F7FE          idiv esi
00408E4D|.3BD5          cmp edx,ebp=============>EBP 就是N2_8:(累加+N1_5+N1_3+N2_2+N2_7+9)mod 0xA=4
00408E4F|.74 0C         je short menumake.00408E5D
00408E51|.5F            pop edi
00408E52|.5E            pop esi
00408E53|.5D            pop ebp
00408E54|.33C0          xor eax,eax
00408E56|.5B            pop ebx
00408E57|.83C4 3C       add esp,3C
00408E5A|.C2 0800       retn 8
00408E5D|>03CA          add ecx,edx
00408E5F|.BE 0A000000   mov esi,0A
00408E64|.8D41 01       lea eax,dword ptr ds:
00408E67|.99            cdq
00408E68|.F7FE          idiv esi
00408E6A|.3B5424 38   cmp edx,dword ptr ss:===>ESP+38就是N2_5:(累加+N1_5+N1_3+N2_2+N2_7+N2_8+1)mod 0xA=0
00408E6E|.74 0C         je short menumake.00408E7C
00408E70|.5F            pop edi
00408E71|.5E            pop esi
00408E72|.5D            pop ebp
00408E73|.33C0          xor eax,eax
00408E75|.5B            pop ebx
00408E76|.83C4 3C       add esp,3C
00408E79|.C2 0800       retn 8
00408E7C|>8D440A 02   lea eax,dword ptr ds:
00408E80|.B9 0A000000   mov ecx,0A
00408E85|.99            cdq
00408E86|.F7F9          idiv ecx
00408E88|.8B4C24 14   mov ecx,dword ptr ss:=====>ESP+14就是N1_2:(累加+N1_5+N1_3+N2_2+N2_7+N2_8+N2_5+2)=1
00408E8C|.33C0          xor eax,eax
00408E8E|.5F            pop edi
00408E8F|.5E            pop esi
00408E90|.5D            pop ebp
00408E91|.5B            pop ebx
00408E92|.3BD1          cmp edx,ecx
00408E94|.0F94C0      sete al
00408E97|.83C4 3C       add esp,3C
00408E9A\.C2 0800       retn 8

=====================================================
于是,假设有假注册码:123456-787878787
则会有真注册码:111426-797808547

wofan 发表于 2006-9-4 15:59:07

一股作气,就发上它的注册机源码,不是注册机哟

注册机源码:
unit M_Unit;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;

type
TM_Form = class(TForm)
    Edt_regone: TEdit;
    Lbl_Link: TLabel;
    Edt_regtwo: TEdit;
    Btn_OK: TButton;
    procedure FormPaint(Sender: TObject);
    procedure Btn_OKClick(Sender: TObject);
private
    { Private declarations }
public
    { Public declarations }
end;

var
M_Form: TM_Form;

implementation

{$R *.dfm}

procedure TM_Form.FormPaint(Sender: TObject);
begin
Edt_regtwo.SetFocus ;
end;

procedure TM_Form.Btn_OKClick(Sender: TObject);
var
reg1:array of integer;
reg2:array of integer;
i,sum:integer;
rleft,rright:string;
begin
randomize;
reg2:=random(9);
reg2:=random(9);
reg2:=random(9);
reg2:=random(9);
reg2:=random(9);
reg1:=random(9);
reg1:=random(9);
reg1:=random(9);
sum:=reg2+reg2+reg2+reg2+reg2+reg1+reg1+reg1;
reg1:=(sum+4)mod $A;
sum:=sum+reg1;
reg1:=(sum+1) mod $A;
sum:=sum+reg1;
reg2:=(sum+8)mod $A;
sum:=sum+reg2;
reg2:=(sum+5)mod $A;
sum:=sum+reg2;
reg2:=(sum+9)mod $A;
sum:=sum+reg2;
reg2:=(sum+1)mod $A;
reg1:=(sum+reg2+2) mod $A;
for i:=low(reg1) to high(reg1) do
rleft:=rleft+inttostr(reg1);
for i:=low(reg2) to high(reg2) do
rright:=rright+inttostr(reg2);
Edt_regone.text:=rleft;
Edt_regtwo.text:=rright;
end;

end.

caterpilla 发表于 2006-9-4 16:14:12

先标记,慢慢学。。。。。

xingbing 发表于 2006-9-4 17:10:59

看的头晕。慢慢学吧。

hnxyy 发表于 2006-9-4 17:39:08

标记一下,以后学习

bfqyygy 发表于 2006-9-4 21:14:54

收下慢慢学习!

cha23 发表于 2006-9-5 13:11:47

学习一下/:D

avel 发表于 2006-9-25 14:24:38

够详细的~!
保存一下! :victory:

自由的云 发表于 2006-9-26 08:40:58

头晕哦 先搞下来慢慢来:lol:
页: [1] 2 3
查看完整版本: 其实本贴已经发在看雪了, 不过这里的任务也要完成呀