From: Shawn Hargreaves Newsgroups: comp.os.msdos.djgpp Subject: Re: Executables with added data. Date: Sat, 16 May 1998 12:57:15 +0100 Organization: None Message-ID: <$KTooMAb8XX1EwjR@talula.demon.co.uk> References: NNTP-Posting-Host: talula.demon.co.uk MIME-Version: 1.0 Lines: 23 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk 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