void InitializeProxy() { ProxyBase proxy; #if UseHookProxy client.Dll.InitializePipe(); proxy = new HookProxy(client); #else client.IO.StartProxy(); proxy = client.IO.Proxy; #endif proxy.ReceivedTextMessageIncomingPacket += new Proxy.IncomingPacketListener(Proxy_ReceivedTextMessageIncomingPacket); proxy.SplitPacketFromServer += SplitMessageFromServer; proxy.SplitPacketFromClient += SplitMessageFromClient; }
private void MainForm_Load(object sender, EventArgs e) { client = Client.Open(); client.IO.StartProxy(); proxy = client.IO.Proxy; hookProxy = new HookProxy(client); proxy.ReceivedSelfAppearIncomingPacket += new ProxyBase.IncomingPacketListener( delegate(IncomingPacket p) { Success(uxProxyStatus); return(true); }); hookProxy.ReceivedSelfAppearIncomingPacket += new ProxyBase.IncomingPacketListener( delegate(IncomingPacket p) { Success(uxHookProxyStatus); return(true); }); }
public void Start() { if (_hookProxy != null) { return; } _hookProxy = new HookProxy(); _hookProxy.OnCreateProcess += OnOnCreateProcess; string channelName = null; RemoteHooking.IpcCreateServer(ref channelName, WellKnownObjectMode.SingleCall, _hookProxy); Log.Verbose("{channel} ipc channel created", channelName); RemoteHooking.Inject(_process.Id, hookDll, hookDll, channelName); Log.Verbose("Inject {dll} to {target} process({pid})", hookDll, _process.ProcessName, _process.Id); _downloadThread = new Thread(DownloadProc); _downloadThread.Start(); }