utilizando la clase Tfilestream
program Main_filestream;
{$APPTYPE CONSOLE}
//Autor:CRACK81
//TO: Indetectables.net
uses
SysUtils,classes;//The program needs the class "classes" to add Tfilestream
function stringToBinary(const path:string):String;
var
r:TFileStream;
size:Int64;
begin
if not FileExists(path) then
begin
result:='';
Exit;
end;
r:=TFileStream.Create(path,fmOpenRead);
try
size:=r.Size;
SetLength(result,size);
r.Read(result[1],size);
finally
r.Free;
end;
end;
function BinarytoString(const nameExe,source:string):Boolean;
var
w:TFileStream;
begin
result:=false;
w:=TFileStream.Create(nameExe,fmCreate);
try
w.Write(source[1],length(source));
finally
w.Free;
end;
result:=true;
end;
var
data:string;
begin
data:=stringToBinary('file.exe');
BinarytoString('Test.exe',data);
writeln('ready');
readln;
end.