I came across a program SelfNote which stores all the text we write and the password in itself.No other file is created (the EXE changes its size as we change it's contents) . It is a standalone exe with all the content within it.
How can an exe modify itself ?
Is this possible in VB.net ??

3 Years
Discussion Span
Last Post by deceptikon

Possible? Yes. Off the top of my head, I'd probably approach it as storing the settings in an embedded resource, then replacing that resource when settings change.

However, this strikes me as an unnnecessary complication. I don't see any good reason why you can't distribute a config file along with your executable and use the usual settings methods. The password can (and should) of course be encrypted when stored in a user-accessible location, but that's trivial to do.

In terms of an executable modifying itself, there's a hard limitation of the file being locked while loaded in memory. So any solution would need to work around this limitation. Therein lies the rub, because now you're either using tricks like the resource replacement I mentioned, or actively disassembling and reassembling the IL from the client side (not a good idea in general).

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.