C# Anti Terminate Process

Posts 1–4 of 4 · Page 1 of 1
C# Anti Terminate Process
Code

Video: youtube.com/watch?v=XiTzsh1hErI


Code:
using System.Runtime.InteropServices;
using System.Diagnostics;
 
 
        [DllImport("ntdll.dll", SetLastError = true)]
        private static extern int NtSetInformationProcess(IntPtr hProcess, int processInformationClass
            , ref int processInformation, int processInformationLength);
 
        //https://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FProcess%2FPROCESS_INFORMATION_CLASS.html
 
       
 
        public void critical(int status)
        {
            int BreakOnTermi =0x1D;  //breakoftermination value
            //https://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FProcess%2FPROCESS_INFORMATION_CLASS.html
            Process.EnterDebugMode();
            NtSetInformationProcess(Process.GetCurrentProcess().Handle, BreakOnTermi,
            ref status, sizeof(int));
 
        }
 
 
 
// critical(1); enable anti termanite,critical(0) disable anti terminate.
There is also code to show "Access denied." message or hide process from taskmgr
Anyways nice source
Does it work on Windows 10?
Im looking for a source or at least a documentation on how do I make an external application that I launched getting "access denied" from Process Explorer.
Similar on how EAC protected Paladins.exe or how Xigncode protected their clients.
Posts 1–4 of 4 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us