Store data in executable

前端 未结 6 1943
梦毁少年i
梦毁少年i 2021-01-02 07:15

I\'m just curious about this for a long time.

Is it possible for an application to store some changeable data (like configurations and options) inside its own execut

6条回答
  •  臣服心动
    2021-01-02 07:34

    In case of windows PE files, you can write data at the end of the file. You need to know the EXE size before writing your own data so that in the 2nd writes onwards you know from which position in the exe file to start writing.

    Also you can't modify the file when it's running. Your main program needs to extract and run a temporary exe somewhere so that when the main program finished, the temp exe writes configuration to the main exe file.

提交回复
热议问题