home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Quantico / km / quickcab.asm.txt < prev    next >
Encoding:
Text File  |  2000-05-25  |  3.2 KB  |  132 lines

  1. ; Author can be email at: stone@one.se ;>
  2.  
  3. .model SMALL
  4.  
  5. .stack 100h
  6.  
  7. .386
  8.  
  9.  
  10.  
  11. .DATA         
  12.  
  13. input    DB 39,0
  14.  
  15. uname    DB 39 dup (0h) 
  16.  
  17.  
  18.  
  19. d47503c  dd 0e3h            ; This is used as initial value for IMUL
  20.  
  21.  
  22.  
  23. valid    DB 10,13,'A valid key is: '
  24.  
  25. realkey  db 12 dup (30h)        ; Serial number is 12 digits long
  26.  
  27. enstr    db 10,13,'$'                ; Write termination
  28.  
  29.  
  30.  
  31. flaffer  db 39 dup (0)            ; Used for the high/low bit cleaned string
  32.  
  33.  
  34.  
  35. introtxt DB '          QuickCab 6.2  *Keymaker*       ',10,13
  36.  
  37.          DB '──────────────|   STONE   |──────────────',10,13
  38.  
  39.          DB '  ▄▄▄   ▄▄▄    ▄▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄▄    ',10,13
  40.  
  41.          DB '  ███   ███    ███          ███▄▄▄       ',10,13
  42.  
  43.          DB '  ███▄  ███    ███▄         ███          ',10,13
  44.  
  45.          DB '  ▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀▀    ▀▀▀          ',10,13
  46.  
  47.          DB '─────────────────────────────────────────',10,13
  48.  
  49.          DB 'u N I T E D  c R Æ C K I N G  f O R C E  ',10,13
  50.  
  51.          DB '[wIN95/NT]─────────────────────[oCT 1997]',10,13
  52.  
  53.          DB 'Enter your username: ','$'
  54.  
  55.  
  56.  
  57.          DB '2nd&mi' ; Personal tag - not used
  58.  
  59.  
  60.  
  61. .CODE
  62.  
  63.     MOV AX, @DATA            ; Make DS&ES point to the DATA
  64.  
  65.     MOV DS, AX
  66.  
  67.     MOV ES, AX
  68.  
  69.  
  70.  
  71.     LEA EDX, [introtxt]        ; Write intro text 
  72.  
  73.     MOV AH, 9h
  74.  
  75.     INT 21h
  76.  
  77.  
  78.  
  79.     MOV AX, 0A00h                  
  80.  
  81.     LEA EDX, [input]
  82.  
  83.     INT 21h                ; Get buffered input
  84.  
  85.  
  86.  
  87.     movzx ebx, [input+1]        ; Fetch length
  88.  
  89.     cmp ebx,0            ; if zero - exit
  90.  
  91.     jz exit
  92.  
  93.  
  94.  
  95.     call upcase            ; Uppercase input string
  96.  
  97.     call cleanit            ; Clean it for high/lowbit chars
  98.  
  99.  
  100.  
  101.     xor esi,esi            ; Zero Counter
  102.  
  103. NextByte:
  104.  
  105.     movzx eax, byte ptr [input+1]    ; Get length
  106.  
  107.     CALL genkey            ; Deciede on a letter to use for num-gen
  108.  
  109.     movzx ebx,[flaffer+edx]
  110.  
  111.  
  112.  
  113. nextitera:                ; Generate a digit of the serial
  114.  
  115.     MOV     EAX,0Ah        
  116.  
  117.     CALL    GENKEY
  118.  
  119.     DEC     BL
  120.  
  121.     JNZ     nextitera
  122.  
  123.  
  124.  
  125.     add byte ptr [realkey+esi],dl    ; Make it a digit
  126.  
  127.     inc esi                ; next byte
  128.  
  129.     cmp esi,12d
  130.  
  131.         jnz nextbyte    
  132.  
  133.  
  134.  
  135.     mov ah,09h            ; Write the key
  136.  
  137.     lea edx,[valid]    
  138.  
  139.     int 21h
  140.  
  141.  
  142.  
  143. exit:
  144.  
  145.     MOV AX,4C00h            ; Exit, error code = 0
  146.  
  147.     INT 21h
  148.  
  149.  
  150.  
  151.  
  152.  
  153. genkey  proc                ; Work horse of the keymaker
  154.  
  155.     IMUL    EDX,[d47503C],08088405h
  156.  
  157.     INC     EDX
  158.  
  159.     MOV     [d47503C],EDX
  160.  
  161.     MUL     EDX
  162.  
  163.     MOV     EAX,EDX
  164.  
  165.     RET
  166.  
  167. genkey endp
  168.  
  169.  
  170.  
  171. upcase  PROC
  172.  
  173.     lea edx, [uname]
  174.  
  175.     mov esi,edx
  176.  
  177. nextletter:                   ; EBX = No. of letters
  178.  
  179.     MOV     AL,[EDX]    ; EDX = INTEXT
  180.  
  181.     CMP     AL,61h
  182.  
  183.     JB      notlowcase
  184.  
  185.     CMP     AL,7Ah
  186.  
  187.     JA      notlowcase
  188.  
  189.     SUB     AL,20h        ; Lowcase - make it upcase
  190.  
  191.     MOV     [ESI],AL
  192.  
  193. notlowcase:
  194.  
  195.     INC     EDX
  196.  
  197.     INC     ESI
  198.  
  199.     DEC     EBX
  200.  
  201.     TEST    EBX,EBX
  202.  
  203.     JNZ     nextletter
  204.  
  205.     Ret
  206.  
  207. Upcase endp
  208.  
  209.  
  210.  
  211. cleanit PROC
  212.  
  213.     lea edi, [flaffer]        ; Store output here
  214.  
  215.     lea esi, [uname]        ; Get input from here
  216.  
  217.     movzx ecx,[input+1]        ; Fetch the length
  218.  
  219. nextb:
  220.  
  221.     movzx eax,byte ptr [esi]    ; Fetch a letter
  222.  
  223.     cmp eax,48            ; Is it low bit?
  224.  
  225.     jb skip
  226.  
  227.     cmp eax,90            ; is it high bit?
  228.  
  229.     jg skip
  230.  
  231.     movsb                ; no - copy it as it is
  232.  
  233.     dec ecx                ; move on to next letter
  234.  
  235.     jnz nextb
  236.  
  237.     ret
  238.  
  239. skip:
  240.  
  241.     inc esi                ; skip it
  242.  
  243.     dec byte ptr [input+1]        ; decrease length of string
  244.  
  245.     dec ecx                ; next letter
  246.  
  247.     jnz nextb
  248.  
  249.     ret
  250.  
  251. cleanit ENDP
  252.  
  253.  
  254.  
  255. END
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.