Y S
Y S

Reputation: 41

Is it possible to change the .exe file during its excecution?

For example: I make a game and at the end of the game i have a score. I could save the score by means of a new file. But would it be possible to allocate some space within the .exe file which is my game, so that I dont have any extra file?

Upvotes: 1

Views: 143

Answers (1)

Oliver Matthews
Oliver Matthews

Reputation: 7863

Yes, you can, but not as much as you used to be able to, and you shouldn't.

It's bad because:

  1. AV software will spot the change and flag it as a possible virus infection
  2. You will incorrectly invalidate windows pre-fetching (potentially slowing app loading).
  3. You will need to run the app with admin permission (a bad idea) to gain write access to the exe.
  4. It breaks the expected layout and distribution of things. Windows has expected places to put this sort of thing, use it.

Upvotes: 2

Related Questions