delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2003/06/18/15:32:35

Date: Wed, 18 Jun 2003 15:31:22 -0400
Message-Id: <200306181931.h5IJVMsc026633@envy.delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <019401c335cf$2725ffd0$0600000a@broadpark.no> (giva@bgnett.no)
Subject: Re: Custom COFF-header
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> <019401c335cf$2725ffd0$0600000a AT broadpark DOT no>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> I've made a basic stubedit program, but wondered how to insert my
> own Optional header behind the COFF-header.

You don't.  The stub isn't smart enough to read the size field - it
expects a fixed size.

> 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?

The stub wouldn't be able to load it.  Why can't you use the existing
timestamp and version fields?

> 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?

It's the math one, exept your math is wrong.  See:
http://www.delorie.com/djgpp/doc/exe/

> What does the '_GO32_StubInfo.size = 84' indicate?

How much of the stub is the table at the beginning.  That way, if we
add fields later, stubedit can determine what parts of the stub table
are changable.

- Raw text -


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