Mail Archives: djgpp/1998/05/16/16:00:30
Paul Derbyshire writes:
>Using DJGPP (but not Allegro) is there a simple way to add an arbitrary
>chunk of binary data after the DJGPP exe, and have it available for
>read/write as if it were a file?
Of course. Allegro does this with the exedat utility: look at the
sources to see how it works.
>Is there some sort of pointer in the exe to the end to allow a
>simple seek to the start of the added data (if any) and read/write data
>there?
I don't know enough about the COFF format to say whether this is
possible, but it can be done much more easily than that. Just seek to
the end of the executable file, append your data, and then add a footer
structure describing what you added. To read it back in, seek to the
very end of the file, read the footer, and then seek backwards by
whatever offset it indicates.
--
Shawn Hargreaves - shawn AT talula DOT demon DOT co DOT uk - http://www.talula.demon.co.uk/
"Miracles are nothing if you've got the wrong intentions" - Mike Keneally
- Raw text -