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

  1. ; Author can be email at: stone@one.se ;>
  2. ; Btw - this was formated by DarkStalker's ASMFMT - thanks DS :)
  3. .model SMALL
  4. .stack 100h
  5. .386
  6.  
  7. .DATA         
  8. input    DB 39,0
  9. uname    DB 39 dup (20h) 
  10. valid    DB 10,13,'A valid key is: '
  11. realkey  DB 8 dup (30h)
  12. strend   DB '$'
  13. introtxt DB '           WinDates 3.0  *Keymaker*      ',10,13
  14.          DB '──────────────|   STONE   |──────────────',10,13
  15.          DB '  ▄▄▄   ▄▄▄    ▄▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄▄    ',10,13
  16.          DB '  ███   ███    ███          ███▄▄▄       ',10,13
  17.          DB '  ███▄  ███    ███▄         ███          ',10,13
  18.          DB '  ▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀▀    ▀▀▀          ',10,13
  19.          DB '─────────────────────────────────────────',10,13
  20.          DB 'u N I T E D  c R Æ C K I N G  f O R C E  ',10,13
  21.          DB '[wIN95/NT]─────────────────────[oCT 1997]',10,13
  22.          DB 'Enter your username: ','$'
  23.  
  24.          DB '2nd&mi' ; Personal tag - not used
  25.  
  26. .CODE
  27.     MOV AX, @DATA            ; Make DS&ES point to the DATA
  28.     MOV DS, AX
  29.     MOV ES, AX
  30.  
  31.     LEA EDX, [introtxt]        ; Write intro text 
  32.     MOV AH, 9h
  33.     INT 21h
  34.  
  35.     MOV AX, 0A00h                  
  36.     LEA EDX, [input]
  37.     INT 21h                ; Get buffered input
  38.  
  39.     MOVZX EBX, BYTE PTR [input+1]    ; Get length
  40.     CMP EBX, 0                 ; Did he type anything?
  41.     JZ  EXIT
  42.     MOV BYTE PTR [EBX+input+2],20h  ; If he did erradicate 0dh termination
  43.  
  44.     CALL genkey            ; Generate the key
  45.  
  46.  
  47.     LEA EDX, [valid]        ; write the key
  48.     MOV AH, 09h
  49.     INT 21h
  50.  
  51. EXIT:
  52.     MOV AX,4C00h            ; Exit, error code = 0
  53.     INT 21h
  54.  
  55.  
  56. genkey PROC
  57.     XOR ESI, ESI            ; Reset ESI (A counter)
  58. nextbyte:  
  59.     MOV EAX, ESI            
  60.     AND EAX, 01h
  61.     NEG EAX
  62.     SBB EAX, EAX
  63.     AND EAX, 02
  64.     DEC EAX
  65.     MOVSX EDX, BYTE PTR [ESI+uname]
  66.     MOV ECX, 0Ah
  67.     IMUL EAX, ESI            ; EAX=EAX*ESI
  68.     LEA EAX, [EAX*2+EDX]        ; EAX=2*EAX+"Username byte" 
  69.     CDQ                    
  70.     IDIV ECX            ; Div 10
  71.     ADD BYTE PTR [ESI+realkey],DL    ; division leftover= key
  72.     INC ESI
  73.     CMP ESI,08            ; only 8 bytes matters
  74.     JL  nextbyte
  75.     RET
  76. genkey ENDP
  77.  
  78. END