.model tiny .386 .data GroupLogo db 13,10 db ' ß Ü ß',13,10 db ' ß Ü ß²ß Ü Ü Ü ÜÛÜ',13,10 db ' ß ß Üß ßÜ ß ß ß',13,10 db ' Ü Û ÜÛÜ Û Ü ßÛÜ Üß ÛÜ ß ß',13,10 db ' Üß ÜÜÛÛßß ßÛÜÜ ÜÜÛß ßÜ ßÜÜ ÜÜßß ßÜ ÜÜß ÜÜßß ß Ü',13,10 db ' ßÜ ßÛÛßß ÜÜÛÜ ßÛÛÜÛßß ÜÜÛÛÜ ßÛÜÜÛÛßß ÜÜÛÜ ßßÛÜÜÜßß ÜÜÛÛÜ ßÜ',13,10 db ' ° ßß ÜÜÛÛÝÞÛÛÛÜ ß ÜÜÛÛÛßÛÛÛÛÜ ßß ÜÜÛÛÛ ßÛÛÜ ß ÜÜÛÛÛßßÛÛÛÜ °',13,10 db ' °°°° °° ÜÜÛÛÛÛÛÛ Û²ÛÛÛßÞÛÛÛÛÛ ÞÛ²ÛÛÛßÜÛÛÛ²ÛÛÝ° ÞÛÛÛÜßÛÛÛÛÛ Þ²ÛÛÛß ° ° °',13,10 db ' °°°°°°° ÞÛ²ÛÛÛÛÝÞÛÛÛß ÛÛÛ²ÛÝ ÛÛÛÛÛÝ°Þ²ÛÛÛÛÛ ° ÛÛÛ²ÛßÞÛ²ÛÝ° ÛÛÛß °°°° °°°',13,10 db ' ° °°° °° ÛÛÛÛÛ²Û ßß °°ÞÛÛÛÛÛ ÞÛÛÛ²Û ÛÛÛ²ÛÛÝ ÜÛÛÛÛÛÛÝÞ²ÛÛ ÛÛß °° ° °° ° °°',13,10 db ' °° °°° ÞÛ²ÛÛÛÛÝ° °°° Û²ÛÛÛÝ ÛÛÛÛÛÝ°ÞÛÛÛÛÛÛ ° ßßßßÜÜÛÛÛÝßßß °°°° °°°° °',13,10 db ' ° °° ° ÜÛÛÛ²ÛÛÛ ÜÛÛÜ °ÞÛÛ²ÛÛ ÞÛ²ÛÛÛ ÛÛ²Û²ÛÝ °°° ÜÛÛÛÛ²ÛÛ ÜÛ²ÛÛÜ °°° ° °°',13,10 db ' ° ßßÛÛ²ÛÝ Û²ÛÛß ßÛÛÛÛÝ Û²ÛÛß ÞÛ²²ÛÛÛßß ßßÛÛÛÝ Û²ÛÛß °',13,10 db ' ÜÜ ßßÛÜÛÛß ds ßßÛÜÛÛß Ûßßß ßßÜÜ ßßÛÜÛÛß Ü',13,10 db ' ßßÜÜ ß ß²ÜÜ ß Ü Ü²Üßßß ßßÜÜ ß Ü² ßÜ',13,10 db ' ßßÜ²Ü Ü ² ßß Üß ÜÜßß ² ßß ß ±',13,10 db ' ² Üß ß',13,10,'$' IntroMsgOne db 13,10,' [þ] GlobeTime v1.21 - Key Generator by Vizion [þ]',13,10 db 13,10,' Enter name (2-20 digits) : ','$' Err1buffer db 13,10,' Wrong name input... try again.',13,10,'$' Err2Buffer db 13,10,' Error creating output file...',13,10,'$' Err3Buffer db 13,10,' Error writing the output file...',13,10,'$' DoneBuffer db 13,10,' Key file created (REG.KEY)...' db 13,10,' Move it to directory the program is located in.',13,10,'$' fName db 'REG.KEY' ; file name fHandle dw 0 NameBuffer db 18h, 21 dup(0) ; user name TempBuffer db 40 dup(0) ; extra space XtraBuffer db 0,0,0,0,0,0,0,0,0 .code .startup main proc near mov ah, 09h ; lea dx, GroupLogo ; int 21h ; show logo mov ah, 09h ; lea dx, IntroMsgOne ; int 21h ; show intro and ask for input mov bl, 02h mov bh, 14h lea di, NameBuffer ; call getstr ; read user information jc @err1 call keygen ; create serial number push eax mov esi, 02EF77BEh lea edi, TempBuffer + 1 push edi call num2str mov byte ptr [edi], 13 mov byte ptr [edi+1], 10 add cl, 2 ; add return and update lenght pop edi mov byte ptr [edi - 1], cl lea esi, TempBuffer + 1 lea edi, NameBuffer + 2 movsx ecx, byte ptr [esi - 1] movsx edx, byte ptr [edi - 1] call cncstr ; concatenate 2 strings mov byte ptr [esi + ecx], 13 mov byte ptr [esi + ecx + 1], 10 add cl, 2 mov byte ptr [esi - 1], cl ; add return and update length pop eax mov esi, eax lea edi, XtraBuffer + 1 push edi call num2str pop edi mov byte ptr [edi - 1], cl lea esi, TempBuffer + 1 lea edi, XtraBuffer + 1 movsx ecx, byte ptr [esi - 1] movsx edx, byte ptr [edi - 1] call cncstr ; concatenate 2 strings push cx xor cx, cx lea dx, fName ; load file name mov ah, 3Ch int 21h ; create new file jc @err2 ; get out if error mov [fHandle], ax ; store file handle ; int 3 ; debug purpose lea edx, TempBuffer + 1 ; stuff to write mov cl, byte ptr [edx - 1] ; number of bytes mov bx, [fHandle] ; mov ah, 40h int 21h ; write to file jc @err3 jmp @done @err1: lea dx, Err1Buffer ; mov ah, 09h ; int 21h ; wrong user input jmp @exit @err2: lea dx, Err2Buffer ; mov ah, 09h ; int 21h ; error : create file jmp @exit @err3: lea dx, Err3Buffer ; mov ah, 09h ; int 21h ; error : create file jmp @exit @done: lea dx, DoneBuffer ; mov ah, 09h ; int 21h ; error : create file @exit: mov al, 00h ; mov ah, 4Ch ; int 21h ; terminate program main endp keygen proc near ; int 3 ; debug purpose mov ebx, 0000001h lea eax, NameBuffer + 2 movsx edx, byte ptr [eax - 1] @kyg: xor ecx, ecx mov cl, byte ptr [eax] xor ebx, ecx inc eax dec edx jnz @kyg mov eax, 02EF77BEh cdq idiv ebx ret keygen endp ; get string from user ; input : ; edi = pointer to buffer ; bl = min length ; bh = max length ; output : ; CF error, cx number of bytes read getstr proc near push dx ; save dx mov dx, di ; mov ah, 0Ah ; int 021h ; get user input mov cl, [di + 1] ; get number of digits cmp cl, bh ; check maximum jg @@0 cmp cl, bl ; check minimum jle @@0 xor ch, ch add di, 2 clc ; clear CF jmp @@1 @@0: stc ; set CF (carry flag) @@1: pop dx ; restore dx ret getstr endp ; convert dword to string ; input : ; esi = dword ; edi = pointer to buffer ; output : ; edi = buffer filled ; ecx = length of string num2str proc near push bp push dx push bx push esi pop ax pop dx xor bp, bp or dx,dx jns @l0 not ax not dx add ax, 0001 adc dx,+00 @l0: mov si, 10 mov cx, ax mov ax, dx xor dx, dx div si mov bx, ax mov ax, cx div si xchg dx, bx add bl, 30h push bx inc bp mov bx, ax or bx, dx jnz @l0 mov cx, bp cld @l1: pop ax stosb loop @l1 or cx, bp pop bx pop dx pop bp ret num2str endp ; concatenate 2 strings ; input : ; esi = string one, ecx = length string one ; edi = string two, edx = length string two ; output : ; esi = string one + string two, edx = new length cncstr proc near xor eax, eax ; xor ebp, ebp ; clear register push esi ; save esi add esi, ecx ; set esi at end of string one add ecx, edx ; adjust new length @cnc: mov al, byte ptr [edi + ebp] ; get digit of string two mov byte ptr [esi + ebp], al ; place digit after string one inc ebp ; dec edx ; jnz @cnc ; loop for length of string two pop esi ; restore esi mov byte ptr [esi - 1], cl ; update new length ret cncstr endp end main