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.  
  3. ; Btw - this was formated by DarkStalker's ASMFMT - thanks 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 (20h) 
  18.  
  19. valid    DB 10,13,'A valid key is: '
  20.  
  21. realkey  DB 8 dup (30h)
  22.  
  23. strend   DB '$'
  24.  
  25. introtxt DB '           WinDates 3.0  *Keymaker*      ',10,13
  26.  
  27.          DB '──────────────|   STONE   |──────────────',10,13
  28.  
  29.          DB '  ▄▄▄   ▄▄▄    ▄▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄▄    ',10,13
  30.  
  31.          DB '  ███   ███    ███          ███▄▄▄       ',10,13
  32.  
  33.          DB '  ███▄  ███    ███▄         ███          ',10,13
  34.  
  35.          DB '  ▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀▀    ▀▀▀          ',10,13
  36.  
  37.          DB '─────────────────────────────────────────',10,13
  38.  
  39.          DB 'u N I T E D  c R Æ C K I N G  f O R C E  ',10,13
  40.  
  41.          DB '[wIN95/NT]─────────────────────[oCT 1997]',10,13
  42.  
  43.          DB 'Enter your username: ','$'
  44.  
  45.  
  46.  
  47.          DB '2nd&mi' ; Personal tag - not used
  48.  
  49.  
  50.  
  51. .CODE
  52.  
  53.     MOV AX, @DATA            ; Make DS&ES point to the DATA
  54.  
  55.     MOV DS, AX
  56.  
  57.     MOV ES, AX
  58.  
  59.  
  60.  
  61.     LEA EDX, [introtxt]        ; Write intro text 
  62.  
  63.     MOV AH, 9h
  64.  
  65.     INT 21h
  66.  
  67.  
  68.  
  69.     MOV AX, 0A00h                  
  70.  
  71.     LEA EDX, [input]
  72.  
  73.     INT 21h                ; Get buffered input
  74.  
  75.  
  76.  
  77.     MOVZX EBX, BYTE PTR [input+1]    ; Get length
  78.  
  79.     CMP EBX, 0                 ; Did he type anything?
  80.  
  81.     JZ  EXIT
  82.  
  83.     MOV BYTE PTR [EBX+input+2],20h  ; If he did erradicate 0dh termination
  84.  
  85.  
  86.  
  87.     CALL genkey            ; Generate the key
  88.  
  89.  
  90.  
  91.  
  92.  
  93.     LEA EDX, [valid]        ; write the key
  94.  
  95.     MOV AH, 09h
  96.  
  97.     INT 21h
  98.  
  99.  
  100.  
  101. EXIT:
  102.  
  103.     MOV AX,4C00h            ; Exit, error code = 0
  104.  
  105.     INT 21h
  106.  
  107.  
  108.  
  109.  
  110.  
  111. genkey PROC
  112.  
  113.     XOR ESI, ESI            ; Reset ESI (A counter)
  114.  
  115. nextbyte:  
  116.  
  117.     MOV EAX, ESI            
  118.  
  119.     AND EAX, 01h
  120.  
  121.     NEG EAX
  122.  
  123.     SBB EAX, EAX
  124.  
  125.     AND EAX, 02
  126.  
  127.     DEC EAX
  128.  
  129.     MOVSX EDX, BYTE PTR [ESI+uname]
  130.  
  131.     MOV ECX, 0Ah
  132.  
  133.     IMUL EAX, ESI            ; EAX=EAX*ESI
  134.  
  135.     LEA EAX, [EAX*2+EDX]        ; EAX=2*EAX+"Username byte" 
  136.  
  137.     CDQ                    
  138.  
  139.     IDIV ECX            ; Div 10
  140.  
  141.     ADD BYTE PTR [ESI+realkey],DL    ; division leftover= key
  142.  
  143.     INC ESI
  144.  
  145.     CMP ESI,08            ; only 8 bytes matters
  146.  
  147.     JL  nextbyte
  148.  
  149.     RET
  150.  
  151. genkey ENDP
  152.  
  153.  
  154.  
  155. END