Skip to content

Commit

Permalink
Executor should now inject into the last created ExeFile process - pr…
Browse files Browse the repository at this point in the history
…esumably the one it created
  • Loading branch information
dambrisco committed Sep 30, 2011
1 parent bc6d6d5 commit 4d7f03d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion Injector/Injector/Executor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public void Inject(String dll, String process)

Console.WriteLine("Trying to inject " + dll + " into " + process);
MessageStruct messageData = new MessageStruct() { Text = "Custom Message", Caption = "Custom Message Box" };
syringe = new Injector(Process.GetProcessesByName(process)[0]);
Process[] processes = Process.GetProcessesByName(process);
Array.Sort(processes, delegate(Process x, Process y) { return -1 * (x.StartTime.CompareTo(y.StartTime)); });
syringe = new Injector(processes[0]);
syringe.InjectLibrary(dll);
Console.WriteLine(dll + " injected into " + process);

Expand Down

0 comments on commit 4d7f03d

Please sign in to comment.