Ejemplo n.º 1
0
        private bool InstallHookInternal(int processId)
        {
            try
            {
                var parameter = new HookParameter
                {
                    Msg           = "已经成功注入目标进程",
                    HostProcessId = RemoteHooking.GetCurrentProcessId()
                };

                serverInterface = new HookServer();
                string channelName = null;
                RemoteHooking.IpcCreateServer <HookServer>(ref channelName, System.Runtime.Remoting.WellKnownObjectMode.Singleton, serverInterface);

                RemoteHooking.Inject(
                    processId,
                    InjectionOptions.Default,
                    typeof(HookParameter).Assembly.Location,
                    typeof(HookParameter).Assembly.Location,
                    channelName,
                    parameter
                    );
            }
            catch (Exception ex)
            {
                Debug.Print(ex.ToString());
                return(false);
            }
            injectButton.Enabled = false;
            deattachBtn.Enabled  = true;
            return(true);
        }
Ejemplo n.º 2
0
        public void Run(
            RemoteHooking.IContext context,
            string channelName
            , HookParameter parameter
            )
        {
            frameCount = 0;
            try
            {
                LuaDLL.Uninstall();
                LuaDLL.HookLoadLibrary();
                LuaDLL.BindEasyHook();
                MessageBox.Show("success");
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
                return;
            }

            NetWorkClient.ConnectServer("127.0.0.1", 2333);
            while (true)
            {
                Thread.Sleep(100);
                frameCount++;
            }
        }
Ejemplo n.º 3
0
 private bool InstallHookInternal(int processId)
 {
     try
     {
         var parameter = new HookParameter
         {
             Msg           = "已经成功注入目标进程",
             HostProcessId = RemoteHooking.GetCurrentProcessId()
         };
         RemoteHooking.Inject(
             processId,
             InjectionOptions.Default,
             typeof(HookParameter).Assembly.Location,
             typeof(HookParameter).Assembly.Location,
             string.Empty,
             parameter
             );
     }
     catch (Exception ex)
     {
         Debug.Print(ex.ToString());
         return(false);
     }
     injectButton.Enabled = false;
     deattachBtn.Enabled  = true;
     return(true);
 }
Ejemplo n.º 4
0
 public Main(
     RemoteHooking.IContext context,
     string channelName
     , HookParameter parameter
     )
 {
 }