コード例 #1
0
        private void TT2()
        {
            Context context;
            IntPtr  exitProcess = Loader.GetProcedure("kernel32.dll", "ExitProcess");

            foreach (var thread in Windows.GetProcessThreads(_pid).Values)
            {
                using (ThreadHandle thandle = new ThreadHandle(thread.ClientId.ThreadId,
                                                               ThreadAccess.GetContext | ThreadAccess.SetContext))
                {
                    try
                    {
                        context = thandle.GetContext(ContextFlags.Control);
                        context.ContextFlags = ContextFlags.Control;
                        context.Eip          = exitProcess.ToInt32();
                        thandle.SetContext(context);
                    }
                    catch
                    { }
                }
            }
        }
コード例 #2
0
        private void TT2()
        {
            Context context;
            IntPtr exitProcess = Loader.GetProcedure("kernel32.dll", "ExitProcess");

            foreach (var thread in Windows.GetProcessThreads(_pid).Values)
            {
                using (ThreadHandle thandle = new ThreadHandle(thread.ClientId.ThreadId,
                    ThreadAccess.GetContext | ThreadAccess.SetContext))
                {
                    try
                    {
                        context = thandle.GetContext(ContextFlags.Control);
                        context.ContextFlags = ContextFlags.Control;
                        context.Eip = exitProcess.ToInt32();
                        thandle.SetContext(context);
                    }
                    catch
                    { }
                }
            }
        }