Board index » delphi » How do i save data into the EXE file ?
Scott J Clee
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
|
Scott J Clee
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
How do i save data into the EXE file ?I have managed to be able to save the egavga.bgi file into an executable Scott Clee - D2a |
Andrew W. Clarke II
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do i save data into the EXE file ?This is something that is of interest to me, also. Please post replies Thanks. |
Robert B. Cla
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do i save data into the EXE file ?On Tue, 18 Feb 1997 10:45:27 -0500, "Andrew W. Clarke III" Quote<acla...@chapman.edu> wrote: image) of any typed constant in your own programs. It's heavily commented, so I'll not say much about it in this preface. Snip out the included example usage program, compile it and the WriteExe This compiles and runs under TP v6.0 and 7.0; presumably also in 5.x, (* PURPOSE: NOTES: CONST <object>: <objectType> = <value>; Variables of this type are stored in your executable's data segment. The executable header size is stored as a two-byte word at offset 8 in The offset of the object variable may be expressed in Turbo Pascal by objectVarOfs := 16 * (ExeHeaderSize + Seg(objectVar) - PrefixSeg) + Note that on a PC, a segment:offset memory address pair may be Once the object variable has been located within the executable, it's This source file uses a unit named Convert if "Debug" is defined at EXAMPLE USAGE: TYPE objectType = string; BEGIN Unit WriteExe; { =================================================================== } Uses Dos {$IFDEF Debug}, Convert {$ENDIF}; FUNCTION Write2EXE(var objectVar; objectVarSize: word): boolean; { =================================================================== } IMPLEMENTATION procedure ErrMsg(s: string; code: integer); function GetEXEHeader(var f: FILE): word; VAR IOError: integer; FUNCTION Write2Exe(var objectVar; objectVarSize: word): boolean; VAR f: FILE; { Must be an untyped file } begin if IOError <> 0 then if IOError = 0 then { Write new objectVar in executable } {$IFDEF Debug} { Uses HexWord() and HexDWord() from Convert.TPU } BEGIN -- |
Remco de Kort
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do i save data into the EXE file ?Andrew W. Clarke III wrote: Quote
#1 Put the data in an array, which you put in the CONST-department. Not #3 I also remember doing something hazardous as pasting the data to the If you need more info look out for other messages or mail me. Bye, Remco de Korte |
Dr John Stockto
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do i save data into the EXE file ?In article <3310295e.5404...@news.iquest.net> of Fri, 21 Feb 1997 Quote<rcl...@iquest.net> wrote: altered. *Might* have been useful at code debugging stage! -- |
swright..
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do i save data into the EXE file ?Here's a simple printing program I wrote (or modified after stealing some of it const var procedure message; procedure Change_params; begin {-----Check input values for margins-------} PB.PL := pagelength; end; procedure header; procedure footer; {---------------------MAIN----------------------------} if ParamCount=0 then message; {------------------Printing Loop-------------------------------} assign(f, ParamStr(i)); lmargin := ''; while not eof(f) do begin Stephen Wright |
Rob Sto
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do i save data into the EXE file ?I'm sure you've had a few responses telling you how to do There are a few things you can do to reduce or eliminate the Rob |
Joris de Gruyte
Delphi Developer |
Wed, 18 Jun 1902 08:00:00 GMT
Re:How do i save data into the EXE file ?Dit is een meerdelig bericht in MIME-indeling. ------=_NextPart_000_01BC21A1.D196BF20 To Save data into an EXE-file, you assign the exe-file Assign(f,Paramstr(0)); You go to the end of the exe-file : Seek(f,Filesize(f)); And you write your data : Write(f,...); Joris. ------=_NextPart_000_01BC21A1.D196BF20 <html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 = |