home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Quantico / km / ucfkey02.pas.txt < prev    next >
Encoding:
Text File  |  2000-05-25  |  4.3 KB  |  155 lines

  1. {$M $4000,0,65536}       {* Set heap size to zero !!! *}
  2.  
  3. Program UniversialKeymaker;
  4.  
  5. uses palette,dos,crt,keyinput;
  6.  
  7. {$L ULONGS.OBJ}                         { link in the assembly code }
  8.  
  9. FUNCTION LongADD (Addend1,Addend2:LONGINT):LONGINT;   EXTERNAL;
  10.  
  11. FUNCTION LongSUB (LongWord,Subtrahend:LONGINT):LONGINT;  EXTERNAL;
  12.  
  13. FUNCTION LongMUL (Multiplicand,Multiplier:LONGINT):LONGINT; EXTERNAL;
  14.  
  15. FUNCTION LongDIV (Dividend,Divisor:LONGINT):LONGINT;  EXTERNAL;
  16.  
  17. FUNCTION LongMOD (Dividend,Divisor:LONGINT):LONGINT;  EXTERNAL;
  18.  
  19. PROCEDURE WriteULong (LongWord:LONGINT;     { the longword          }
  20.  
  21.                       Width:BYTE;           { _minimum_ field width }
  22.  
  23.                       FillChar:CHAR;        { leading space char    }
  24.  
  25.                       Base:BYTE); EXTERNAL; { number base 2..26     }
  26.  
  27.  
  28.  
  29. Var
  30.  
  31.   sk                         : array[1..8000] of byte absolute $b800:0000;
  32.  
  33.   i,numwritten:integer;
  34.  
  35.   ToF:File;
  36.  
  37.   Output : String;
  38.  
  39.   f:text;
  40.  
  41.   x,y,Name,Company:String;
  42.  
  43. Type
  44.  
  45.   String8 = String[8];
  46.  
  47.  
  48.  
  49.  
  50.  
  51. Const
  52.  
  53.   AskName=1;
  54.  
  55.   AskCompany=0;
  56.  
  57.  
  58.  
  59.  
  60.  
  61. Procedure LongToHex(AnyLong : LongInt; Var HexString : String8);
  62.  
  63.  
  64.  
  65. Var
  66.  
  67.   ALong : LongInt;
  68.  
  69.   ch    : Char;
  70.  
  71.   Index : Byte;
  72.  
  73. begin
  74.  
  75.   HexString := '00000000';                  { default to zero   }
  76.  
  77.   Index := Length(HexString);               { String length     }
  78.  
  79.   While AnyLong <> 0 do
  80.  
  81.   begin                                     { loop 'til done    }
  82.  
  83.     ch := Chr(48 + Byte(AnyLong) and $0F);  { 0..9 -> '0'..'9'  }
  84.  
  85.     if ch > '9' then
  86.  
  87.       Inc(ch, 39);                           { 10..15 -> 'A'..'F'}
  88.  
  89.     HexString[Index] := ch;                 { insert Char       }
  90.  
  91.     Dec(Index);                             { adjust chr Index  }
  92.  
  93.     AnyLong := AnyLong SHR 4;               { For next nibble   }
  94.  
  95.   end;
  96.  
  97. end;
  98.  
  99.  
  100.  
  101. Procedure Curs(n:integer);
  102.  
  103.  
  104.  
  105. Var regs : registers;
  106.  
  107.  
  108.  
  109. Begin
  110.  
  111.   regs.ah:=1;
  112.  
  113.   case n of
  114.  
  115.   0 : begin
  116.  
  117.         regs.cl:=32;
  118.  
  119.         regs.ch:=32;
  120.  
  121.       end;
  122.  
  123.   1 : begin
  124.  
  125.         regs.cl:=8;
  126.  
  127.         regs.ch:=7;
  128.  
  129.       end;
  130.  
  131.   end;
  132.  
  133.   intr($10,regs);
  134.  
  135. End;
  136.  
  137. PROCEDURE SwitchTo25; ASSEMBLER;
  138.  
  139. ASM
  140.  
  141.    MOV AX,$1114
  142.  
  143.    INT $10
  144.  
  145. END;
  146.  
  147.  
  148.  
  149. Function GenerateReg:String;
  150.  
  151.  
  152.  
  153. Var
  154.  
  155.   lic,eax,ebx,ecx,edx,edi,esi,ebp:Longint;
  156.  
  157.   ax,bx,cx,dx,si,bp : word;
  158.  
  159.   i:integer;
  160.  
  161.   dummy,MyStr : String8;
  162.  
  163.  
  164.  
  165. Begin
  166.  
  167.   Curs(1);
  168.  
  169.   ax:=wherex;
  170.  
  171.   bx:=wherey;
  172.  
  173.   write('  Enter your name           : ');
  174.  
  175.   Repeat
  176.  
  177.     {readln(name);}
  178.  
  179.     GetInput(Name,'',20,31,bx,0,7,' ',false);
  180.  
  181.   until Name<>'';
  182.  
  183.   y:=name;
  184.  
  185.   Write(#10,#13,'  # of licenses (max 65298) : ');
  186.  
  187.   ax:=wherex;
  188.  
  189.   bx:=wherey;
  190.  
  191.   Repeat
  192.  
  193.     GetInput(company,'',20,31,bx,0,7,' ',false);
  194.  
  195.     val(company,lic,bp);
  196.  
  197.   until (lic>0)and(lic<65299);
  198.  
  199.   lic:=lic+$237;
  200.  
  201.   writeln;
  202.  
  203.   longtohex(lic,mystr);
  204.  
  205.   for i:=1 to length(mystr) do mystr[i]:=upcase(mystr[i]);
  206.  
  207.   x:=copy(mystr,5,4);
  208.  
  209.   write('  Registration code         : ');
  210.  
  211.   name:=x+name;
  212.  
  213.   write;
  214.  
  215.   ebx:=longadd($7eca,0);
  216.  
  217.   for i:=1 to length(name) do begin
  218.  
  219.     eax:=longadd($7eca,(longmul(ord(name[i]),ebx)));
  220.  
  221.     ebx:=longadd(eax,0);
  222.  
  223. {   write('eax=');
  224.  
  225.     writeulong(eax,10,' ',16);
  226.  
  227.     write('ebx=');
  228.  
  229.     writeulong(ebx,10,' ',16);
  230.  
  231.     readln;
  232.  
  233. } end;
  234.  
  235. {  writeulong(ebx,10,' ',16);}
  236.  
  237.   longtohex(ebx,mystr);
  238.  
  239.   for i:=1 to length(mystr) do mystr[i]:=upcase(mystr[i]);
  240.  
  241.   GenerateReg:=x+'-'+copy(mystr,1,4)+'-'+copy(mystr,5,4)
  242.  
  243.  
  244.  
  245.  
  246.  
  247. end;
  248.  
  249.  
  250.  
  251.  
  252.  
  253. {  end;}
  254.  
  255.                       
  256.  
  257.  
  258.  
  259. Begin
  260.  
  261.   writeln('       Second Copy v5.21 build 66        ');
  262.  
  263.   writeln('──────────────|  MiRaMaX  |──────────────');
  264.  
  265.   writeln('   ▄▄▄   ▄▄▄    ▄▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄▄   ');
  266.  
  267.   writeln('   ███   ███    ███          ███▄▄▄      ');
  268.  
  269.   writeln('   ███▄  ███    ███▄         ███         ');
  270.  
  271.   writeln('   ▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀▀    ▀▀▀         ');
  272.  
  273.   writeln('─────────────────────────────────────────');
  274.  
  275.   writeln(' u N I T E D  c R A C K I N G  f O R C E ');
  276.  
  277.   writeln('[kEYMAKER]─────────────────────[dEC 1997]');
  278.  
  279.   Output:=GenerateReg;
  280.  
  281.   Writeln(Output);
  282.  
  283.   writeln;
  284.  
  285.   writeln('Enter this code or copy the generated keyfile');
  286.  
  287.   writeln('"sc97.cfg" to your installed directory.');
  288.  
  289.   assign(f,'sc97.cfg');
  290.  
  291.   rewrite(f);
  292.  
  293.   writeln(f,'[General]');
  294.  
  295.   writeln(f,'Settings=8BCD');
  296.  
  297.   writeln(f,'RegName='+y);
  298.  
  299.   writeln(f,'RegKey='+output);
  300.  
  301.   writeln(f,'Version=5.21');
  302.  
  303.   close(f);
  304.  
  305.  
  306.  
  307. end.
  308.  
  309.