From: James MacDonald Newsgroups: comp.os.msdos.djgpp Subject: Re: what's the size of the DJGPP stub + .EXE header? Date: Mon, 4 Aug 1997 12:47:13 +0100 Organization: Trills and Technologies Distribution: world Message-ID: References: <33E4A623 DOT 3A94FC62 AT execulink DOT com> NNTP-Posting-Host: netbook.demon.co.uk MIME-Version: 1.0 Lines: 18 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk In article <33E4A623 DOT 3A94FC62 AT execulink DOT com>, Jeff Weeks scribbled : >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. > >In DJGPP you can't do this though because of the stub (correct?), so I >need to know the size of the stub, so that I can strip it from the >executable to get a flat binary file. > DJGPP produces COFF files, which are executable on some Unices. Then it adds a stub to load the COFF file and execute it in DOS. The size of the stub, in bytes, is 2048 for DJGPP 2.00 (assemble src/stub/stub.asm and DIR) - strip it and you have a flat binary. Look at stubify.c and exe2coff.c, especially the latter.