www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/16/16:00:30

From: Shawn Hargreaves <Shawn AT talula DOT demon DOT co DOT uk>
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: <en871.8012$z15 DOT 4555537 AT news21 DOT bellglobal DOT com>
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

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019