function O_o(FileName: String): String;
var
f: File;
P, Pt: Pointer;
Size, i: DWord;
function DecToBin(Dec, Digits, CompareDigit: DWord): String;
var
i: Integer;
begin
Result := '';
// CompareDig := Round(Exp(Digits * Ln(2)) / 2);
for i := 0 to Digits - 1 do
Result := Result + IntToStr(Integer(Dec and (CompareDigit shr i) > 0));
end;
begin
Result := '';
AssignFile(f, FileName);
Reset(f, 1);
Size := FileSize(f);
GetMem(Pt, Size);
P := Pt;
BlockRead(f, P^, Size);
CloseFile(f);
for i := 1 to Size do begin
Result := Result + DecToBin(Byte(P^), 8, 128);
P := Pointer(DWord(P) + 1);
end;
FreeMem(Pt, Size);
end;
Результат выводим в Memo
Form1.Memo1.Text := O_o('Test.txt');