private void ButtonInject_CheckedChanged(object sender, System.EventArgs e) { if (this.ButtonInject.IsDepressed) { try { var processName = this.TextBoxProcess.Text; var processes = Process.GetProcessesByName(processName); if (processes.Any()) { this.IpcInterface = new IpcInterface(); if (CheckStartPaused.Checked) IpcInterface.StartPaused = true; InjectionHelper.IpcServerCreateListeningChannel(this.IpcInterface); EasyHook.Config.Register("Starcraft 2 AI Bot", "Logging.dll", "RemotingInterface.dll", "Interceptor.dll", "Game.dll", "Direct3D9Hook.dll", "NLog.dll", "SharpDX.dll", "SharpDX.Direct3D9.dll"); InjectionHelper.Inject("Interceptor.dll", "Interceptor.dll", processes.First().Id); } } catch (Exception ex) { MessageBox.Show(ex.ToString(), "Injection Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } } else { // Should exit, but not implemented } }
public static void IpcServerCreateListeningChannel(IpcInterface ipcInterface) { ipcServer = RemoteHooking.IpcCreateServer<IpcInterface>(ref IpcChannelName, WellKnownObjectMode.Singleton, ipcInterface, IpcChannelName, true, WellKnownSidType.WorldSid); }