This makes it very hard for a .exe to modify itself.
One trick that you can do however (I've done it on a Delphi program a long time ago) is that you can have a DLL that you load dynamically, that you can actually unload from the process, write updates and then reload into the process again.
What I did was that I made several defined a "marker constant block" before the constants in the DLL-code that where my "settings" that i wanted to save in the DLL.
When I wanted to save settings I simply
1. unloaded the dll
2. opened it as a file
3. searched for the "marker constant block"
4. edited the offset bytes right after the marker block
5. closed file
6. reloaded dll.
Also note that Windows Vista and Windows 7 is very much more restrictive about updating stuff in you c:\program files\ folder and c:\windows\system32 folders so my method above it not as effective today as it once was, but I think that this description should get you going to make a prototype if you are curious
