var
FileBuff: TBytes;
Pattern: TBytes;
begin
FileBuff := filetobytes(filename);
Result := CompareMem(@Pattern[0], @FileBuff[0], Length(Pattern));
end;
Có chức năng nhưCó chức năng "Pos" nào để tìm byte không?
Result := Pos(@Pattern[0], @FileBuff[0]);
Pos là an toàn nhị phân, thức ăn nó với mảng của AnsiChar và thì đấy, công trình –
Bạn cũng có thể quan tâm đến một Hàm StringReplace cho byte: http://stackoverflow.com/questions/3106139/binary-version-of-stringreplace –