PDA

View Full Version : Saving variables within a compiled exe?



redone
09-12-2009, 10:53 PM
Hi,

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?

Sebastiani
09-12-2009, 11:19 PM
What operating system? Under Windows, you can use the BeginUpdateResource/UpdateResource/EndUpdateResource API's. Of course you have to have an existing resource section in the executable for those to work.

Salem
09-12-2009, 11:27 PM
You asked already....
http://cboard.cprogramming.com/linux-programming/119427-modifying-saving-global-variables-executable-file-using-libelf.html

What have YOU done so far.