; Author can be email at: stone@one.se ;> ; Formatted with Darkstalkers ASMFMT ;).. thnx ds :) .model SMALL .stack 100h .386 .DATA input DB 39,0 uname DB 39 dup (0h) d47503c DD 0123e1h ; This is used as initial value for IMUL valid DB 10,13,'A valid key is: ' realkey DB 12 dup (30h) ; Serial number is 12 digits long enstr DB 10,13,'$' ; Write termination flaffer DB 39 dup (0) ; Used for the high/low bit cleaned string introtxt DB ' What Is This? 1.6 *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, [input+1] ; Fetch length CMP EBX,0 ; if zero - exit JZ EXIT CALL upcase ; Uppercase input string CALL cleanit ; Clean it for high/lowbit chars XOR ESI,ESI ; Zero Counter NextByte: MOVZX EAX, BYTE PTR [input+1] ; Get length CALL genkey ; Deciede on a letter to use for num-gen MOVZX EBX,[flaffer+EDX] nextitera: ; Generate a digit of the serial MOV EAX,0Ah CALL GENKEY DEC BL JNZ nextitera ADD BYTE PTR [realkey+ESI],DL ; Make it a digit INC ESI ; next byte CMP ESI,12d JNZ nextbyte MOV AH,09h ; Write the key LEA EDX,[valid] INT 21h EXIT: MOV AX,4C00h ; Exit, error code = 0 INT 21h genkey PROC ; Work horse of the keymaker IMUL EDX,[d47503C],08088405h INC EDX MOV [d47503C],EDX MUL EDX MOV EAX,EDX RET genkey ENDP upcase PROC LEA EDX, [uname] MOV ESI,EDX nextletter: ; EBX = No. of letters MOV AL,[EDX] ; EDX = INTEXT CMP AL,61h JB notlowcase CMP AL,7Ah JA notlowcase SUB AL,20h ; Lowcase - make it upcase MOV [ESI],AL notlowcase: INC EDX INC ESI DEC EBX TEST EBX,EBX JNZ nextletter RET Upcase ENDP cleanit PROC LEA EDI, [flaffer] ; Store output here LEA ESI, [uname] ; Get input from here MOVZX ECX,[input+1] ; Fetch the length nextb: MOVZX EAX,BYTE PTR [ESI] ; Fetch a letter CMP EAX,48 ; Is it low bit? JB skip CMP EAX,91 ; is it high bit? JG skip MOVSB ; no - copy it as it is DEC ECX ; move on to next letter JNZ nextb RET skip: INC ESI ; skip it DEC BYTE PTR [input+1] ; decrease length of string DEC ECX ; next letter JNZ nextb RET cleanit ENDP END