很是郁闷,我是临时会员不能让我回复,只能自己建个帖子,希望coldpine不会见怪。。。
coldpine的帖子链接是http://bbs.pediy.com/showthread.php?threadid=31445
--------------------------------------------------------------------------------------------------------
00401000 /$ 55 push ebp ;此处下断点
00401001 |. 8BEC mov ebp, esp
00401003 |. 60 pushad
00401004 |. 6A 32 push 32 ; /Count = 32 (50.)
00401006 |. 68 CC304000 push 004030CC ; |Buffer = coldpine.004030CC
0040100B |. 68 D0070000 push 7D0 ; |ControlID = 7D0 (2000.)
00401010 |. FF75 08 push dword ptr [ebp+8] ; |hWnd
00401013 |. E8 B2070000 call <jmp.&user32.GetDlgItemTextA> ; \GetDlgItemTextA
00401018 |. 8D05 CC304000 lea eax, dword ptr [4030CC]
0040101E |. 33DB xor ebx, ebx
00401020 |. 33C9 xor ecx, ecx
00401022 |> 8A18 /mov bl, byte ptr [eax] ;关键算法,在后面分析
00401024 |. 80FB 00 |cmp bl, 0
00401027 |. 74 08 |je short 00401031
00401029 |. C1C3 08 |rol ebx, 8
0040102C |. 03CB |add ecx, ebx
0040102E |. 40 |inc eax
0040102F |.^ EB F1 \jmp short 00401022
00401031 |> 51 push ecx ; /<%X>
00401032 |. 68 0E304000 push 0040300E ; |Format = "%X"
00401037 |. 68 CC304000 push 004030CC ; |s = coldpine.004030CC
0040103C |. E8 77070000 call <jmp.&user32.wsprintfA> ; \wsprintfA
00401041 |. 83C4 0C add esp, 0C
00401044 |. 0FB605 CF3040>movzx eax, byte ptr [4030CF] ; [4030cf]为31,不是则跳走
0040104B |. 05 A4000000 add eax, 0A4
00401050 |. 8BD8 mov ebx, eax
00401052 |. C1E3 03 shl ebx, 3
00401055 |. 03D8 add ebx, eax
00401057 |. C1E3 02 shl ebx, 2
0040105A |. 03D8 add ebx, eax
0040105C |. 0FCB bswap ebx
0040105E |. 81FB 00001EC9 cmp ebx, C91E0000
00401064 |. 0F85 D9000000 jnz 00401143
0040106A |. 803D D3304000>cmp byte ptr [4030D3], 46 ; [4030d3]为46,不是则跳走
00401071 |. 0F85 CC000000 jnz 00401143
00401077 |. 0FB605 D13040>movzx eax, byte ptr [4030D1] ; [4030d1]为35,不是则跳走
0040107E |. 83F0 66 xor eax, 66
00401081 |. 8BD8 mov ebx, eax
00401083 |. C1E3 02 shl ebx, 2
00401086 |. 03D8 add ebx, eax
00401088 |. C1CB 07 ror ebx, 7
0040108B |. 81FB 0300003E cmp ebx, 3E000003
00401091 |. 0F85 AC000000 jnz 00401143
00401097 |. 803D CC304000>cmp byte ptr [4030CC], 38 ; [4030cc]为38,不是则跳走
0040109E |. 0F85 9F000000 jnz 00401143
004010A4 |. 803D D0304000>cmp byte ptr [4030D0], 46 ; [4030d0]为46,不是则跳走
004010AB |. 0F85 92000000 jnz 00401143
004010B1 |. 0FB605 CD3040>movzx eax, byte ptr [4030CD] ; [4030cd]为30,不是则跳走
004010B8 |. 69C0 98000000 imul eax, eax, 98
004010BE |. 8BD8 mov ebx, eax
004010C0 |. C1EB 08 shr ebx, 8
004010C3 |. 33D8 xor ebx, eax
004010C5 |. 81FB 9C1C0000 cmp ebx, 1C9C
004010CB |. 75 76 jnz short 00401143
004010CD |. 803D CE304000>cmp byte ptr [4030CE], 44 ; [4030ce]为44,不是则跳走
004010D4 |. 75 6D jnz short 00401143
004010D6 |. 0FB605 D23040>movzx eax, byte ptr [4030D2] ; [4030d2]为35,不是则跳走
004010DD |. C1C0 07 rol eax, 7
004010E0 |. F7D0 not eax
004010E2 |. 3D 7FE5FFFF cmp eax, -1A81
004010E7 |. 75 5A jnz short 00401143
-------------------------------------------------------------------------------------------------------
算法分析:
容易得到真序列号是80D1F55F,记为x1x2x3x4(其中x1代表一个字节80,x2代表D1)
如果我输入yaojd,对应ASCII码为79,61,6F,6A,64,记为a, b, c, d, e
计算过程如下
a0
+ ab0
+ abc0
+ bcda
+ cdeb
= x1x2x3x4
即 a+b=5F
a+b+c=80
a+b+c+d=D1
a+b+c+d+e=F5
后三位cde就确定了一定是21,51,24.由于a+b=5F,我们可以随意取值,不如令a=2F,b=30.
故abcde对应的ASCII码:2F,30,21,51,24.算出了结果/0!Q$