I'm writing an application which saving some values to EXE file.
I wrote 'SaveToEXE' function.
Now I've got a problem.
How to read saved values in EXE file? Values are stored at the end of the file. How to read this string:
I found the function LoadFromEXE, but in Delphi:
How to do it in C++?
FUNCTION LoadFromFile(FName: string): string;
F: File of Byte;
Result := '';
FileMode := fmOpenRead;
Seek(F, FileSize(F) - SizeOf(I));
BlockRead(F, I, SizeOf(I));
if (I < SizeOf(I)) or (I > FileSize(F)) then
Seek(F, FileSize(F) - I);
SetLength(Result, I - SizeOf(I));
BlockRead(F, Result, Length(Result));
XXX := Result;
// Sorry for my english.