コード例 #1
0
ファイル: TestInjection.cs プロジェクト: BOTLANNER/Easyhook
        public TestInjection(
            RemoteHooking.IContext context,
            String channelName
            , TestComplexParameter parameter
            )
        {
            // connect to host...
            _interface = RemoteHooking.IpcConnectClient <TestInterface>(channelName);

            _interface.Ping();
        }
コード例 #2
0
ファイル: TestInjection.cs プロジェクト: Alois-xx/EasyHook
        public TestInjection(
            RemoteHooking.IContext context,
            String channelName
            , TestComplexParameter parameter
            )
        {
            // connect to host...
            _interface = RemoteHooking.IpcConnectClient<TestInterface>(channelName);

            _interface.Ping();
        }
コード例 #3
0
ファイル: TestInjection.cs プロジェクト: Alois-xx/EasyHook
        public void Run(
            RemoteHooking.IContext context,
            String channelName
            , TestComplexParameter parameter
            )
        {
            try
            {
                CreateFileHook = LocalHook.Create(
                    LocalHook.GetProcAddress("kernel32.dll", "CreateFileW"),
                    new DCreateFile(CreateFile_Hooked),
                    this);

                /*
                 * Don't forget that all hooks will start deactivated...
                 * The following ensures that all threads are intercepted:
                 */
                CreateFileHook.ThreadACL.SetExclusiveACL(new Int32[1]);
            }
            catch (Exception e)
            {
                /*
                    Now we should notice our host process about this error...
                 */
                _interface.ReportException(e);

                return;
            }


            _interface.IsInstalled(RemoteHooking.GetCurrentProcessId());
            _interface.SendMessage(parameter.Message);
            try
            {
                while (true)
                {
                    Thread.Sleep(10);

                    _interface.Ping();
                }
            
            }
            catch
            {
            }
        }
コード例 #4
0
ファイル: TestInjection.cs プロジェクト: BOTLANNER/Easyhook
        public void Run(
            RemoteHooking.IContext context,
            String channelName
            , TestComplexParameter parameter
            )
        {
            try
            {
                CreateFileHook = LocalHook.Create(
                    LocalHook.GetProcAddress("kernel32.dll", "CreateFileW"),
                    new DCreateFile(CreateFile_Hooked),
                    this);

                /*
                 * Don't forget that all hooks will start deactivated...
                 * The following ensures that all threads are intercepted:
                 */
                CreateFileHook.ThreadACL.SetExclusiveACL(new Int32[1]);
            }
            catch (Exception e)
            {
                /*
                 *  Now we should notice our host process about this error...
                 */
                _interface.ReportException(e);

                return;
            }


            _interface.IsInstalled(RemoteHooking.GetCurrentProcessId());
            _interface.SendMessage(parameter.Message);
            try
            {
                while (true)
                {
                    Thread.Sleep(10);

                    _interface.Ping();
                }
            }
            catch
            {
            }
        }