I think theres more to it than just changing variables etc.
I remember back in the day they basically ruined most public runpe's due to everyone and their mother doing this & using public ones released (which was awesome. but a big mistake due to such a great method being ruined by idiots.)
I'm not into the scene much anymore, so my advice is probably not that great.
but look at this:
https://www.adlice.com/runpe-hide-code-b...t-process/
Quote:"RunPE: Detection
As this trick is simple, it’s also simple to detect. We can assume safely (except for .NET assemblies) that a PE Header will be 99% the same in memory and in the disk image of a process.
Knowing that, we can then compare in each process the PE header of the file on disk with the image in memory. If there’s too much differences, we can safely assume the process is hijacked. RogueKiller in version 10.8.3 is able to detect RunPE injection."
So maybe you can have your stub in another language, and maybe thats the best way to go about this?
or find your own private method / a private method.
Sorry for double posting, I can't figure out how to edit the last post. I meant to say research why the headers will be 99% the same in most applications. and why .NET they can't safely assume it'll be the same header.
Figure out how anti-viruses are detecting the runpe, and go from there. See what they're looking for or whats giving your application away.