Registriert seit: 23. Jul 2004
23 Beiträge
|
Re: find hex codes in files
24. Jul 2004, 15:19
ok i have found it.
it this okay or have it errors btw can it reads other files not correct ?
Delphi-Quellcode:
procedure TForm1.Button3Click(Sender: TObject);
var
thepos: integer;
fs: TFileStream;
Buffer: array[0..6] of char;
buffer2: array[0..3] of char;
i : integer;
version: string;
begin
version := '';
thepos := ScanFile('testfile.dat','AddD',true);
if thepos = -1 then showmessage('2232323');
fs := TFileStream.Create('testfile.dat', fmOpenReadWrite);
try
fs.Seek(thepos+8,soFromBeginning);
fs.ReadBuffer(Buffer,sizeof(Buffer));
version := version + Buffer;
finally
fs.free;
end;
version := version + '.';
if thepos = -1 then showmessage('2232323');
fs := TFileStream.Create('testfile.dat', fmOpenReadWrite);
try
fs.Seek(thepos+16,soFromBeginning);
fs.ReadBuffer(Buffer2,sizeof(Buffer2));
version := version + Buffer2;
finally
fs.free;
end;
showmessage(version);
end;
|
|
Zitat
|