delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/02/07/02:47:33

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Lines: 28
X-Admin: news AT aol DOT com
From: sterten AT aol DOT com (Sterten)
Newsgroups: comp.os.msdos.djgpp
Date: 07 Feb 2004 07:29:22 GMT
References: <200402061851 DOT i16Ipq6I013270 AT envy DOT delorie DOT com>
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
Subject: Re: attaching source code to the ececutable
Message-ID: <20040207022922.17062.00001693@mb-m03.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

 >> I should also mention, that I usually have a simple routine and a
commandline
 >> switch which prints the attached sourcecode of these .exes.
 >
 >If you just want to print the sources (or any text file), use djgpp's
 >bin2h program.  That will turn the source into an includable .h file
 >which you can use to print from.

no, it's for the potential user or email-friend who has got the
.exe from you and now wants to see its sourcecode.

 >Any program that relies on extra data being "after the executable" is
 >going to have problems with djgpp, because "the executable" is only 2k
 >bytes long and the whole program is already attached after it!  That's
 >how we manage to run 32-bit programs in a 16-bit environment.

I have many programs with text attached and never observed
any problems. 
I assume that the attached text isn't loaded, when the program
is executed. DOS/Windows looks for the length of the program
in the .exe header and then only loads to RAM the number of bytes
specified there, and ignores the rest.
So there can only be problems, if the program opens
the .exe files itself, (like my sourcecode-printing routine does)
e.g. for computing a checksum.
Maybe in that case (opening the file which is just being executed)
an error message or a warning should be displayed (unless I
suppress it).

- Raw text -


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