home *** CD-ROM | disk | FTP | other *** search
- {$M $4000,0,65536} {* Set heap size to zero !!! *}
- Program UniversialKeymaker;
- uses palette,dos,crt,keyinput;
- {$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 }
-
- Var
- sk : array[1..8000] of byte absolute $b800:0000;
- i,numwritten:integer;
- ToF:File;
- Output : String;
- f:text;
- x,y,Name,Company:String;
- Type
- String8 = String[8];
-
-
- Const
- AskName=1;
- AskCompany=0;
-
-
- Procedure LongToHex(AnyLong : LongInt; Var HexString : String8);
-
- Var
- ALong : LongInt;
- ch : Char;
- Index : Byte;
- begin
- HexString := '00000000'; { default to zero }
- Index := Length(HexString); { String length }
- While AnyLong <> 0 do
- begin { loop 'til done }
- ch := Chr(48 + Byte(AnyLong) and $0F); { 0..9 -> '0'..'9' }
- if ch > '9' then
- Inc(ch, 39); { 10..15 -> 'A'..'F'}
- HexString[Index] := ch; { insert Char }
- Dec(Index); { adjust chr Index }
- AnyLong := AnyLong SHR 4; { For next nibble }
- end;
- 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;
- PROCEDURE SwitchTo25; ASSEMBLER;
- ASM
- MOV AX,$1114
- INT $10
- END;
-
- Function GenerateReg:String;
-
- Var
- lic,eax,ebx,ecx,edx,edi,esi,ebp:Longint;
- ax,bx,cx,dx,si,bp : word;
- i:integer;
- dummy,MyStr : String8;
-
- Begin
- Curs(1);
- ax:=wherex;
- bx:=wherey;
- write(' Enter your name : ');
- Repeat
- {readln(name);}
- GetInput(Name,'',20,31,bx,0,7,' ',false);
- until Name<>'';
- y:=name;
- Write(#10,#13,' # of licenses (max 65298) : ');
- ax:=wherex;
- bx:=wherey;
- Repeat
- GetInput(company,'',20,31,bx,0,7,' ',false);
- val(company,lic,bp);
- until (lic>0)and(lic<65299);
- lic:=lic+$237;
- writeln;
- longtohex(lic,mystr);
- for i:=1 to length(mystr) do mystr[i]:=upcase(mystr[i]);
- x:=copy(mystr,5,4);
- write(' Registration code : ');
- name:=x+name;
- write;
- ebx:=longadd($7eca,0);
- for i:=1 to length(name) do begin
- eax:=longadd($7eca,(longmul(ord(name[i]),ebx)));
- ebx:=longadd(eax,0);
- { write('eax=');
- writeulong(eax,10,' ',16);
- write('ebx=');
- writeulong(ebx,10,' ',16);
- readln;
- } end;
- { writeulong(ebx,10,' ',16);}
- longtohex(ebx,mystr);
- for i:=1 to length(mystr) do mystr[i]:=upcase(mystr[i]);
- GenerateReg:=x+'-'+copy(mystr,1,4)+'-'+copy(mystr,5,4)
-
-
- end;
-
-
- { end;}
-
-
- Begin
- writeln(' Second Copy v5.21 build 66 ');
- writeln('──────────────| MiRaMaX |──────────────');
- writeln(' ▄▄▄ ▄▄▄ ▄▄▄▄▄▄▄▄▄ ▄▄▄▄▄▄▄▄▄ ');
- writeln(' ███ ███ ███ ███▄▄▄ ');
- writeln(' ███▄ ███ ███▄ ███ ');
- writeln(' ▀▀▀▀▀▀▀▀▀ ▀▀▀▀▀▀▀▀▀ ▀▀▀ ');
- writeln('─────────────────────────────────────────');
- writeln(' u N I T E D c R A C K I N G f O R C E ');
- writeln('[kEYMAKER]─────────────────────[dEC 1997]');
- Output:=GenerateReg;
- Writeln(Output);
- writeln;
- writeln('Enter this code or copy the generated keyfile');
- writeln('"sc97.cfg" to your installed directory.');
- assign(f,'sc97.cfg');
- rewrite(f);
- writeln(f,'[General]');
- writeln(f,'Settings=8BCD');
- writeln(f,'RegName='+y);
- writeln(f,'RegKey='+output);
- writeln(f,'Version=5.21');
- close(f);
-
- end.
-