unit Unit1;
interface
uses
sysutils,forms,Dialogs, StdCtrls, Controls, Buttons, Classes;
type
TForm1 = class(TForm)
FileNameEdit: TEdit;
Label1: TLabel;
Button1: TBitBtn;
passEdit: TEdit;
chk2000: TCheckBox;
SpeedButton1: TSpeedButton;
dlgOF: TOpenDialog;
procedure Button1Click(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
const
xorString:array[0..12]of byte=
( $86, $FB, $EC, $37,
$5D, $44, $9C, $FA,
$C6, $5E, $28, $E6,$13 );
xorString2:array[0..20]of byte=
( $D3, $EC, $08, $9C,
$93, $28, $46, $8A,
$01, $7B, $A0, $DF,
$22, $13, $9A, $B1,
$61, $79, $C7, $7C,$5B);
var
passBuf:array[0..14]of byte;
pass:array[0..14]of char;
passBuf2:array[0..40]of byte;
pass2:array[0..20]of char;
B:Byte;
F:TFileStream;
I,j:integer;
begin
if not FileExists(FileNameEdit.Text) then
begin
if self.tag = 0 then
Showmessage(' 唉哟,文件不存在!看清楚了吗?打正确了吗? ') else
if self.tag = 1 then
Showmessage(' 兄弟,你真的找到了这个文件吗? ') else
if self.tag = 2 then
Showmessage(' 你是不是MM?怎么我说的你都搞不懂? ') else
if self.tag = 3 then
Showmessage(' 估计是JJ,又玩我一次! ^o^ ') else
if self.tag = 4 then
Showmessage(' 呵呵,不会是DD吧?!你真幽默! ') else
if self.tag = 5 then
Showmessage(' ⊙⊙'#13' 々'#13' ⌒') else
if self.tag = 6 then
Showmessage(' (.) (.)'#13' §'#13' ~') else
if self.tag = 7 then
Showmessage(' 你在搞什么飞机? ') else
if self.tag = 8 then
Showmessage(' 咣当,倒也……………… ') else
if self.tag = 9 then
Showmessage(' 哥们,再这样我可生气了。 ') else
begin
Showmessage('唉,快被老兄你玩死了,OK,我不玩了!古得掰。');
Application.Terminate;
exit;
end;
Self.tag:=self.tag+1;
exit;
end;
self.tag := 0;
F:=TFileStream.Create(FileNameEdit.Text,fmOpenRead);
if NOT chk2000.Checked then
try
F.Seek($42,soFromBeginning);
F.Read(passBuf,14);
for I:=0 to 13 do
begin
B := passBuf xor xorString;
pass:=char(B);
end;
pass[sizeof(pass) - 1] := #0;
passEdit.Text:=StrPas(Pass);
finally
F.Free;
end else
try
F.Seek($42,soFromBeginning);
F.Read(passBuf2,40);
I:=0;j:=0;
while I<40 do
begin
B := passBuf2 xor xorString2[j];
pass2[j]:=char(B);
inc(i,2);inc(j);
end;
pass2[sizeof(pass2) - 1] := #0;
passEdit.Text:=StrPas(Pass2);
finally
f.Free;
end;
end;
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
if dlgOF.Execute then FileNameEdit.Text:=dlgOF.FileName;
end;
end.