Dark Heaven - Tutorial: Registrierung von MP3-WOLF

Programm: 	MP3-Wolf v1.04 Build: 003
Beschreibung: 	Suchmaschine fr MP3-Dateien
Autor: 		(C) 1997, 1998 TRELLIAN
Groesse: 	204.288 Bytes (MWOLF32.EXE)


Werkzeug: - W32DASM v8.93


1. Lade MP3WOLF und anschlieend W32DASM.


2. Deassembliere nun MWOLF32.EXE ber [Debug/Attach to an Active Process].


3. Mittels [Refs/String Data References] suchen wir nach der Fehlermeldung
   "Invalid Registration Name or Serial Number". Durch einen Doppelklick auf
   die Referenz wird die entsprechende Zeile im Listing angezeigt: 00403553.

* Possible Reference to Dialog: DialogID_008C, CONTROL_ID:0414, ""
                                  |
:00403517 6814040000              push 00000414
:0040351C 53                      push ebx
:0040351D FFD7                    call edi
:0040351F 8D8500FFFFFF            lea eax, dword ptr [ebp+FFFFFF00]
:00403525 50                      push eax
:00403526 E8583E0000              call 00407383
:0040352B 59                      pop ecx
:0040352C 8D4580                  lea eax, dword ptr [ebp-80]
:0040352F 50                      push eax
:00403530 E84E3E0000              call 00407383
:00403535 59                      pop ecx
:00403536 8D4580                  lea eax, dword ptr [ebp-80]
:00403539 50                      push eax
:0040353A 8D8500FFFFFF            lea eax, dword ptr [ebp+FFFFFF00]
:00403540 50                      push eax
:00403541 E8DC9D0000              call 0040D322                ; <- Execute Call
:00403546 59                      pop ecx
:00403547 85C0                    test eax, eax
:00403549 59                      pop ecx
:0040354A 7518                    jne 00403564
:0040354C 6A30                    push 00000030

* Possible StringData Ref from Data Obj ->"Invalid Registration"
                                  |
:0040354E 68245B4100              push 00415B24

* Possible StringData Ref from Data Obj ->"Invalid Registration Name or Serial "
                                        ->"Number"
                                  |
:00403553 68F85A4100              push 00415AF8          ; <- gefundene Referenz
:00403558 53                      push ebx


4. ber der gefundenen Referenz folgen wir dem Funktionsaufruf (call 0040D322)
   in Zeile 00403541 mittels [Execute Text/Execute Call].

* Referenced by a CALL at Addresses:
|:00403541   , :0040D2DD   
|
:0040D322 55                      push ebp                ; <- von call 0040D322
:0040D323 8BEC                    mov ebp, esp
:0040D325 83EC30                  sub esp, 00000030
:0040D328 8B450C                  mov eax, dword ptr [ebp+0C]
:0040D32B 53                      push ebx
:0040D32C 56                      push esi
:0040D32D 57                      push edi
:0040D32E 85C0                    test eax, eax
:0040D330 0F840F010000            je 0040D445
:0040D336 8B5D08                  mov ebx, dword ptr [ebp+08]
:0040D339 85DB                    test ebx, ebx
:0040D33B 0F8404010000            je 0040D445
:0040D341 80384D                  cmp byte ptr [eax], 4D    ;<- Kontrolle 1. 'M'
:0040D344 0F85FB000000            jne 0040D445
:0040D34A 80780157                cmp byte ptr [eax+01], 57 ;<- Kontrolle 2. 'W'
:0040D34E 0F85F1000000            jne 0040D445
:0040D354 6A13                    push 00000013
:0040D356 50                      push eax
:0040D357 8D45E4                  lea eax, dword ptr [ebp-1C]
:0040D35A 50                      push eax
:0040D35B E849A1FFFF              call 004074A9
:0040D360 83C40C                  add esp, 0000000C
:0040D363 8D45E4                  lea eax, dword ptr [ebp-1C]
:0040D366 6A2D                    push 0000002D
:0040D368 50                      push eax
:0040D369 E8120D0000              call 0040E080    ; <- Kontrolle Format -123456
:0040D36E 8BF0                    mov esi, eax
:0040D370 59                      pop ecx
:0040D371 85F6                    test esi, esi
:0040D373 59                      pop ecx
:0040D374 89750C                  mov dword ptr [ebp+0C], esi
:0040D377 0F84C8000000            je 0040D445
:0040D37D 802600                  and byte ptr [esi], 00
:0040D380 8D45F8                  lea eax, dword ptr [ebp-08]

* Possible StringData Ref from Data Obj ->"    "
                                  |
:0040D383 68F87A4100              push 00417AF8
:0040D388 50                      push eax
:0040D389 E832060000              call 0040D9C0
:0040D38E 59                      pop ecx
:0040D38F 8D45F8                  lea eax, dword ptr [ebp-08]
:0040D392 59                      pop ecx
:0040D393 6A04                    push 00000004
:0040D395 53                      push ebx
:0040D396 50                      push eax
:0040D397 E834190000              call 0040ECD0
:0040D39C 8A45E4                  mov al, byte ptr [ebp-1C]
:0040D39F 83C40C                  add esp, 0000000C
:0040D3A2 84C0                    test al, al
:0040D3A4 7427                    je 0040D3CD
:0040D3A6 8D7DE4                  lea edi, dword ptr [ebp-1C]

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3C8(C)
|
:0040D3A9 8AD0                    mov dl, al
:0040D3AB 33F6                    xor esi, esi
:0040D3AD 80C208                  add dl, 08

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3C0(C)
|
:0040D3B0 8A4435F8                mov al, byte ptr [ebp+esi-08]
:0040D3B4 8D4C35F8                lea ecx, dword ptr [ebp+esi-08]
:0040D3B8 F6EA                    imul dl
:0040D3BA 46                      inc esi
:0040D3BB 8801                    mov byte ptr [ecx], al
:0040D3BD 83FE04                  cmp esi, 00000004
:0040D3C0 7CEE                    jl 0040D3B0
:0040D3C2 8A4701                  mov al, byte ptr [edi+01]
:0040D3C5 47                      inc edi
:0040D3C6 84C0                    test al, al
:0040D3C8 75DF                    jne 0040D3A9
:0040D3CA 8B750C                  mov esi, dword ptr [ebp+0C]

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3A4(C)
|
:0040D3CD 8A0B                    mov cl, byte ptr [ebx]
:0040D3CF 84C9                    test cl, cl
:0040D3D1 7419                    je 0040D3EC
:0040D3D3 8BD3                    mov edx, ebx

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3EA(C)
|
:0040D3D5 33C0                    xor eax, eax
:0040D3D7 80C108                  add cl, 08

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3E2(C)
|
:0040D3DA 304C05F8                xor byte ptr [ebp+eax-08], cl
:0040D3DE 40                      inc eax
:0040D3DF 83F804                  cmp eax, 00000004
:0040D3E2 7CF6                    jl 0040D3DA
:0040D3E4 8A4A01                  mov cl, byte ptr [edx+01]
:0040D3E7 42                      inc edx
:0040D3E8 84C9                    test cl, cl
:0040D3EA 75E9                    jne 0040D3D5

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3D1(C)
|
:0040D3EC 8B45F8                  mov eax, dword ptr [ebp-08]
:0040D3EF 85C0                    test eax, eax
:0040D3F1 7D04                    jge 0040D3F7
:0040D3F3 F7D8                    neg eax
:0040D3F5 85C0                    test eax, eax

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3F1(C)
|
:0040D3F7 7503                    jne 0040D3FC
:0040D3F9 6A01                    push 00000001
:0040D3FB 58                      pop eax

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D3F7(C)
|
:0040D3FC B90F270000              mov ecx, 0000270F

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D40A(U)
|
:0040D401 3BC1                    cmp eax, ecx        ; <- Vergleicht Wert < 999
:0040D403 7D07                    jge 0040D40C
:0040D405 8D0480                  lea eax, dword ptr [eax+4*eax]
:0040D408 D1E0                    shl eax, 1
:0040D40A EBF5                    jmp 0040D401

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D403(C)
|
:0040D40C B93F420F00              mov ecx, 000F423F

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D41B(U)
|
:0040D411 3BC1                    cmp eax, ecx     ; <- Vergleicht Wert < 999999
:0040D413 7E08                    jle 0040D41D     ;   Breakpoint, 3. EAX = Code
:0040D415 6A0A                    push 0000000A
:0040D417 99                      cdq
:0040D418 5F                      pop edi
:0040D419 F7FF                    idiv edi
:0040D41B EBF4                    jmp 0040D411

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D413(C)
|
:0040D41D 50                      push eax

* Possible StringData Ref from Data Obj ->"%li"
                                  |
:0040D41E 68F47A4100              push 00417AF4
:0040D423 8D45D0                  lea eax, dword ptr [ebp-30]
:0040D426 6A14                    push 00000014
:0040D428 50                      push eax
:0040D429 E872040000              call 0040D8A0
:0040D42E 83C410                  add esp, 00000010
:0040D431 46                      inc esi
:0040D432 8D45D0                  lea eax, dword ptr [ebp-30]
:0040D435 56                      push esi
:0040D436 50                      push eax
:0040D437 E8740A0000              call 0040DEB0
:0040D43C F7D8                    neg eax
:0040D43E 59                      pop ecx
:0040D43F 1BC0                    sbb eax, eax
:0040D441 59                      pop ecx
:0040D442 40                      inc eax
:0040D443 EB02                    jmp 0040D447

* Referenced by a (U)nconditional or (C)onditional Jump at Addresses:
|:0040D330(C), :0040D33B(C), :0040D344(C), :0040D34E(C), :0040D377(C)
|
:0040D445 33C0                    xor eax, eax

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040D443(U)
|
:0040D447 5F                      pop edi
:0040D448 5E                      pop esi
:0040D449 5B                      pop ebx
:0040D44A C9                      leave
:0040D44B C3                      ret


5. Wie im obigen Listing zu sehen ist, mu der Code mit 'MW' beginnen und zum
   Beispiel das Format MW-123456 haben.

   In Zeile 0040D411 erfolgt der Vergleich des aus dem Namen berechneten Codes
   mit 999999. Da der Wert (in EAX) beim 1. Vergleich grer ist, erfolgt eine
   Division und erneuter Vergleich. Diese Schleife wird solange wiederholt, bis
   der Wert (EAX) < 999999 (ECX) ist.

   Wir setzen also auf diesen Vergleich unseren Breakpoint [F2], wechseln zu
   MP3WOLF und geben beliebige Registrierdaten im obigen Format ein:

   z.B. Registration Name: Dark Heaven
        Serial Number    : MW-123456


6. Nach der Eingabebesttigung wird W32DASM beim Breakpoint aktiv und wir knnen
   uns den Inhalt der Vergleiche (cmp eax,ecx) anschauen.

   Sofern der Wert (EAX) > 999999 (ECX) ist, setzen wir das Programm mit [F7]
   und [F9] fort, bis wir einen kleineren Wert erhalten.

   EAX = 000B79C2 (hex) = 752066 (dez)  <- der gesuchte Code


7. Mit dem gefundenen Code knnen wir nun MP3WOLF registrieren und erhalten
   die Erfolgsmeldung "Thank you for registering MP3-Wolf.":

   z.B. Registration Name: Dark Heaven
        Serial Number    : MW-752066


8. Nach der erfolgreichen Registrierung trgt MP3WOLF folgende Zeilen in die
   Datei MWOLF.INI im Installationsverzeichnis:

   licensee=Dark Heaven
   id=MW-752066



Viel Spa beim CRACKEN!
Dark Heaven
25.02.1999


