public HookInjection( RemoteHooking.IContext InContext, String InChannelName, String entryPoint, String dll, String returnType, String scriptBlock, String modulePath, String additionalCode, bool eventLog) { Log("Opening hook interface channel...", eventLog); Interface = RemoteHooking.IpcConnectClient <HookInterface>(InChannelName); try { Runspace = RunspaceFactory.CreateRunspace(); Runspace.Open(); //Runspace.SessionStateProxy.SetVariable("HookInterface", Interface); } catch (Exception ex) { Log("Failed to open PowerShell runspace." + ex.Message, eventLog); Interface.ReportError(RemoteHooking.GetCurrentProcessId(), ex); } }
public HookInjection( RemoteHooking.IContext InContext, String InChannelName, String entryPoint, String dll, String returnType, String scriptBlock, String modulePath, String additionalCode, bool eventLog) { Log("Opening hook interface channel...", eventLog); Interface = RemoteHooking.IpcConnectClient<HookInterface>(InChannelName); try { Runspace = RunspaceFactory.CreateRunspace(); Runspace.Open(); //Runspace.SessionStateProxy.SetVariable("HookInterface", Interface); } catch (Exception ex) { Log("Failed to open PowerShell runspace." + ex.Message, eventLog); Interface.ReportError(RemoteHooking.GetCurrentProcessId(), ex); } }