Example #1
0
        private void AttachProcess()
        {
            string exeName = "minitri";

            Process[] processes = Process.GetProcessesByName(exeName);
            foreach (Process process in processes)
            {
                if (process.MainWindowHandle == IntPtr.Zero)
                {
                    continue;
                }

                // Skip if the process is already hooked (and we want to hook multiple applications)
                //if (HookManager.IsHooked(process.Id))
                //{
                //    continue;
                //}

                Direct3DVersion direct3DVersion = Direct3DVersion.AutoDetect;

                ConfigDll c = new ConfigDll()
                {
                    Direct3DVersion = direct3DVersion,
                    ShowOverlay     = true
                };

                var interfaceDll = new InterfaceDll();
                interfaceDll.RemoteMessage += InterfaceDll_RemoteMessage;

                _InjectProcess = new MainClass(process, c, interfaceDll);
                break;
            }
        }
Example #2
0
        public MainClass(Process process, ConfigDll config, InterfaceDll Interface)
        {
            _serverInterface = Interface;

            _screenshotServer = RemoteHooking.IpcCreateServer <InterfaceDll>(ref _channelName,
                                                                             System.Runtime.Remoting.WellKnownObjectMode.Singleton, _serverInterface);

            RemoteHooking.Inject(process.Id,
                                 InjectionOptions.Default,
                                 typeof(InterfaceDll).Assembly.Location,
                                 typeof(InterfaceDll).Assembly.Location,
                                 _channelName,
                                 config);
        }
        public BaseDXHook(InterfaceDll ssInterface)
        {
            this.Interface = ssInterface;
            this.Timer     = new Stopwatch();
            this.Timer.Start();
            this.FPS    = new FramesPerSecond();
            ProcessLoad = new Common.ProcessLoad(new System.Drawing.Font("Arial", 12))
            {
                Location = new System.Drawing.Point(5, 20), Color = System.Drawing.Color.Red, AntiAliased = true
            };

            Interface.DisplayText           += InterfaceEventProxy.DisplayTextProxyHandler;
            InterfaceEventProxy.DisplayText += new DisplayTextEvent(InterfaceEventProxy_DisplayText);
        }
Example #4
0
        private void AttachProcess()
        {
            string exeName = "notepad";

            Process[] processes = Process.GetProcessesByName(exeName);
            foreach (Process process in processes)
            {
                ConfigDll c = new ConfigDll()
                {
                };

                var interfaceDll = new InterfaceDll();
                interfaceDll.RemoteMessage += InterfaceDll_RemoteMessage;

                _InjectProcess = new MainClass(process, c, interfaceDll);
                break;
            }
        }
Example #5
0
        public EntryPoint(EasyHook.RemoteHooking.IContext context, String channelName, ConfigDll config)
        {
            _interface = EasyHook.RemoteHooking.IpcConnectClient <InterfaceDll>(channelName);

            #region Allow client event handlers (bi-directional IPC)

            // Attempt to create a IpcServerChannel so that any event handlers on the client will function correctly
            System.Collections.IDictionary properties = new System.Collections.Hashtable();
            properties["name"]     = channelName;
            properties["portName"] = channelName + Guid.NewGuid().ToString("N"); // random portName so no conflict with existing channels of channelName

            BinaryServerFormatterSinkProvider binaryProv = new BinaryServerFormatterSinkProvider();
            binaryProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;

            _clientServerChannel = new IpcServerChannel(properties, binaryProv);
            ChannelServices.RegisterChannel(_clientServerChannel, false);

            #endregion
        }
 public DXHookD3D11(InterfaceDll ssInterface)
     : base(ssInterface)
 {
 }
Example #7
0
 public DXHookD3D10(InterfaceDll ssInterface)
     : base(ssInterface)
 {
     this.DebugMessage("Create");
 }