public bool DoInject(int PID_IN, string nameOfDllIN, bool StartThread) { Console.WriteLine(string.Concat(new string[] { PID_IN.ToString(), " : ", nameOfDllIN, " : ", StartThread.ToString() })); int num = PID_IN; if (num == -1) { Console.WriteLine("Process Not Found"); return(false); } if (num == 0) { Console.WriteLine("don't inject PID-0"); return(false); } Process processById = Process.GetProcessById(num); try { InjectorCore.LoadPayload(processById, nameOfDllIN, StartThread); return(true); } catch { return(false); } }
public bool DoInject(Process targetProcess, string nameOfDllIN, bool StartThread) { bool result; try { InjectorCore.LoadPayload(targetProcess, nameOfDllIN, StartThread); result = true; } catch { result = false; } return(result); }