.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,' [þ] HexDecChar Editor - Key Generator by Quantico [þ]',13,10 db '',13,10 db 13,10,' Enter a name : ','$' ErrorMsg db 13,10,' Need 10-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) DataTableOne db 34h,0A0h,0D5h,00h,0F7h,24h,5Dh,5Ch,0Ah,8Ch,10h,0D6h,9Eh,0B5h,9Ch,66h,00h,24h,6Fh,20h,44h,4Dh,0D4h,63h,4Dh,0A2h,0F0h,10h,27h 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, 140Ah 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 xor esi, esi mov ebx, 00000001h mov edx, ebx mov edi, ebx @more: mov ecx, ebx dec ecx and ecx, 8000000Fh jns @GO dec ecx or ecx, 0FFFFFFF0h inc ecx @GO: lea eax, dword ptr [ebx+edi] push ecx mov ecx, 00000112h cdq idiv ecx pop ecx mov al, byte ptr [edx+DataTableOne] lea edx, namebuffer+2 mov dl, byte ptr [edx+ebx-01] xor al, dl and eax, 000000FFh shl eax, cl add esi, eax inc ebx dec [namelength] jne @more mov 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 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