注册机的DELPHI源码。 (2千字)
unit Unit1;interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls;
type
TForm1 = class(TForm)
Edit1: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
procedure Button3Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
//这里是第二个表的内容。第一个表用条件判断省略了。
const table: array[1..8,0..15] of byte =(
(15,1,11,3,8,4,14,7,13,0,0,0,0,0,0,0),
(10,12,1,8,2,0,9,15,5,11,0,0,0,0,0,0),
(9,5,12,2,7,6,15,4,14,10,0,0,0,0,0,0),
(3,4,12,11,1,10,13,8,0,14,0,0,0,0,0,0),
(13,1,6,11,8,10,14,4,3,12,0,0,0,0,0,0),
(7,11,6,10,5,9,4,8,0,3,0,0,0,0,0,0),
(0,13,3,15,10,8,2,12,4,6,0,0,0,0,0,0),
(9,5,13,1,3,11,12,4,2,8,0,0,0,0,0,0)
);
implementation
{$R *.DFM}
//FORM内一个EDIT框,三个BUTTON
procedure TForm1.Button3Click(Sender: TObject);
begin
self.Close;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
strlst:TStringList;
i,j:integer;
s:string;
t:array[1..8] of integer;
ts:array[1..4] of byte;
tc:array[1..4] of char;
begin
strlst:=TStringList.Create;
strlst.Add('640');
strlst.Add('641');
strlst.Add('480');
strlst.Add('481');
strlst.Add('490');
strlst.Add('491');
strlst.Add('510');
strlst.Add('511');
strlst.Add('520');
strlst.Add('521');
i:= (Gettickcount mod 10)+1;
randomize;
j:=random(100000);
s:=inttostr(strtoint(strlst.strings[i])*100000+j);
for i:=1 to 8 do
begin
t[i]:=table[i,strtoint(s[i])];
end;
for i:=1 to 4 do
begin
ts[i]:=((t[i] xor t[i+4]) or t[8]) or $30;
if (ts[i]>$39) then ts[i]:=ts[i]+7;
tc[i]:=chr(ts[i]);
end;
self.Edit1.Text:=copy(s,1,4)+'-'+copy(s,5,4)+copy(tc,1,2)+'-'+copy(tc,3,2);
strlst.Free;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
messagebox(self.handle,'SmartCheck 6.03 注册机'+#13#10+'编写:Passion'+#13#10+'2001年8月22日','关于',MB_OK);
end;
end.
