Пример #1
0
        public Main(
            RemoteHooking.IContext InContext,
            String InChannelName)
        {
            // connect to host...
            Interface = RemoteHooking.IpcConnectClient <MemoryCopyInterface>(InChannelName);

            Interface.Ping();
        }
Пример #2
0
        public void Run(
            RemoteHooking.IContext InContext,
            String InChannelName)
        {
            //// install hook...
            //try
            //{

            //    CreateFileHook = LocalHook.Create(
            //        LocalHook.GetProcAddress("kernel32.dll", "CreateFileW"),
            //        new DCreateFile(CreateFile_Hooked),
            //        this);

            //    CreateFileHook.ThreadACL.SetExclusiveACL(new Int32[] { 0 });
            //}
            //catch (Exception ExtInfo)
            //{
            //    Interface.ReportException(ExtInfo);

            //    return;
            //}

            Interface.StartInict(true, RemoteHooking.GetCurrentProcessId());

            RemoteHooking.WakeUpProcess();

            // wait for host process termination...
            try
            {
                while (true)
                {
                    Thread.Sleep(500);
                    ///如果开始截图
                    if (Interface.CanPictrue)
                    {
                        Interface.Ping();
                        CaputerImage(400, 300, @"C:\Users\Administrator\Desktop\MyOpenGLHook\test.bmp");
                        Interface.SetOnePictrue();
                    }

                    //Interface.Ping();
                }
            }
            catch
            {
                // Ping() will raise an exception if host is unreachable
            }
        }