unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Grids, Buttons;
type
TForm1 = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
BitBtn1: TBitBtn;
OpenDialog1: TOpenDialog;
BitBtn2: TBitBtn;
GroupBox2: TGroupBox;
Label3: TLabel;
Label4: TLabel;
OpenDialog2: TOpenDialog;
BitBtn4: TBitBtn;
RadioButton1: TRadioButton;
procedure BitBtn1Click(Sender: TObject);
procedure BitBtn4Click(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
file1: file of byte;
file2: file of byte;
fil1: string;
fil2: string;
sign1: array[0..128] of byte;
sign2: array[0..128] of byte;
sign3: array[0..128] of string;
exstring: integer;
HexString,HexString2, lab1, lab2, lab3, lab4: string;
a, c, d: integer;
b, e, f: byte;
implementation
{$R *.dfm}
procedure TForm1.BitBtn1Click(Sender: TObject);
begin
opendialog1.Execute;
fil1:=opendialog1.FileName;
groupbox1.Caption:=opendialog1.FileName;
lab1:='';
lab2:='';
a:=0;
AssignFile(file1, fil1);
reset (file1);
for a:=0 to 128 do
begin;
seek(file1,a);
read (file1 ,b);
sign1[a]:=b;
//c:= sign1[a];
//e:= sign2[a];
//HexString := Format('%8x',[b])+'\';
HexString := IntToHex( b,2 )+' ';
lab1:=lab1+HexString;
if b<32 then b:=42 ;
lab2:=lab2+chr(b)+' ';
case a of
7,15,23,31,39,47,55,63,71,79,87,95,103,111,119,127:
begin
lab1:=lab1+chr(13);
lab2:=lab2+chr(13);
end;
end;
end;
next;
Closefile(file1);
label1.caption:= lab1;
label2.caption:= lab2;
end;
procedure TForm1.BitBtn4Click(Sender: TObject);
begin
opendialog2.Execute;
fil2:=opendialog2.FileName;
groupbox2.Caption:=opendialog2.FileName;
lab3:='';
lab4:='';
a:=0;
AssignFile(file2, fil2);
reset (file2);
for a:=0 to 128 do
begin;
seek(file2,a);
read (file2 ,e);
sign2[a]:=e;
//c:= sign1[a];
//e:= sign2[a];
//HexString := Format('%8x',[b])+'\';
HexString2 := IntToHex( e,2 )+' ';
lab3:=lab3+HexString2;
if e<32 then e:=42 ;
lab4:=lab4+chr(e)+' ';
case a of
7,15,23,31,39,47,55,63,71,79,87,95,103,111,119,127:
begin
lab3:=lab3+chr(13);
lab4:=lab4+chr(13);
end;
end;
end;
next;
Closefile(file2);
label3.caption:= lab3;
label4.caption:= lab4;
end;
procedure TForm1.BitBtn2Click(Sender: TObject);
end;
end.