Saving variables within a compiled exe?

This is a discussion on Saving variables within a compiled exe? within the Linux Programming forums, part of the Platform Specific Boards category; Hi, Is it possible to write variables directly into the main ".exe" file, so that when the program is next ...

  1. #1
    Registered User
    Join Date
    Sep 2009
    Posts
    10

    Saving variables within a compiled exe?

    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?

  2. #2
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    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.

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,751
    You asked already....
    modifying and saving global variables on a executable file using libelf !!!!

    What have YOU done so far.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Creating local variables in a program?
    By fl0at in forum C Programming
    Replies: 5
    Last Post: 01-04-2008, 07:34 PM
  2. Global Variables
    By Taka in forum C Programming
    Replies: 34
    Last Post: 11-02-2007, 04:25 AM
  3. Reading Separate Digits as Variables
    By linuxpyro in forum C Programming
    Replies: 7
    Last Post: 09-13-2006, 06:23 PM
  4. saving mutliple variables.......
    By jverkoey in forum C++ Programming
    Replies: 10
    Last Post: 02-13-2003, 08:34 PM
  5. functions to return 2 variables?
    By tim in forum C Programming
    Replies: 5
    Last Post: 02-18-2002, 02:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21