软件名称:幼儿园信息管理系统V3.0
下载地址:http://www.ynxbs.com/YE/default.htm
软件编写:DELPHI
壳 :没有
没有什么目的,只为学习。
此软件,爆破起来N简单的(有注明)。。。
作内存注册机也很简单(有注明)。。。,,
作算法注册机也简单。。。
本文只适合于新手。菜鸟。高手可以飘过。。。。。。。。。。。。。。。 不废话了,开始。
查下没壳,OK!继续。
试试运行软件,系统维护 -> 软件注册 发现软件默认是注册成功,可是名称是 满洲里市冬鸽少儿艺术学校 。我们要换其它的名字。
基础数据设置 -> 班级设置 -> 点击:那个提示为修改 的按钮,输入你要注册的名称:此处我输入:Jason
然后 -> 系统维护 -> 软件注册 发现提示要注册了,点一下 确定 按钮发现注册不成功了,这时随便输入一个数值。
然后用 W32asm 反汇编一下:查找字符:注册 ,很容易找到 注册码不正确......。
然后我们双击该字符串就到 00699628 这里,我们再往上看看。 这个 006995D8 地址很重要。
这个我打开 OD 加载 main.exe 程序。。
然后我们就在工具栏点: L 按钮左边的那个按钮(转到汇编地址),然后输入 006995D8 回车。
转到此地址后,我们就按一下 F2(设置断点)
然后按F9运,,,一直到注册那个,,点击 确定,就被断在006995D8 这里了:
006995D8 /. 55 push ebp
006995D9 |. 8BEC mov ebp, esp
006995DB |. 33C9 xor ecx, ecx
006995DD |. 51 push ecx
006995DE |. 51 push ecx
006995DF |. 51 push ecx
006995E0 |. 51 push ecx
006995E1 |. 53 push ebx
006995E2 |. 8BD8 mov ebx, eax
006995E4 |. 33C0 xor eax, eax
006995E6 |. 55 push ebp
006995E7 |. 68 C7966900 push 006996C7
006995EC |. 64:FF30 push dword ptr fs:[eax]
006995EF |. 64:8920 mov dword ptr fs:[eax], esp
006995F2 |. 8D55 F8 lea edx, dword ptr [ebp-8]
006995F5 |. 8B83 F4020000 mov eax, dword ptr [ebx+2F4]
006995FB |. E8 848DDBFF call 00452384 ; 获取用户名
00699600 |. 8B45 F8 mov eax, dword ptr [ebp-8]
00699603 |. 8D55 FC lea edx, dword ptr [ebp-4]
00699606 |. E8 B966E7FF call 0050FCC4 ; 计算得到真正的注册码,F7进去。
0069960B |. 8B45 FC mov eax, dword ptr [ebp-4]
0069960E |. 50 push eax
0069960F |. 8D55 F4 lea edx, dword ptr [ebp-C] ; 此处可以作内存注册机,只要读出 EAX的值就
可以了。
00699612 |. 8B83 FC020000 mov eax, dword ptr [ebx+2FC]
00699618 |. E8 678DDBFF call 00452384
0069961D |. 8B55 F4 mov edx, dword ptr [ebp-C]
00699620 |. 58 pop eax
00699621 |. E8 7ABDD6FF call 004053A0
00699626 |. 74 1A je short 00699642 ;关键跳,可以将JE改成jmp(74改成EB)达到爆破的目的。
此处我们不说爆破,我们要作的是得到注册算法:
刚才 F7 跟进后:
0050FCC4 /$ 55 push ebp
0050FCC5 |. 8BEC mov ebp, esp
0050FCC7 |. 81C4 F8FEFFFF add esp, -108
0050FCCD |. 53 push ebx
0050FCCE |. 56 push esi
0050FCCF |. 57 push edi
0050FCD0 |. 8955 F8 mov dword ptr [ebp-8], edx
0050FCD3 |. 8945 FC mov dword ptr [ebp-4], eax
0050FCD6 |. 8B45 FC mov eax, dword ptr [ebp-4]
0050FCD9 |. E8 6657EFFF call 00405444
0050FCDE |. 33C0 xor eax, eax
0050FCE0 |. 55 push ebp
0050FCE1 |. 68 4BFD5000 push 0050FD4B
0050FCE6 |. 64:FF30 push dword ptr fs:[eax]
0050FCE9 |. 64:8920 mov dword ptr fs:[eax], esp
0050FCEC |. 8B45 FC mov eax, dword ptr [ebp-4]
0050FCEF |. E8 6057EFFF call 00405454
0050FCF4 |. 8BD0 mov edx, eax
0050FCF6 |. 8D85 F8FEFFFF lea eax, dword ptr [ebp-108]
0050FCFC |. E8 43BBEFFF call 0040B844
0050FD01 |. 33F6 xor esi, esi
0050FD03 |. 8B45 FC mov eax, dword ptr [ebp-4]
0050FD06 |. E8 5155EFFF call 0040525C
0050FD0B |. 8BD0 mov edx, eax
0050FD0D |. 85D2 test edx, edx
0050FD0F |. 7C 1A jl short 0050FD2B
0050FD11 |. 42 inc edx
0050FD12 |. 33C9 xor ecx, ecx
0050FD14 |. 8D85 F8FEFFFF lea eax, dword ptr [ebp-108]
0050FD1A |> 33DB /xor ebx, ebx
0050FD1C |. 8A18 |mov bl, byte ptr [eax] ; 取字母送入BL中
0050FD1E |. 8D79 01 |lea edi, dword ptr [ecx+1] ; 字符位置
0050FD21 |. 0FAFDF |imul ebx, edi ; EBX = EBX * EDI
0050FD24 |. 03F3 |add esi, ebx ; ESI = ESI + EBX
0050FD26 |. 41 |inc ecx
0050FD27 |. 40 |inc eax
0050FD28 |. 4A |dec edx
0050FD29 |.^ 75 EF \jnz short 0050FD1A
0050FD2B |> 8B55 F8 mov edx, dword ptr [ebp-8]
0050FD2E |. 8BC6 mov eax, esi
0050FD30 |. E8 37A9EFFF call 0040A66C ;这里要 F7 跟进去
0050FD35 |. 33C0 xor eax, eax
0050FD37 |. 5A pop edx
0050FD38 |. 59 pop ecx
0050FD39 |. 59 pop ecx
0050FD3A |. 64:8910 mov dword ptr fs:[eax], edx
0050FD3D |. 68 52FD5000 push 0050FD52
0050FD42 |> 8D45 FC lea eax, dword ptr [ebp-4]
0050FD45 |. E8 4A52EFFF call 00404F94
0050FD4A \. C3 retn
以上从地址:0050FD1A 至地址:0050FD29 的算法(DELPHI)
var
I,ebx,esi: Integer;
s:string;
begin
ebx:=0; esi:=0;
s:= 'Jason'; //我刚才输入的注册名,还记得吧。
for I := 1 to Length(s) do begin
ebx:=Ord(s[i]);
ebx :=ebx * i;
esi:=esi + ebx;
end;
s :=IntTohex(esi,8); //这里的结束是:00000647
end;
还没有完呢,上面的 F7 继续跟进:
0040A66C /$ 83C4 F8 add esp, -8
0040A66F |. 6A 00 push 0 ; /Arg1 = 00000000
0040A671 |. 894424 04 mov dword ptr [esp+4], eax ; |
0040A675 |. C64424 08 00 mov byte ptr [esp+8], 0 ; |
0040A67A |. 8D4C24 04 lea ecx, dword ptr [esp+4] ; |
0040A67E |. 8BC2 mov eax, edx ; |
0040A680 |. BA 98A64000 mov edx, 0040A698 ; |ASCII "%d"
0040A685 |. E8 F6190000 call 0040C080 ; \MAIN.0040C080 ;继续F7
0040A68A |. 59 pop ecx
0040A68B |. 5A pop edx
0040A68C \. C3 retn
看注释 继续F7:
0040C080 /$ 55 push ebp
0040C081 |. 8BEC mov ebp, esp
0040C083 |. 81C4 04F0FFFF add esp, -0FFC
0040C089 |. 50 push eax
0040C08A |. 83C4 F8 add esp, -8
0040C08D |. 53 push ebx
0040C08E |. 56 push esi
0040C08F |. 894D F8 mov dword ptr [ebp-8], ecx
0040C092 |. 8955 FC mov dword ptr [ebp-4], edx
0040C095 |. 8BF0 mov esi, eax
0040C097 |. BB 00100000 mov ebx, 1000
0040C09C |. 8B45 FC mov eax, dword ptr [ebp-4]
0040C09F |. E8 B891FFFF call 0040525C
0040C0A4 |. 3D 000C0000 cmp eax, 0C00
0040C0A9 |. 7D 26 jge short 0040C0D1
0040C0AB |. 8B45 FC mov eax, dword ptr [ebp-4]
0040C0AE |. E8 A991FFFF call 0040525C
0040C0B3 |. 50 push eax
0040C0B4 |. 8B45 F8 mov eax, dword ptr [ebp-8]
0040C0B7 |. 50 push eax
0040C0B8 |. 8B45 08 mov eax, dword ptr [ebp+8]
0040C0BB |. 50 push eax
0040C0BC |. 8B4D FC mov ecx, dword ptr [ebp-4]
0040C0BF |. 8D85 F8EFFFFF lea eax, dword ptr [ebp-1008]
0040C0C5 |. BA FF0F0000 mov edx, 0FFF
0040C0CA |. E8 09FBFFFF call 0040BBD8 ;F7
0040C0CF |. EB 0C jmp short 0040C0DD
下面F7:
0040BBD8 $ 55 push ebp
0040BBD9 . 8BEC mov ebp, esp
0040BBDB . 83C4 8C add esp, -74
0040BBDE . 53 push ebx
0040BBDF . 33DB xor ebx, ebx
0040BBE1 . 895D EC mov dword ptr [ebp-14], ebx
0040BBE4 . 53 push ebx
0040BBE5 . 56 push esi
0040BBE6 . 57 push edi
0040BBE7 . 89C7 mov edi, eax
0040BBE9 . 89CE mov esi, ecx
0040BBEB . 31C0 xor eax, eax
0040BBED . 8945 FC mov dword ptr [ebp-4], eax
0040BBF0 . 034D 10 add ecx, dword ptr [ebp+10]
0040BBF3 . 897D F8 mov dword ptr [ebp-8], edi
0040BBF6 . 31C0 xor eax, eax
0040BBF8 . 8945 F4 mov dword ptr [ebp-C], eax
0040BBFB . 8945 F0 mov dword ptr [ebp-10], eax
0040BBFE . 8945 EC mov dword ptr [ebp-14], eax
0040BC01 > 09D2 or edx, edx
0040BC03 . 74 0D je short 0040BC12
0040BC05 > 39CE cmp esi, ecx
0040BC07 . 74 09 je short 0040BC12
0040BC09 . AC lods byte ptr [esi]
0040BC0A . 3C 25 cmp al, 25
0040BC0C . 74 0E je short 0040BC1C
0040BC0E > AA stos byte ptr es:[edi]
0040BC0F . 4A dec edx
0040BC10 .^ 75 F3 jnz short 0040BC05
0040BC12 > 89F8 mov eax, edi
0040BC14 . 2B45 F8 sub eax, dword ptr [ebp-8]
0040BC17 . E9 C0030000 jmp 0040BFDC
0040BC1C > 39CE cmp esi, ecx
0040BC1E .^ 74 F2 je short 0040BC12
0040BC20 . AC lods byte ptr [esi]
0040BC21 . 3C 25 cmp al, 25
0040BC23 .^ 74 E9 je short 0040BC0E
0040BC25 . 8D5E FE lea ebx, dword ptr [esi-2]
0040BC28 . 895D E8 mov dword ptr [ebp-18], ebx
0040BC2B > 8845 E7 mov byte ptr [ebp-19], al
0040BC2E . 3C 2D cmp al, 2D
0040BC30 . 75 05 jnz short 0040BC37
0040BC32 . 39CE cmp esi, ecx
0040BC34 .^ 74 DC je short 0040BC12
0040BC36 . AC lods byte ptr [esi]
0040BC37 > E8 7E000000 call 0040BCBA
0040BC3C . 3C 3A cmp al, 3A
0040BC3E . 75 0A jnz short 0040BC4A
0040BC40 . 895D F4 mov dword ptr [ebp-C], ebx
0040BC43 . 39CE cmp esi, ecx
0040BC45 .^ 74 CB je short 0040BC12
0040BC47 . AC lods byte ptr [esi]
0040BC48 .^ EB E1 jmp short 0040BC2B
0040BC4A > 895D E0 mov dword ptr [ebp-20], ebx
0040BC4D . BB FFFFFFFF mov ebx, -1
0040BC52 . 3C 2E cmp al, 2E
0040BC54 . 75 0A jnz short 0040BC60
0040BC56 . 39CE cmp esi, ecx
0040BC58 .^ 74 B8 je short 0040BC12
0040BC5A . AC lods byte ptr [esi]
0040BC5B . E8 5A000000 call 0040BCBA
0040BC60 > 895D DC mov dword ptr [ebp-24], ebx
0040BC63 . 8975 D8 mov dword ptr [ebp-28], esi
0040BC66 . 51 push ecx
0040BC67 . 52 push edx
0040BC68 . E8 95000000 call 0040BD02 ;F7
上面的F7:
0040BD02 /$ 24 DF and al, 0DF
0040BD04 |. 88C1 mov cl, al
0040BD06 |. B8 01000000 mov eax, 1
0040BD0B |. 8B5D F4 mov ebx, dword ptr [ebp-C]
0040BD0E |. 3B5D 08 cmp ebx, dword ptr [ebp+8]
0040BD11 |. 77 5C ja short 0040BD6F
0040BD13 |. FF45 F4 inc dword ptr [ebp-C]
0040BD16 |. 8B75 0C mov esi, dword ptr [ebp+C]
0040BD19 |. 8D34DE lea esi, dword ptr [esi+ebx*8]
0040BD1C |. 8B06 mov eax, dword ptr [esi]
0040BD1E |. 0FB656 04 movzx edx, byte ptr [esi+4]
0040BD22 |. FF2495 29BD40>jmp dword ptr [edx*4+40BD29]
0040BD29 |. 2ABE4000 dd MAIN.0040BE2A ; 分支表 被用于 0040BD22
0040BD2D |. 6DBD4000 dd MAIN.0040BD6D
0040BD31 |. 91BE4000 dd MAIN.0040BE91
0040BD35 |. 57BF4000 dd MAIN.0040BF57
0040BD39 |. C1BE4000 dd MAIN.0040BEC1
0040BD3D |. 39BF4000 dd MAIN.0040BF39
0040BD41 |. 19BF4000 dd MAIN.0040BF19
0040BD45 |. 6DBD4000 dd MAIN.0040BD6D
0040BD49 |. 6DBD4000 dd MAIN.0040BD6D
0040BD4D |. 6DBD4000 dd MAIN.0040BD6D
0040BD51 |. D2BE4000 dd MAIN.0040BED2
0040BD55 |. FDBE4000 dd MAIN.0040BEFD
0040BD59 |. 53BF4000 dd MAIN.0040BF53
0040BD5D |. A0BE4000 dd MAIN.0040BEA0
0040BD61 |. 6DBD4000 dd MAIN.0040BD6D
0040BD65 |. D9BE4000 dd MAIN.0040BED9
0040BD69 |. 84BD4000 dd MAIN.0040BD84
0040BD6D |> 31C0 xor eax, eax ; Default case of switch 0040BF5D
0040BD6F |> E8 58020000 call 0040BFCC
0040BD74 |. 8B55 E8 mov edx, dword ptr [ebp-18]
0040BD77 |. 8B4D D8 mov ecx, dword ptr [ebp-28]
0040BD7A |. 29D1 sub ecx, edx
0040BD7C |. 8B5D FC mov ebx, dword ptr [ebp-4]
0040BD7F |. E8 DCFDFFFF call 0040BB60
0040BD84 |> 8D5D D0 lea ebx, dword ptr [ebp-30]
0040BD87 |. 8B10 mov edx, dword ptr [eax]
0040BD89 |. 8913 mov dword ptr [ebx], edx
0040BD8B |. 8B50 04 mov edx, dword ptr [eax+4]
0040BD8E |. 8953 04 mov dword ptr [ebx+4], edx
0040BD91 |. 80F9 44 cmp cl, 44 ; Switch (cases 44..58)
0040BD94 |. 74 11 je short 0040BDA7
0040BD96 |. 80F9 55 cmp cl, 55
0040BD99 |. 74 2A je short 0040BDC5
0040BD9B |. 80F9 58 cmp cl, 58
0040BD9E |.^ 75 CD jnz short 0040BD6D
0040BDA0 |. B9 10000000 mov ecx, 10 ; Case 58 ('X') of switch 0040BD91
0040BDA5 |. EB 23 jmp short 0040BDCA
0040BDA7 |> F743 04 00000>test dword ptr [ebx+4], 80000000 ; Case 44 ('D') of switch 0040BD91
0040BDAE |. 74 15 je short 0040BDC5
0040BDB0 |. F71B neg dword ptr [ebx]
0040BDB2 |. 8353 04 00 adc dword ptr [ebx+4], 0
0040BDB6 |. F75B 04 neg dword ptr [ebx+4]
0040BDB9 |. E8 07000000 call 0040BDC5
0040BDBE |. B0 2D mov al, 2D
0040BDC0 |. 41 inc ecx
0040BDC1 |. 4E dec esi
0040BDC2 |. 8806 mov byte ptr [esi], al
0040BDC4 |. C3 retn
0040BDC5 |$ B9 0A000000 mov ecx, 0A ; Case 55 ('U') of switch 0040BD91
0040BDCA |> 8D75 AF lea esi, dword ptr [ebp-51]
0040BDCD |> 53 /push ebx
0040BDCE |. 51 |push ecx
0040BDCF |. 6A 00 |push 0
0040BDD1 |. 51 |push ecx
0040BDD2 |. 8B03 |mov eax, dword ptr [ebx]
0040BDD4 |. 8B53 04 |mov edx, dword ptr [ebx+4]
0040BDD7 |. 8B5D FC |mov ebx, dword ptr [ebp-4]
0040BDDA |. E8 85A7FFFF |call 00406564
0040BDDF |. 59 |pop ecx
0040BDE0 |. 5B |pop ebx
0040BDE1 |. 92 |xchg eax, edx
0040BDE2 |. 80C2 30 |add dl, 30
0040BDE5 |. 80FA 3A |cmp dl, 3A
0040BDE8 |. 72 03 |jb short 0040BDED
0040BDEA |. 80C2 07 |add dl, 7
0040BDED |> 4E |dec esi
0040BDEE |. 8816 |mov byte ptr [esi], dl
0040BDF0 |. 53 |push ebx
0040BDF1 |. 51 |push ecx
0040BDF2 |. 6A 00 |push 0
0040BDF4 |. 51 |push ecx
0040BDF5 |. 8B03 |mov eax, dword ptr [ebx]
0040BDF7 |. 8B53 04 |mov edx, dword ptr [ebx+4]
0040BDFA |. 8B5D FC |mov ebx, dword ptr [ebp-4]
0040BDFD |. E8 9AA6FFFF |call 0040649C
0040BE02 |. 59 |pop ecx
0040BE03 |. 5B |pop ebx
0040BE04 |. 8903 |mov dword ptr [ebx], eax
0040BE06 |. 8953 04 |mov dword ptr [ebx+4], edx
0040BE09 |. 09D0 |or eax, edx
0040BE0B |.^ 75 C0 \jnz short 0040BDCD
0040BE0D |. 8D4D AF lea ecx, dword ptr [ebp-51]
0040BE10 |. 29F1 sub ecx, esi
0040BE12 |. 8B55 DC mov edx, dword ptr [ebp-24]
0040BE15 |. 83FA 10 cmp edx, 10
0040BE18 |. 76 01 jbe short 0040BE1B
0040BE1A |. C3 retn
0040BE1B |> 29CA sub edx, ecx
0040BE1D |. 76 0A jbe short 0040BE29
0040BE1F |. 01D1 add ecx, edx
0040BE21 |. B0 30 mov al, 30
0040BE23 |> 4E /dec esi
0040BE24 |. 8806 |mov byte ptr [esi], al
0040BE26 |. 4A |dec edx
0040BE27 |.^ 75 FA \jnz short 0040BE23
0040BE29 |> C3 retn
0040BE2A |> 80F9 44 cmp cl, 44 ; Switch (cases 44..58)
0040BE2D |. 74 15 je short 0040BE44
0040BE2F |. 80F9 55 cmp cl, 55
0040BE32 |. 74 22 je short 0040BE56
0040BE34 |. 80F9 58 cmp cl, 58
0040BE37 |.^ 0F85 30FFFFFF jnz 0040BD6D
0040BE3D |. B9 10000000 mov ecx, 10 ; Case 58 ('X') of switch 0040BE2A
0040BE42 |. EB 17 jmp short 0040BE5B
0040BE44 |> 09C0 or eax, eax ; Case 44 ('D') of switch 0040BE2A
0040BE46 |. 79 0E jns short 0040BE56
0040BE48 |. F7D8 neg eax
0040BE4A |. E8 07000000 call 0040BE56
0040BE4F |. B0 2D mov al, 2D
0040BE51 |. 41 inc ecx
0040BE52 |. 4E dec esi
0040BE53 |. 8806 mov byte ptr [esi], al
0040BE55 |. C3 retn
0040BE56 |$ B9 0A000000 mov ecx, 0A ; Case 55 ('U') of switch 0040BE2A
0040BE5B |> 8D75 9F lea esi, dword ptr [ebp-61]
0040BE5E |> 31D2 /xor edx, edx
0040BE60 |. F7F1 |div ecx ; EAX = EAX / ECX EDX= EAX MOD ECX
0040BE62 |. 80C2 30 |add dl, 30 ; DL=DL + 30
0040BE65 |. 80FA 3A |cmp dl, 3A
0040BE68 |. 72 03 |jb short 0040BE6D
0040BE6A |. 80C2 07 |add dl, 7
0040BE6D |> 4E |dec esi
0040BE6E |. 8816 |mov byte ptr [esi], dl
0040BE70 |. 09C0 |or eax, eax
0040BE72 |.^ 75 EA \jnz short 0040BE5E
0040BE74 |. 8D4D 9F lea ecx, dword ptr [ebp-61]
0040BE77 |. 29F1 sub ecx, esi
0040BE79 |. 8B55 DC mov edx, dword ptr [ebp-24]
0040BE7C |. 83FA 10 cmp edx, 10
0040BE7F |. 76 01 jbe short 0040BE82
0040BE81 |. C3 retn 此处的算法(DELPHI)
var
ecx,dl,eax: Integer;
s:string;
begin
s:='';
eax :=esi; //此处就是之前算的所得到的值
ecx := $0A;
repeat
dl := eax mod ecx;
eax := eax div ecx ;
dl :=dl + $30;
s:=chr(dl)+s;
until eax = 0;
showmessage(s); //此处的值应该是:1607,即就是注册码了。
end;
============================================================
总结。
这软件的注册算法:
逐一取注册名,将其转换成 ASCII码。然后将其它与字符所在字符串位置相乘。得到总和值假设置为:A
然后 将 A 除 10,得到和模(余数)转换成字符加上 $30后,将此ASCII码转换成字符。逐一连接就得到注册码了。
完整的注册码源码:(DELPHI) function ResultRegKey(const username:string):string;
var
I,ebx,esi,ecx,dl,eax: Integer;
s:string;
begin
Result:='';
ebx:=0; esi:=0;
s:= username;
for I := 1 to Length(s) do begin
ebx:=Ord(s[i]);
ebx :=ebx * i;
esi:=esi + ebx;
end;
s:='';
eax :=esi;
ecx := $0A;
repeat
dl := eax mod ecx;
eax := eax div ecx ;
dl :=dl + $30;
s:=chr(dl)+s;
until eax = 0;
Result:= :=s;
end;
当然,此注册机使用了过多的变量,主要是便于开始时的观察;可以进一步的简化一下,在此省略了。。。。。。
inbreak
2007-8-12 晚22:29
[招生]系统0day安全班,企业级设备固件漏洞挖掘,Linux平台漏洞挖掘!