Analyze (TForm) Button1: TButton; Chk2000: TCheckBox; Edit1: TEdit; Button2: TButton; Edit2: TEdit; OpenDialog1: batch; Button3: TButton; Label1: TLabel; notify (Sender: TObject); procedureButton2Click (Send
Type TForm1 = class (TForm) Button1: TButton; Chk2000: TCheckBox; Edit1: TEdit; Button2: TButton; Edit2: TEdit; OpenDialog1: batch; Button3: TButton; Label1: TLabel; PRocedure Button1Click (Sender: TObject); procedure Button2Click (Send
Type
TForm1 = class (TForm)
Button1: TButton;
Chk2000: TCheckBox;
Edit1: TEdit;
Button2: TButton;
Edit2: TEdit;
OpenDialog1: TOpenDialog;
Button3: TButton;
Label1: TLabel;
PRocedure Button1Click (Sender: TObject );
Procedure Button2Click (Sender: TObject );
Procedure Button3Click (Sender: TObject );
Procedure Edit2KeyPress (Sender: TObject; var Key: Char );
Private
Procedure WMDropFiles (var Msssage: TMessage); message WM_DROPFILES;
{Private declarations}
Public
{Public declarations}
End;
Var
Form1: TForm1;
Implementation
{$ R *. DFM}
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 );
Procedure TForm1.WMDropFiles (var Msssage: TMessage );
Begin
ShowMessage ('Hello Boy ');
End;
Procedure TForm1.Button1Click (Sender: TObject );
VAR
PassBuff: array [0 .. 14] of byte;
Pass: array [0 .. 14] of char;
PassBuff2: array [0 .. 40] of byte;
Pass2: array [0 .. 20] of char;
B: Byte;
F: TFileStream;
I, j: integer;
Begin
File: // ShowMessage (Char ($86) + Char ($ F8) + Char ($ EC ))
If not FileExists (Edit1.Text) then
Begin
MessageBox (Handle, 'you are mm', 'I'm so sorry for you', MB_ OK + MB_ICONINFORMATION );
Exit;
END;
F: = TFileStream. Create (Edit1.text, fmOpenRead );
If not Chk2000.Checked then
Begin
Try
F. Seek ($42, soFromBeginning );
F. Read (PassBuff, 14 );
For I: = 0 to 13 do
Begin
B: = PassBuff [I] XOR xorString [I];
Pass [I]: = Char (B );
End;
Pass [Sizeof (Pass)-1]: = #0;
Edit2.Text: = StrPas (Pass );
Finally
F. Free;
End;
End
Else
Begin
Try
F. Seek ($42, soFromBeginning );
F. Read (passBuff2, 40 );
I: = 0; j: = 0;
While I <40 do
Begin
B: = passBuff2 [I] xor xorString2 [j];
Pass2 [j]: = char (B );
Inc (I, 2); inc (j );
End;
Pass2 [sizeof (pass2)-1]: = #0;
Edit2.Text: = StrPas (Pass2 );
Finally
F. Free;
End;
End;
End;
Procedure TForm1.Button2Click (Sender: TObject );
Begin
If OpenDialog1.Execute then
Edit1.text: = OpenDialog1.FileName;
End;
Procedure TForm1.Button3Click (Sender: TObject );
VAR
PassBuff: array [0 .. 14] of byte;
Pass: array [0 .. 14] of char;
PassBuff2: array [0 .. 40] of byte;
Pass2: array [0 .. 20] of char;
B: Byte;
F: TFileStream;
I, j: integer;
S: string;
Begin
File: // ShowMessage (Char ($86) + Char ($ F8) + Char ($ EC ))
If not FileExists (Edit1.Text) then
Begin
MessageBox (Handle, 'you are mm', 'I'm so sorry for you', MB_ OK + MB_ICONINFORMATION );
Exit;
END;
F: = TFileStream. Create (Edit1.text, fmOpenWrite );
If not Chk2000.Checked then
Begin
Try
FillChar (Pass, 14, #0 );
S: = EdIt2.Text;
StrCopy (@ Pass, Pchar (Trim (s )));
For I: = 0 to 13 do
Begin
B: = Byte (Pass [I]);
PassBuff [I]: = xorString [I] xor B;
End;
PassBuff [13]: = $ B6;
F. Seek ($42, soFromBeginning );
F. Write (PassBuff, 14 );
Finally
F. Free;
End;
End
Else
Begin
Try
F. Seek ($42, soFromBeginning );
F. Read (passBuff2, 40 );
I: = 0; j: = 0;
While I <40 do
Begin
B: = passBuff2 [I] xor xorString2 [j];
Pass2 [j]: = char (B );
Inc (I, 2); inc (j );
End;
Pass2 [sizeof (pass2)-1]: = #0;
Edit2.Text: = StrPas (Pass2 );
Finally
F. Free;
End;
End;
End;
Procedure TForm1.Edit2KeyPress (Sender: TObject; var Key: Char );
Begin
File: // if length (Edit1.text)> = 13 then Key: = #0;
End;
End.