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

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