Program Keymaker1; uses crt,palette,dos; {$L ULONGS.OBJ} { link in the assembly code } FUNCTION LongADD (Addend1,Addend2:LONGINT):LONGINT; EXTERNAL; FUNCTION LongSUB (LongWord,Subtrahend:LONGINT):LONGINT; EXTERNAL; FUNCTION LongMUL (Multiplicand,Multiplier:LONGINT):LONGINT; EXTERNAL; FUNCTION LongDIV (Dividend,Divisor:LONGINT):LONGINT; EXTERNAL; FUNCTION LongMOD (Dividend,Divisor:LONGINT):LONGINT; EXTERNAL; PROCEDURE WriteULong (LongWord:LONGINT; { the longword } Width:BYTE; { _minimum_ field width } FillChar:CHAR; { leading space char } Base:BYTE); EXTERNAL; { number base 2..26 } const Base: array[0..1023] of byte = ( $00, $00, $00, $00, $96, $30, $07, $77, $2C, $61, $0E, $EE, $BA, $51, $09, $99, $19, $C4, $6D, $07, $8F, $F4, $6A, $70, $35, $A5, $63, $E9, $A3, $95, $64, $9E, $32, $88, $DB, $0E, $A4, $B8, $DC, $79, $1E, $E9, $D5, $E0, $88, $D9, $D2, $97, $2B, $4C, $B6, $09, $BD, $7C, $B1, $7E, $07, $2D, $B8, $E7, $91, $1D, $BF, $90, $64, $10, $B7, $1D, $F2, $20, $B0, $6A, $48, $71, $B9, $F3, $DE, $41, $BE, $84, $7D, $D4, $DA, $1A, $EB, $E4, $DD, $6D, $51, $B5, $D4, $F4, $C7, $85, $D3, $83, $56, $98, $6C, $13, $C0, $A8, $6B, $64, $7A, $F9, $62, $FD, $EC, $C9, $65, $8A, $4F, $5C, $01, $14, $D9, $6C, $06, $63, $63, $3D, $0F, $FA, $F5, $0D, $08, $8D, $C8, $20, $6E, $3B, $5E, $10, $69, $4C, $E4, $41, $60, $D5, $72, $71, $67, $A2, $D1, $E4, $03, $3C, $47, $D4, $04, $4B, $FD, $85, $0D, $D2, $6B, $B5, $0A, $A5, $FA, $A8, $B5, $35, $6C, $98, $B2, $42, $D6, $C9, $BB, $DB, $40, $F9, $BC, $AC, $E3, $6C, $D8, $32, $75, $5C, $DF, $45, $CF, $0D, $D6, $DC, $59, $3D, $D1, $AB, $AC, $30, $D9, $26, $3A, $00, $DE, $51, $80, $51, $D7, $C8, $16, $61, $D0, $BF, $B5, $F4, $B4, $21, $23, $C4, $B3, $56, $99, $95, $BA, $CF, $0F, $A5, $BD, $B8, $9E, $B8, $02, $28, $08, $88, $05, $5F, $B2, $D9, $0C, $C6, $24, $E9, $0B, $B1, $87, $7C, $6F, $2F, $11, $4C, $68, $58, $AB, $1D, $61, $C1, $3D, $2D, $66, $B6, $90, $41, $DC, $76, $06, $71, $DB, $01, $BC, $20, $D2, $98, $2A, $10, $D5, $EF, $89, $85, $B1, $71, $1F, $B5, $B6, $06, $A5, $E4, $BF, $9F, $33, $D4, $B8, $E8, $A2, $C9, $07, $78, $34, $F9, $00, $0F, $8E, $A8, $09, $96, $18, $98, $0E, $E1, $BB, $0D, $6A, $7F, $2D, $3D, $6D, $08, $97, $6C, $64, $91, $01, $5C, $63, $E6, $F4, $51, $6B, $6B, $62, $61, $6C, $1C, $D8, $30, $65, $85, $4E, $00, $62, $F2, $ED, $95, $06, $6C, $7B, $A5, $01, $1B, $C1, $F4, $08, $82, $57, $C4, $0F, $F5, $C6, $D9, $B0, $65, $50, $E9, $B7, $12, $EA, $B8, $BE, $8B, $7C, $88, $B9, $FC, $DF, $1D, $DD, $62, $49, $2D, $DA, $15, $F3, $7C, $D3, $8C, $65, $4C, $D4, $FB, $58, $61, $B2, $4D, $CE, $51, $B5, $3A, $74, $00, $BC, $A3, $E2, $30, $BB, $D4, $41, $A5, $DF, $4A, $D7, $95, $D8, $3D, $6D, $C4, $D1, $A4, $FB, $F4, $D6, $D3, $6A, $E9, $69, $43, $FC, $D9, $6E, $34, $46, $88, $67, $AD, $D0, $B8, $60, $DA, $73, $2D, $04, $44, $E5, $1D, $03, $33, $5F, $4C, $0A, $AA, $C9, $7C, $0D, $DD, $3C, $71, $05, $50, $AA, $41, $02, $27, $10, $10, $0B, $BE, $86, $20, $0C, $C9, $25, $B5, $68, $57, $B3, $85, $6F, $20, $09, $D4, $66, $B9, $9F, $E4, $61, $CE, $0E, $F9, $DE, $5E, $98, $C9, $D9, $29, $22, $98, $D0, $B0, $B4, $A8, $D7, $C7, $17, $3D, $B3, $59, $81, $0D, $B4, $2E, $3B, $5C, $BD, $B7, $AD, $6C, $BA, $C0, $20, $83, $B8, $ED, $B6, $B3, $BF, $9A, $0C, $E2, $B6, $03, $9A, $D2, $B1, $74, $39, $47, $D5, $EA, $AF, $77, $D2, $9D, $15, $26, $DB, $04, $83, $16, $DC, $73, $12, $0B, $63, $E3, $84, $3B, $64, $94, $3E, $6A, $6D, $0D, $A8, $5A, $6A, $7A, $0B, $CF, $0E, $E4, $9D, $FF, $09, $93, $27, $AE, $00, $0A, $B1, $9E, $07, $7D, $44, $93, $0F, $F0, $D2, $A3, $08, $87, $68, $F2, $01, $1E, $FE, $C2, $06, $69, $5D, $57, $62, $F7, $CB, $67, $65, $80, $71, $36, $6C, $19, $E7, $06, $6B, $6E, $76, $1B, $D4, $FE, $E0, $2B, $D3, $89, $5A, $7A, $DA, $10, $CC, $4A, $DD, $67, $6F, $DF, $B9, $F9, $F9, $EF, $BE, $8E, $43, $BE, $B7, $17, $D5, $8E, $B0, $60, $E8, $A3, $D6, $D6, $7E, $93, $D1, $A1, $C4, $C2, $D8, $38, $52, $F2, $DF, $4F, $F1, $67, $BB, $D1, $67, $57, $BC, $A6, $DD, $06, $B5, $3F, $4B, $36, $B2, $48, $DA, $2B, $0D, $D8, $4C, $1B, $0A, $AF, $F6, $4A, $03, $36, $60, $7A, $04, $41, $C3, $EF, $60, $DF, $55, $DF, $67, $A8, $EF, $8E, $6E, $31, $79, $BE, $69, $46, $8C, $B3, $61, $CB, $1A, $83, $66, $BC, $A0, $D2, $6F, $25, $36, $E2, $68, $52, $95, $77, $0C, $CC, $03, $47, $0B, $BB, $B9, $16, $02, $22, $2F, $26, $05, $55, $BE, $3B, $BA, $C5, $28, $0B, $BD, $B2, $92, $5A, $B4, $2B, $04, $6A, $B3, $5C, $A7, $FF, $D7, $C2, $31, $CF, $D0, $B5, $8B, $9E, $D9, $2C, $1D, $AE, $DE, $5B, $B0, $C2, $64, $9B, $26, $F2, $63, $EC, $9C, $A3, $6A, $75, $0A, $93, $6D, $02, $A9, $06, $09, $9C, $3F, $36, $0E, $EB, $85, $67, $07, $72, $13, $57, $00, $05, $82, $4A, $BF, $95, $14, $7A, $B8, $E2, $AE, $2B, $B1, $7B, $38, $1B, $B6, $0C, $9B, $8E, $D2, $92, $0D, $BE, $D5, $E5, $B7, $EF, $DC, $7C, $21, $DF, $DB, $0B, $D4, $D2, $D3, $86, $42, $E2, $D4, $F1, $F8, $B3, $DD, $68, $6E, $83, $DA, $1F, $CD, $16, $BE, $81, $5B, $26, $B9, $F6, $E1, $77, $B0, $6F, $77, $47, $B7, $18, $E6, $5A, $08, $88, $70, $6A, $0F, $FF, $CA, $3B, $06, $66, $5C, $0B, $01, $11, $FF, $9E, $65, $8F, $69, $AE, $62, $F8, $D3, $FF, $6B, $61, $45, $CF, $6C, $16, $78, $E2, $0A, $A0, $EE, $D2, $0D, $D7, $54, $83, $04, $4E, $C2, $B3, $03, $39, $61, $26, $67, $A7, $F7, $16, $60, $D0, $4D, $47, $69, $49, $DB, $77, $6E, $3E, $4A, $6A, $D1, $AE, $DC, $5A, $D6, $D9, $66, $0B, $DF, $40, $F0, $3B, $D8, $37, $53, $AE, $BC, $A9, $C5, $9E, $BB, $DE, $7F, $CF, $B2, $47, $E9, $FF, $B5, $30, $1C, $F2, $BD, $BD, $8A, $C2, $BA, $CA, $30, $93, $B3, $53, $A6, $A3, $B4, $24, $05, $36, $D0, $BA, $93, $06, $D7, $CD, $29, $57, $DE, $54, $BF, $67, $D9, $23, $2E, $7A, $66, $B3, $B8, $4A, $61, $C4, $02, $1B, $68, $5D, $94, $2B, $6F, $2A, $37, $BE, $0B, $B4, $A1, $8E, $0C, $C3, $1B, $DF, $05, $5A, $8D, $EF, $02, $2D); Type u32 = array[1..4] of byte; { no 32-bit unsigned integers in TP7.1 :( } var edx,esi,ebx,eax,ecx : u32; RegName,Licenses,CombinedRegName : String; i,j : word; dummy:byte; eeax,eecx:longint; flag:boolean; const hex : array[0..$F] of Char = '0123456789ABCDEF'; function B( B : Byte) : String; assembler; asm les di,@Result mov al,2 stosb mov bl,B xor bh,bh mov dl,bl shr bl,1 shr bl,1 shr bl,1 shr bl,1 mov al,byte ptr hex[bx] mov bl,dl and bl,$F mov ah,byte ptr hex[bx] stosw end; Procedure Output; Begin writeln('EAX=',B(eax[1]),B(eax[2]),B(eax[3]),B(eax[4]),' ', 'EBX=',B(ebx[1]),B(ebx[2]),B(ebx[3]),B(ebx[4]),' ', 'EdX=',B(edx[1]),B(edx[2]),B(edx[3]),B(edx[4]),' '); end; Procedure Keymaker; begin for i:=1 to 4 do edx[i]:=255; { mov edx,$ffffffff } for i:=1 to 4 do eax[i]:=255; { mov eax,$ffffffff } for i:=1 to 3 do esi[i]:=0; { mov esi,length(Combined..) } esi[4]:=length(CombinedRegName); for i:=1 to esi[4] do begin for j:=1 to 4 do edx[j]:=eax[j]; { mov edx,eax } for j:=1 to 4 do ebx[j]:=0; { xor ebx,ebx } for j:=1 to 3 do ebx[j]:=0; { mov bl,[ecx] } ebx[4]:=ord(CombinedRegName[i]); for j:=1 to 3 do edx[j]:=0; { and edx,$ff } for j:=1 to 4 do edx[j]:=edx[j] xor ebx[j]; for j:=3 downto 1 do eax[j+1]:=eax[j]; { shr eax,8 } eax[1]:=0; dummy:=edx[4]; for j:=1 to 4 do edx[j]:=Base[dummy*4+(4-j)];{ mov edx,[edx*4+c] } for j:=1 to 4 do eax[j]:=eax[j] xor edx[j]; { output;} end; eecx:=LongADD( LongADD( LongMUL(eax[1],$1000000),LongMUL(eax[2],$10000) ), LongADD( LongMUL(eax[3],$100),LongMUL(eax[4],1) ) ); eeax:=$47961B7; eeax:=LongMUL(EEAX,(EECX)); eecx:=$2c041e0; eeax:=LongMUL(eeax,$2c041e0); end; Procedure Curs(n:integer); Var regs : registers; Begin regs.ah:=1; case n of 0 : begin regs.cl:=32; regs.ch:=32; end; 1 : begin regs.cl:=8; regs.ch:=7; end; end; intr($10,regs); End; begin curs(0); FadeDown; Clrscr; textcolor(white); writeln(' T ú H ú E F ú O ú R ú C ú E T ú E ú A ú M'); textcolor(blue); writeln(''); writeln(' SýýýýýýýýýSs. .sS2ýýýýýýýýýýýýý2Ss.sSýýýýýýýýýSs. '); writeln(' $ $$$$$$$! $$ $ý~.sS$$$$$$$$$$$Ss.~ý$$ $$$$$$$! $$'); writeln(' $ I$$$$$$$,ý$ $ I$$$$$$$;^:$$$$$$$$ $$ $$$$$$$$,ý$'); writeln(' .sS$ $$$$$$$$: $Ss. $ $$$$$$$$: l$$$$$$$$ $$ $$$$$$$$: $Ss.'); writeln(' $ sss$$$$$$$$lsss $ .sS$ $$$$$$$$l :$$$$$$$I sss$$$$$$$$lsss $'); writeln(' $sss $$$$$$$$; sss$ $ sss$$$$$$$$;sss ...... ss $$$$$$$$; sss$'); writeln(' $ $$$$$$$$. ýýýýýýýýúús $$$$$$$$, sss$$$$$$$$$ I$$$$$$$. ýýýýýýýýýýS'); writeln(' $ $$$$$$$$: .$$$$$$$! $ $$$$$$$$l $ $ $$$$$$$$: .$$$$$$$! $'); writeln(' $ $$$$$$$$I :$$$$$$$$ $ $$$$$$$$. $ $ $$$$$$$$I :$$$$$$$$ $'); writeln(' $ :$$$$$$$: :$$$$$$$; $ $$$$$$$$; $ $ :$$$$$$$: :$$$$$$$; $'); writeln(' :$.`~ý2$$$$s$$$$$2ý~ï,$ !$$$$$$! $ $$ `~ý2$$$$s$$$$$2ý~ï.;'); writeln(' `~ý2$Ss..........sS2ýï`ýssssssss2ýï `~ý2$Ss..........sS2ý~ï'); writeln; writeln; textcolor(white); writeln(' ú Get Time Server v.2.1, Keymaker by MiRaMaX ú'); textcolor(lightgray); writeln; writeln; gotoxy(1,19); write(' Enter Registration name : '); fadeup; curs(1); readln(RegName); write(' Number of licenses : '); curs(1); readln(Licenses); curs(0); flag:=true; for i:=1 to length(licenses) do if not((licenses[i]>='0')and(licenses[i]<='9')) then flag:=false; if flag then begin for i:=1 to length(RegName) do Regname[i]:=upcase(Regname[i]); CombinedRegName:=RegName+Licenses; keymaker; gotoxy(1,19); Writeln(' Registration name : ',regname); Writeln(' Number of licenses : ',licenses); Write(' Your registration code is : '); WriteULong ( eeax,10,' ',10); end else begin writeln; writeln(' You may only enter numbers... try again...'); end; readkey; fadedown; clrscr; fadeup; end.