Message-ID: <19980725005503.D222@cdata.tvnet.hu> Date: Sat, 25 Jul 1998 00:55:03 +0200 From: Laszlo Molnar To: DJGPP Workers List Subject: stub.exe problem Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: Molnar Laszlo Precedence: bulk Hi Workers! I've a problem with stub.exe. If you look at the binary image of any djgpp executable you'll see that there is a string \x0d\x0astub.h ... beginning at the file position 0x18. However these bytes (0x18-0x1b) are part of the exe-header according to the interrupt list. And the word at position 0x18 should show us the beginning of the relocation records. In our case this word(0x0a0d) is greater than 0x40, which means that the file has a new style executable header. Unfortunately this header is 0x40 bytes long, and should contain some information which the djgpp stub doesn't (for example it should contain the offset of the "real" executable at positions 0x3c-0x3f). So, I think that these exe headers are a little bit broken. Here is a patch that corrects this problem. bye, Laszlo --- src/stub/djasm.y~ Sun Jul 12 16:10:54 1998 +++ src/stub/djasm.y Thu Jul 23 12:44:34 1998 @@ -1361,10 +1361,10 @@ exe[23] = 0; time(&now); - sprintf(exe+24, "\r\n%s generated from %s by djasm, on %.24s\r\n", argv[2], argv[1], ctime(&now)); + sprintf(exe+28, "\r\n%s generated from %s by djasm, on %.24s\r\n", argv[2], argv[1], ctime(&now)); if (copyright) - strncat(exe+32, copyright, 480-strlen(exe+32)); - strcat(exe+32, "\r\n\032"); + strncat(exe+36, copyright, 480-strlen(exe+36)); + strcat(exe+36, "\r\n\032"); if (argv[2] == 0) { EndOfPatch