home *** CD-ROM | disk | FTP | other *** search
- ; Author can be email at: stone@one.se ;>
- ; Btw - this was formated by DarkStalker's ASMFMT - thanks DS :)
- .model SMALL
- .stack 100h
- .386
-
- .DATA
- input DB 39,0
- uname DB 39 dup (20h)
- valid DB 10,13,'A valid key is: '
- realkey DB 8 dup (30h)
- strend DB '$'
- introtxt DB ' WinDates 3.0 *Keymaker* ',10,13
- DB '──────────────| STONE |──────────────',10,13
- DB ' ▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ',10,13
- DB ' ███ ███ ███ ███▄▄▄ ',10,13
- DB ' ███▄ ███ ███▄ ███ ',10,13
- DB ' ▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀ ▀▀▀ ',10,13
- DB '─────────────────────────────────────────',10,13
- DB 'u N I T E D c R Æ C K I N G f O R C E ',10,13
- DB '[wIN95/NT]─────────────────────[oCT 1997]',10,13
- DB 'Enter your username: ','$'
-
- DB '2nd&mi' ; Personal tag - not used
-
- .CODE
- MOV AX, @DATA ; Make DS&ES point to the DATA
- MOV DS, AX
- MOV ES, AX
-
- LEA EDX, [introtxt] ; Write intro text
- MOV AH, 9h
- INT 21h
-
- MOV AX, 0A00h
- LEA EDX, [input]
- INT 21h ; Get buffered input
-
- MOVZX EBX, BYTE PTR [input+1] ; Get length
- CMP EBX, 0 ; Did he type anything?
- JZ EXIT
- MOV BYTE PTR [EBX+input+2],20h ; If he did erradicate 0dh termination
-
- CALL genkey ; Generate the key
-
-
- LEA EDX, [valid] ; write the key
- MOV AH, 09h
- INT 21h
-
- EXIT:
- MOV AX,4C00h ; Exit, error code = 0
- INT 21h
-
-
- genkey PROC
- XOR ESI, ESI ; Reset ESI (A counter)
- nextbyte:
- MOV EAX, ESI
- AND EAX, 01h
- NEG EAX
- SBB EAX, EAX
- AND EAX, 02
- DEC EAX
- MOVSX EDX, BYTE PTR [ESI+uname]
- MOV ECX, 0Ah
- IMUL EAX, ESI ; EAX=EAX*ESI
- LEA EAX, [EAX*2+EDX] ; EAX=2*EAX+"Username byte"
- CDQ
- IDIV ECX ; Div 10
- ADD BYTE PTR [ESI+realkey],DL ; division leftover= key
- INC ESI
- CMP ESI,08 ; only 8 bytes matters
- JL nextbyte
- RET
- genkey ENDP
-
- END