delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/08/03/16:50:02

Date: Sun, 3 Aug 1997 16:49:18 -0400 (EDT)
Message-Id: <199708032049.QAA22239@delorie.com>
From: DJ Delorie <dj AT delorie DOT com>
To: pweeks AT execulink DOT com
CC: djgpp AT delorie DOT com
In-reply-to: <33E4A623.3A94FC62@execulink.com> (message from Jeff Weeks on
Sun, 03 Aug 1997 11:39:15 -0400)
Subject: Re: what's the size of the DJGPP stub + .EXE header?

> I need to know the size of the DJGPP stub plus the .EXE header.  In most
> compilers, to get a flat binary file, you simply strip the first 512
> bytes (which would be the .EXE header) from the resultant executable.

The correct way to do this is to read in the EXE header, which
includes a field stating how big the EXE file is (after all, DOS needs
to know how much to load).  You should never rely on the stub being a
fixed size.

exe2coff uses this technique to strip off the stub from DJGPP
programs.

- Raw text -


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