August 22nd, 2004, 11:34 AM
Saving variables within a compiled exe?
Is it possible to write variables directly into the main ".exe" file, so that when the program is next run, it still remembers what the variables were last set to?
I imagine that this is normally done using .dat files, or text files, or even registry entries, but is it possible to do within the ".exe" itself?
August 23rd, 2004, 01:14 PM
It is certainly possible to write to an EXE, but I don't think a program can write to its own EXE because Windows may indicate that the file is locked and cannot be written to. However, it is possible like this:
1. EXE #1 spawns EXE #2
2. EXE #1 terminates
3. EXE #2 updates EXE #1
4. EXE #2 terminates
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo