I've started to work on my runPE just to get a little more familiar with C# and how a runPE work. Just for learning purposes. And this is how I do it.
private static void Inject(string injectTo, string binToInject)
{
int num = 0;
RunPe.Run(Path.Combine(System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory(), /*injectTo*/"ilasm.exe"),"", File.ReadAllBytes(binToInject), 4, ref num);
}
How ever, right now the bin(.exe) file I 'inject' located on my machine, what I would like to do is to stream this bin from DataBase or a server so it would not need to be on my machine. Is that possible?