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

                RemoteHooking.Inject(
                    processId,
                    InjectionOptions.Default,
                    path,
                    path,
                    string.Empty,
                    parameter
                    );
            }
            catch (Exception ex)
            {
                Debug.Print(ex.ToString());
                return(false);
            }

            return(true);
        }
Ejemplo n.º 2
0
        private static 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);
            }

            return(true);
        }