.model tiny .386 org 100h .data GroupLogo db 13,10 db ' . a . n . e . w . b . r . e . e . d .',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 ' ± Û Û±Û ÛÛß SÛ²Û ÛÛÜÜÛß ÜÛÛÛÛÛ ÛÛÜÜÛß ÛÛÛ Ü ÛÛÛ ÛÛÛÛ ÛÛÜÜÛß ÞÝ ±',13,10 db ' ² ßÜ ß ß aÛ±Û ßÛÛ²²±° ßÛß ßÛÛ ßÛÛÛ²²±° þßÛÛß ÛßRVßÛÛßß ßÛÛÛ²²± Û ²',13,10 db ' ßþ--ÄÄÄÄÄCßÛÛ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ---þß',13,10 db ' ',13,10,'$' IntroMsgOne db 13,10,' [þ] Tray Icon v3.0c - Key Generator by Quantico [þ]',13,10 db '',13,10 db 13,10,' Enter a name : ','$' ErrorMsg db 13,10,' Need 5-20 digits, try again...',13,10,'$' ShowCodeMsg db 13,10,' Registration number : ' CodeBuffer db 10 dup(0),13,10,'$' NameBuffer db 18h, 19h dup(0) Convert_Digs db '0123456789ABCDEF' namelength db 0 .code .startup main proc near mov ah, 09h ; lea edx, GroupLogo ; int 21h ; show group logo mov ah, 09h ; lea edx, IntroMsgOne ; int 21h ; show intro and ask for input mov bx, 1405h ; limits for string input lea edi, NameBuffer ; call getstr ; read user input jc @error ; xor eax, eax ; clear eax call keygen ; create serial number mov ah, 09h ; lea dx, ShowCodeMsg ; int 21h ; print serial number jmp @exit ; finished, quit @error: mov ah, 09h lea dx, ErrorMsg int 21h @exit: mov al, 00h ; mov ah, 4Ch ; int 21h ; terminate program main endp keygen proc near mov esi, offset NameBuffer+2 movzx ecx, byte ptr [esi-1] call upcase xor eax, eax xor ebx, ebx xor edx, edx xor ecx, ecx mov al, byte ptr [esi-1] backformore: mov dl, byte ptr [esi+ecx] add ebx, edx inc ecx cmp ecx, eax jnz backformore xor edx, edx mov eax, ebx mov esi, eax xor ebx, ebx resultnotalladded: xor edx, edx mov ecx, 0Ah idiv ecx add ebx, edx cmp eax, 00000000 jnz resultnotalladded mov eax, ebx mov ecx, 0Ah xor edx, edx idiv ecx cmp eax, 00000000 jnz oncemore jmp onward oncemore: mov eax, ebx xor ebx, ebx jmp resultnotalladded onward: mov eax, esi imul eax, ebx inc eax imul eax, ebx add eax, esi xor edx, edx mov ecx, 0000000Ah lea edi, CodeBuffer call convert_num 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 movsx ecx, byte ptr [edi + 1] ; get number of digits mov byte ptr [edi + ecx + 2], 00h cmp cl, bh ; check maximum jg @@0 cmp cl, bl ; check minimum jl @@0 mov [namelength], cl ; store length xor ch, ch clc ; clear CF jmp @@1 @@0: stc ; set CF (carry flag) @@1: pop dx ; restore dx ret getstr endp upcase PROC pushf pushad nextletter: ; EBX = No. of letters MOV AL,[ESI] ; EDX = INTEXT CMP AL,61h JB notlowcase CMP AL,7Ah JA notlowcase SUB AL,20h ; Lowcase - make it upcase MOV [ESI],AL notlowcase: INC ESI DEC ECX TEST ECX,ECX JNZ nextletter popad popf Ret Upcase endp Convert_Num proc near pushf pushAD sub esp, 4 mov ebp,esp cld mov esi, edi push esi ;--- loop for each digit sub bh, bh mov dword ptr [ebp], eax ;save low word mov dword ptr [ebp+4], edx ;save high word sub esi, esi ;count digits Connum1: inc esi mov eax, dword ptr [ebp+4] ;high word of value sub edx, edx ;clear for divide sub ebx, ebx div ecx ;divide, DX gets remainder mov dword ptr [ebp+4],eax ;save quotient (new high word) mov eax, dword ptr [ebp] ;low word of value div ecx ;divide, DX gets remainder ; (the digit) mov dword ptr [ebp], eax ;save quotient (new low word) mov bl, dl mov al, byte ptr [Convert_Digs+ebx] ;get the digit stosb ;store cmp dword ptr [ebp], 0 ;check if low word zero jne Connum1 ;jump if not cmp dword ptr [ebp+4], 0 ;check if high word zero jne Connum1 ;jump if not sub al, al stosb ;store the terminator ;--- reverse digits pop ecx ;restore start of string xchg ecx, esi shr ecx, 1 ;number of reverses jz Connum3 ;jump if none xchg edi, esi sub esi, 2 ;point to last digit Connum2 : mov al, byte ptr [edi] ;load front character xchg al, byte ptr [esi] ;swap with end character stosb ;store new front character dec esi ;back up loopd Connum2 ;loop back for each digit ;--- finished Connum3 : add esp, 4 popad popf ret endp ;Convert_Num end main