home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Corleone / winzip70-keygen.txt < prev   
Text File  |  2000-05-25  |  10KB  |  244 lines

  1. winzip 7.0 stuff for a keygen...R!SC 28th May 1999...risc@notme.com...
  2.  
  3. ..best to print this text then study it, it will make it easier to follow..
  4.  
  5. after bpx getdlgitemtext, twice (1 to get the name, 1 to get the code) you should soon 
  6. end up near here.. (getdlgitemtext breaks @ 408036, @ 40805c is the main call to check 
  7. the information)
  8.  
  9. * Reference To: USER32.GetDlgItemTextA, Ord:00F5h
  10.                                   |
  11. :00408036 FF150C844600            Call dword ptr [0046840C]
  12. :0040803C 56                      push esi            <-- pointer to code
  13. :0040803D E800160200              call 00429642        <-- kill extra spaces on the end
  14. :00408042 59                      pop ecx
  15. :00408043 56                      push esi
  16. :00408044 E822160200              call 0042966B        <-- kill extra spaces at the beginning
  17. :00408049 803D18D9470000          cmp byte ptr [0047D918], 00    <-- check first char of name
  18. :00408050 59                      pop ecx                          - if NULL, no information was
  19. :00408051 745F                    je 004080B2                      - entered
  20. :00408053 803D48D9470000          cmp byte ptr [0047D948], 00    <-- check first char of serial
  21. :0040805A 7456                    je 004080B2                      - NULL==no info entered
  22. :0040805C E8EAFAFFFF              call 00407B4B        <-- call the calculation routine
  23.  
  24.  
  25. tracing into ':0040805C CALL 00407B4B' you will (should) soon end up here... 
  26.  
  27.  
  28. :00407C0E 8D85C0FEFFFF            lea eax, dword ptr [ebp+FFFFFEC0]
  29. :00407C14 50                      push eax        <--pointer to buffer for real reg-code to go
  30. :00407C15 57                      push edi        <--pointer to ascii name we entered
  31. :00407C16 E8AB000000              call 00407CC6    <--calculate the serial
  32. :00407C1B 59                      pop ecx        <--pointer to ascii name we entered
  33. :00407C1C BE48D94700              mov esi, 0047D948    <--ascii 'fake' serial we entered
  34. :00407C21 59                      pop ecx        <--pointer to ascii real serial
  35.  
  36. there, see, the code is calculated when call 00407CC6 is executed, and the 'real' serial no.
  37. is mirrored in memory, pointed to by ECX when you come out of the call :)
  38.  
  39. heres the routine that calculates the code(creates 2 word values from it, then using these,
  40. creates the final valid number (being value#2value#1) i.e #1=0278 #2=1234, code = 12340278
  41.  
  42. * Referenced by a CALL at Address:
  43. |:00407C16   
  44. |
  45. :00407CC6 55                      push ebp
  46. :00407CC7 8BEC                    mov ebp, esp
  47. :00407CC9 51                      push ecx
  48. :00407CCA 8B4D08                  mov ecx, dword ptr [ebp+08]    <-- pointer to name
  49. :00407CCD 8365FC00                and dword ptr [ebp-04], 00000000    <-- place to store value #1
  50. :00407CD1 53                      push ebx
  51. :00407CD2 56                      push esi
  52. :00407CD3 8A11                    mov dl, byte ptr [ecx]    <-- first char into dl
  53. :00407CD5 57                      push edi
  54. :00407CD6 33C0                    xor eax, eax
  55. :00407CD8 8BF1                    mov esi, ecx                <-- copy pointer to esi
  56. :00407CDA 33FF                    xor edi, edi
  57.  
  58. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  59. |:00407CF1(U)
  60. |
  61. :00407CDC 84D2                    test dl, dl        <-- check for NULL
  62. :00407CDE 7413                    je 00407CF3          - if so, weve done the whole name
  63. :00407CE0 660FB6D2                movzx dx, dl        <-- clear dh
  64. :00407CE4 8BDF                    mov ebx, edi        <-- counter for what character were on
  65. :00407CE6 0FAFDA                  imul ebx, edx        <-- multiple the count by the ascii value
  66. :00407CE9 015DFC                  add dword ptr [ebp-04], ebx    <-- add the answer to value #1
  67. :00407CEC 8A5601                  mov dl, byte ptr [esi+01]        <-- get next char
  68. :00407CEF 47                      inc edi            <-- increase counter
  69. :00407CF0 46                      inc esi            <-- increase character pointer
  70. :00407CF1 EBE9                    jmp 00407CDC        <-- loop until char==NULL
  71.  
  72. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  73. |:00407CDE(C)
  74. |
  75. :00407CF3 C705DCD3470001000000    mov dword ptr [0047D3DC], 00000001
  76. :00407CFD 8BF1                    mov esi, ecx        <-- copy pointer to name
  77. :00407CFF 8A09                    mov cl, byte ptr [ecx]    <-- get first char 
  78.  
  79. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  80. |:00407D1C(U)
  81. |
  82. :00407D01 84C9                    test cl, cl        <-- check for NULL
  83. :00407D03 7419                    je 00407D1E          - if so, weve done every letter
  84. :00407D05 660FB6C9                movzx cx, cl        <-- clear ch
  85. :00407D09 6821100000              push 00001021        <-- magic xor value
  86. :00407D0E 51                      push ecx            <-- the characters ascii value
  87. :00407D0F 50                      push eax            <-- value #2 
  88. :00407D10 E82A000000              call 00407D3F        <-- do some real complicated stuff (see ARRGH!!)
  89. :00407D15 8A4E01                  mov cl, byte ptr [esi+01]    <-- get next char
  90. :00407D18 83C40C                  add esp, 0000000C
  91. :00407D1B 46                      inc esi            <-- increase char pointer
  92. :00407D1C EBE3                    jmp 00407D01        <-- loop until [char]==NULL
  93.  
  94. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  95. |:00407D03(C)
  96. |
  97. :00407D1E 0FB74DFC                movzx ecx, word ptr [ebp-04]    <-- retrive value #1 (dw)
  98. :00407D22 83C063                  add eax, 00000063    <-- fuckup value #2 a bit more
  99. :00407D25 51                      push ecx            <-- push value #2
  100. :00407D26 0FB7C0                  movzx eax, ax        <-- knock value #2 down to a dw
  101. :00407D29 50                      push eax            <-- push value #1
  102.  
  103. * Possible StringData Ref from Data Obj ->"%04X%04X"
  104.                                   |
  105. :00407D2A 687CF44600              push 0046F47C
  106. :00407D2F FF750C                  push [ebp+0C]
  107. :00407D32 E809E20400              call 00455F40        <-- convert HEX value's #1 & #2 into ASCii
  108. :00407D37 83C410                  add esp, 00000010      - in reverse order, so the value reads #2#1
  109. :00407D3A 5F                      pop edi
  110. :00407D3B 5E                      pop esi
  111. :00407D3C 5B                      pop ebx
  112. :00407D3D C9                      leave
  113. :00407D3E C3                      ret
  114.  
  115. =====ARRGH!!!=======================================
  116.  
  117. * Referenced by a CALL at Addresses:
  118. |:00407D10   , :00407DFB   big bad value #2 creator routine
  119. |
  120. :00407D3F 55                      push ebp
  121. :00407D40 8BEC                    mov ebp, esp
  122. :00407D42 8B4508                  mov eax, dword ptr [ebp+08]
  123. :00407D45 56                      push esi
  124. :00407D46 33C9                    xor ecx, ecx        <-- clear ecx
  125. :00407D48 6A08                    push 00000008        <-- how many times to do maths on every character
  126. :00407D4A 8A6D0C                  mov ch, byte ptr [ebp+0C]    <-- ch==ascii value of name
  127. :00407D4D 5A                      pop edx            <-- edx==8 (loop counter)
  128.  
  129. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  130. |:00407D65(C)
  131. |
  132. :00407D4E 8BF1                    mov esi, ecx        <-- copy ecx into esi
  133. :00407D50 33F0                    xor esi, eax    <-- xor old value #2 with ascii letter from name
  134. :00407D52 66F7C60080              test si, 8000    <-- i think this checks if higest bit is set..
  135. :00407D57 7407                    je 00407D60      - i.e is it signed or unsigned, positive or neg..
  136. :00407D59 03C0                    add eax, eax    <-- add old value #2 to itself
  137. :00407D5B 334510                  xor eax, dword ptr [ebp+10]    <-- our magic xor number (00001021)
  138. :00407D5E EB02                    jmp 00407D62
  139.  
  140. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  141. |:00407D57(C)
  142. |
  143. :00407D60 D1E0                    shl eax, 1    <-- shift contents of eax over to the left by 1 bit
  144.  
  145. * Referenced by a (U)nconditional or (C)onditional Jump at Address:
  146. |:00407D5E(U)
  147. |
  148. :00407D62 D1E1                    shl ecx, 1    <-- shift contents of ecx over to the left by 1 bit
  149. :00407D64 4A                      dec edx        <-- decrease counter
  150. :00407D65 75E7                    jne 00407D4E
  151. :00407D67 5E                      pop esi
  152. :00407D68 5D                      pop ebp
  153. :00407D69 C3                      ret
  154.  
  155.  
  156. okay, we have the code calculation routine, quite simple ;) so lets rewrite it in asm 
  157. (erm win32asm, but just the calculation bit, no input / output for you...)
  158.  
  159. ;--winzip keygen code--R!SC--http://csir.cjb.net--risc@notme.com--28th May 1999--
  160.  
  161. input_name    db    'R!SC'
  162.             db    40 dup (0)
  163. value_1        dd    0
  164. value_2        dd    0
  165. finalvalue    dd    0
  166.  
  167. start:        ;)
  168.  
  169. calc_value_1:
  170.     lea        esi, input_name
  171.     xor        edi, edi
  172.     mov        dword ptr [value_1], edi
  173.     mov        dword ptr [value_2], edi
  174.     mov        dword ptr [finalvalue], edi        ; make sure all values are clear before we begin
  175.     xor        eax, eax
  176.     xor        ebx, ebx
  177.     mov        dl, byte ptr [esi]
  178. value_1_loop:
  179.     test    dl, dl
  180.     je        done_value_1
  181.     movzx    dx, dl    
  182.     mov        ebx, edi
  183.     imul    ebx, edx
  184.     add        dword ptr [value_1], ebx
  185.     mov        dl, byte ptr [esi+1]
  186.     inc        edi
  187.     inc        esi
  188.     jmp        value_1_loop
  189.     
  190. done_value_1:
  191.     lea        esi, input_name
  192. value_2_loop:
  193.     xor        ecx, ecx
  194.     mov        ch, byte ptr [esi]
  195.     test    ch, ch
  196.     je        done_value_2
  197.     mov        edx, 8
  198. arrgh_1:
  199.     mov        ebx, ecx    ; i use ebx instead of esi for this bit :)
  200.     xor        ebx, eax
  201.     test    bx, 08000h
  202.     je        arrgh_signed
  203.     add        eax, eax
  204.     xor        eax, 00001021h
  205.     jmp        arrgh_not_signed
  206. arrgh_signed:
  207.     shl        eax, 01
  208. arrgh_not_signed:
  209.     shl        ecx, 01
  210.     dec        edx
  211.     jne        arrgh_1
  212.     
  213.     inc        esi
  214.     jmp        value_2_loop
  215. done_value_2:
  216.     add        eax, 063h
  217.     movzx    eax, ax
  218.     mov        word ptr [finalvalue+2], ax
  219.     mov        eax, value_1
  220.     mov        word ptr [finalvalue],ax
  221.     mov        eax, [finalvalue]
  222.     ;int 03
  223.  
  224. ;--winzip keygen code--R!SC--http://csir.cjb.net--risc@notme.com--28th May 1999--
  225.  
  226.     
  227. i used this code in my keygen, and it worked 100% :)  
  228.  
  229. you can enter a maximum of 40 characters, extra leading & trailing spaces are chopped off
  230.  
  231. i.e
  232. "R!SC    99   ",0 --> "R!SC    99",0
  233. "  oh my       1",0 --> "oh my    1",0
  234. "heh   ",0 --> "heh",0
  235. '   R!SC !"ú    $%^& *()::',0 --> 'R!SC !"ú    $%^& *()::',0
  236.  
  237. okay! so you should have no problem coding your own keygen for winzip now!!
  238.  
  239. short & sweet keygen tutorial, with just the essential information
  240. written friday afternoon, may 28th 1999 by R!SC
  241.  
  242. if you want the real messy source code (TASM 5) mail me
  243. <eof>
  244.