Ich hätte bei Assembler bleiben sollen
Delphi-Quellcode:
Procedure stringtohex(const fn: TFileName; sg: tStrings);
var
fs: TFileStream;
lpBuffer: array of Byte;
x: Integer;
s: string;
begin
fs := TFileStream.Create('test.gam', fmOpenRead);
try
if (fs.Size > 0) then
begin
SetLength(lpBuffer, fs.Size);
fs.Read(lpBuffer[0], fs.Size);
end;
s := '';
for x := Low(lpBuffer) to High(lpBuffer) do
begin
s := s + IntToHex(lpBuffer[x], 2) + ' ';
end;
// showmessage(s);
finally
fs.Free;
end;
end;
procedure TForm2.N3Click(Sender: TObject);
begin
opendialog1.execute;
HexDump(OpenDialog.FileName, Memo.Lines);
//showmessage(opendialog1.filename); //Pfad
end;