Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!usc!jarthur!ucivax!megatek!valhalla!hollen From: hollen@megatek.UUCP (Dion Hollenbeck) Newsgroups: comp.os.msdos.programmer Subject: Re: Linking binary data into MSC/MASM programs Message-ID: Date: 4 Mar 91 20:41:45 GMT References: <7431@hsv3.UUCP> Sender: hollen@megatek.UUCP Organization: Megatek Corporation, San Diego, California Lines: 26 In-reply-to: jls@hsv3.UUCP's message of 27 Feb 91 16:45:58 GMT In article <7431@hsv3.UUCP> jls@hsv3.UUCP (James Seidman) writes: > I'm writing a program which needs access to some large (8K-32K) chunks of > data. These data are produced by other programs and wind up in data files. > I'm currently just reading the data in from these files at run time, but > would really like to able to link them into my main program. > If nothing else works, here is a kludge which might. I used it in a previous life to stitch a p-SYSTEM binary into an MS-DOS loader program, but that is another story. In your executable, define a 32mb data area (global static data) initialized to a pattern you can easily find. Link so you get a map!!!. Rename .exe to .bin, read into debug. Using the offset from the map, look just before the 32 meg area for some lenght for the pattern. When you have found the address at which the block of data lives, just read in the file to that location from disk. Write the file back and change .bin to .exe. Hope you do not have to resort to this, but it worked for me in a past life. -- ----- Dion Hollenbeck (619) 455-5590 x2814 Megatek Corporation, 9645 Scranton Road, San Diego, CA 92121 uunet!megatek!hollen or hollen@megatek.uucp