Message-ID: <019401c335cf$2725ffd0$0600000a@broadpark.no> From: "Gisle Vanem" To: References: <055b01c33505$aecfabe0$0600000a AT broadpark DOT no> <200306171933 DOT h5HJXIJw010320 AT envy DOT delorie DOT com> <05ef01c3350f$fae1f600$0600000a AT broadpark DOT no> <200306172047 DOT h5HKl4CB011399 AT envy DOT delorie DOT com> Subject: Re: Custom COFF-header Date: Wed, 18 Jun 2003 21:23:52 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 Reply-To: djgpp AT delorie DOT com > I think ld intentionally leaves it zero, so you'd have to write your > own program. Or you could modify djgpp's stubedit to do it :-) I've made a basic stubedit program, but wondered how to insert my own Optional header behind the COFF-header. If there's aleady a AOUT header there, do I simply increase the 'coff_hdr.f_opthdr' and 'coff_hdr.f_symptr' and stick my own stubdata behind the original AOUT header? Do I need some magic value to mark it as a non-AOUT header? Here's what I understood about the layout so far: EXE_header _GO32_StubInfo <-- exe_start _GO32_StubCode FILHDR ; COFF header AOUTHDR ; is this always here ? I have some problems with the offset to the COFF-header. Is it '512 * EXE_header.pages + EXE_header.length' ? Or always at offset 0x800? What does the '_GO32_StubInfo.size = 84' indicate? --gv