Código Delphi
[-]
Function TMainForm.ReadFromOffset(const RAWFile: String; OffsetI: integer;BlockLength:Integer): string;
var
RAW: file;
BytesRead: integer;
RAWData: array[1..5000] of char;
I: integer;
c: pointer;
return: string;
begin
BytesRead := -1;
return := '';
AssignFile(RAW, RAWFile);
Reset(RAW,1);
for I := 0 to OffSetI - 1 do
Blockread(RAW,c,1);
BlockRead(RAW,RAWData,BlockLength,BytesRead);
for I := 1 to BlockLength do
return := return + RAWData[i];
ReadFromOffset := return;
CloseFile(RAW);
end;
I use this for read byte from datafile at offset and have result one string
this work but are really time expensive if i need to meke more search
I think because it search all file for go to 'offset'
someone can upgrade this routine ?