I would like to have one executable 'execute' another executable from a memory buffer / ram disk (do these even exist under windows?).

Basically I want to have my main executable encrypted, and then have a loader which loads it to ram, decrypts it and then executes it. I do *not* want to write the decrypted thing out to a temporary file and then run that.

If I did, it would kind of defeat the purpose of encrypting the file to begin with unless there is a safe place, an invisible place, I can put this temporary file that is decrypted when I run it.

I just do not want a clever end user getting ahold of a decrypted version of an executable file.

Does anyone have any idea how to do this?