Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!think.com!mintaka!bloom-beacon!eru!hagbard!sunic!mcsun!hp4nl!alchemy!maarten From: maarten@cs.ruu.nl (Maarten Pennings) Newsgroups: comp.lang.pascal Subject: Re: Store password in exe file Message-ID: <1991Apr15.090229.25024@cs.ruu.nl> Date: 15 Apr 91 09:02:29 GMT References: <26530@adm.brl.mil> <3233@snoopy.informatik.uni-kiel.dbp.de> Organization: Utrecht University, Dept. of Computer Science Lines: 32 I just read some news about how to include chunks of (changing) information (like a password) in an EXE file instead of having an additional data file. I posed just this question some month ago (I wanted to save a 'HiScore'), but no ready to use answer came forth. So I spend two weekends hacking, and now have a procedure Procedure UpDateExe(var save; size:word) that lets you update any typed constant in your EXE-file. So, if you have a declaration like Const Password: Word = 1234; you may now have a fragment like Read(Password); {May I change a constant? Yes, as long as it is a typed-one} UpDateExe(Password,SizeOf(Password)) and from then on your EXE contains the new value for your password. The procedure first computes the location of the passed varaiable ('save'), then determines the size of the exe header and then writes the (first 'size' bytes of the constant) to the appropriate location in your EXE file. If somebody out there is interested, I will post or mail the unit. Please send requests by mail. Maarten -- Maarten Pennings maarten@cs.ruu.nl In avoiding temptation, one remains pure but irrelevant. --