Advertisement
Guest User

Untitled

a guest
Jun 4th, 2017
1,636
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.06 KB | None | 0 0
  1. using System.Runtime.InteropServices;
  2. using System.Diagnostics;
  3.  
  4.  
  5.         [DllImport("ntdll.dll", SetLastError = true)]
  6.         private static extern int NtSetInformationProcess(IntPtr hProcess, int processInformationClass
  7.             , ref int processInformation, int processInformationLength);
  8.  
  9.         //https://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FProcess%2FPROCESS_INFORMATION_CLASS.html
  10.  
  11.        
  12.  
  13.         public void critical(int status)
  14.         {
  15.             int BreakOnTermi =0x1D;  //breakoftermination value
  16.             //https://undocumented.ntinternals.net/index.html?page=UserMode%2FUndocumented%20Functions%2FNT%20Objects%2FProcess%2FPROCESS_INFORMATION_CLASS.html
  17.             Process.EnterDebugMode();
  18.             NtSetInformationProcess(Process.GetCurrentProcess().Handle, BreakOnTermi,
  19.             ref status, sizeof(int));
  20.  
  21.         }
  22.  
  23.  
  24.  
  25. // critical(1); enable anti termanite,critical(0) disable anti terminate.
  26.  
  27. //https://www.youtube.com/watch?v=XiTzsh1hErI&feature=youtu.be
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement