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. .model SMALL
  3. .stack 100h
  4. .386
  5.  
  6. .DATA         
  7. input    DB 39,0
  8. uname    DB 39 dup (0h) 
  9.  
  10. d47503c  dd 0e3h            ; This is used as initial value for IMUL
  11.  
  12. valid    DB 10,13,'A valid key is: '
  13. realkey  db 12 dup (30h)        ; Serial number is 12 digits long
  14. enstr    db 10,13,'$'                ; Write termination
  15.  
  16. flaffer  db 39 dup (0)            ; Used for the high/low bit cleaned string
  17.  
  18. introtxt DB '          QuickCab 6.2  *Keymaker*       ',10,13
  19.          DB '──────────────|   STONE   |──────────────',10,13
  20.          DB '  ▄▄▄   ▄▄▄    ▄▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄▄    ',10,13
  21.          DB '  ███   ███    ███          ███▄▄▄       ',10,13
  22.          DB '  ███▄  ███    ███▄         ███          ',10,13
  23.          DB '  ▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀▀    ▀▀▀          ',10,13
  24.          DB '─────────────────────────────────────────',10,13
  25.          DB 'u N I T E D  c R Æ C K I N G  f O R C E  ',10,13
  26.          DB '[wIN95/NT]─────────────────────[oCT 1997]',10,13
  27.          DB 'Enter your username: ','$'
  28.  
  29.          DB '2nd&mi' ; Personal tag - not used
  30.  
  31. .CODE
  32.     MOV AX, @DATA            ; Make DS&ES point to the DATA
  33.     MOV DS, AX
  34.     MOV ES, AX
  35.  
  36.     LEA EDX, [introtxt]        ; Write intro text 
  37.     MOV AH, 9h
  38.     INT 21h
  39.  
  40.     MOV AX, 0A00h                  
  41.     LEA EDX, [input]
  42.     INT 21h                ; Get buffered input
  43.  
  44.     movzx ebx, [input+1]        ; Fetch length
  45.     cmp ebx,0            ; if zero - exit
  46.     jz exit
  47.  
  48.     call upcase            ; Uppercase input string
  49.     call cleanit            ; Clean it for high/lowbit chars
  50.  
  51.     xor esi,esi            ; Zero Counter
  52. NextByte:
  53.     movzx eax, byte ptr [input+1]    ; Get length
  54.     CALL genkey            ; Deciede on a letter to use for num-gen
  55.     movzx ebx,[flaffer+edx]
  56.  
  57. nextitera:                ; Generate a digit of the serial
  58.     MOV     EAX,0Ah        
  59.     CALL    GENKEY
  60.     DEC     BL
  61.     JNZ     nextitera
  62.  
  63.     add byte ptr [realkey+esi],dl    ; Make it a digit
  64.     inc esi                ; next byte
  65.     cmp esi,12d
  66.         jnz nextbyte    
  67.  
  68.     mov ah,09h            ; Write the key
  69.     lea edx,[valid]    
  70.     int 21h
  71.  
  72. exit:
  73.     MOV AX,4C00h            ; Exit, error code = 0
  74.     INT 21h
  75.  
  76.  
  77. genkey  proc                ; Work horse of the keymaker
  78.     IMUL    EDX,[d47503C],08088405h
  79.     INC     EDX
  80.     MOV     [d47503C],EDX
  81.     MUL     EDX
  82.     MOV     EAX,EDX
  83.     RET
  84. genkey endp
  85.  
  86. upcase  PROC
  87.     lea edx, [uname]
  88.     mov esi,edx
  89. nextletter:                   ; EBX = No. of letters
  90.     MOV     AL,[EDX]    ; EDX = INTEXT
  91.     CMP     AL,61h
  92.     JB      notlowcase
  93.     CMP     AL,7Ah
  94.     JA      notlowcase
  95.     SUB     AL,20h        ; Lowcase - make it upcase
  96.     MOV     [ESI],AL
  97. notlowcase:
  98.     INC     EDX
  99.     INC     ESI
  100.     DEC     EBX
  101.     TEST    EBX,EBX
  102.     JNZ     nextletter
  103.     Ret
  104. Upcase endp
  105.  
  106. cleanit PROC
  107.     lea edi, [flaffer]        ; Store output here
  108.     lea esi, [uname]        ; Get input from here
  109.     movzx ecx,[input+1]        ; Fetch the length
  110. nextb:
  111.     movzx eax,byte ptr [esi]    ; Fetch a letter
  112.     cmp eax,48            ; Is it low bit?
  113.     jb skip
  114.     cmp eax,90            ; is it high bit?
  115.     jg skip
  116.     movsb                ; no - copy it as it is
  117.     dec ecx                ; move on to next letter
  118.     jnz nextb
  119.     ret
  120. skip:
  121.     inc esi                ; skip it
  122.     dec byte ptr [input+1]        ; decrease length of string
  123.     dec ecx                ; next letter
  124.     jnz nextb
  125.     ret
  126. cleanit ENDP
  127.  
  128. END
  129.  
  130.  
  131.  
  132.