delphi对抗任务管理器关闭芭奇软件服务器香港站群服务器租用
-
≥ 1台¥600.00
delphi 对抗任务管理器关闭芭奇软件服务器 香港站群服务器租用
高防服务器租用 请联系 锐辉网络敏敏 :..........................................2853898501
program Project1;
uses
Windows;
{$R *.res}
function MakeMeCritical(Yes: Boolean): Boolean;
const
SE_DEBUG_PRIVILEGE = $14;
SE_PROC_INFO = $1D;
var
Enabled: PBOOL;
DllHandle: THandle;
BreakOnTermination: ULong;
HR: HRESULT;
RtlAdjustPrivilege: function(Privilege: ULONG; Enable: BOOL; CurrentThread: BOOL; var Enabled: PBOOL): DWORD; stdcall;
NtSetInformationProcess: function(ProcHandle: THandle; ProcInfoClass: ULONG; ProcInfo: Pointer; ProcInfoLength: ULONG): HResult; stdcall;
begin
Result := False;
DllHandle := LoadLibrary('ntdll.dll') ;
if DllHandle <> 0 then
begin
@RtlAdjustPrivilege := GetProcAddress(dllHandle, 'RtlAdjustPrivilege');
if (@RtlAdjustPrivilege <> nil) then
begin
if RtlAdjustPrivilege(SE_DEBUG_PRIVILEGE, True, True, Enabled) = 0 then
begin
@NtSetInformationProcess := GetProcAddress(dllHandle, 'NtSetInformationProcess');
if (@NtSetInformationProcess <> nil) then
begin
BreakOnTermination := Ord(Yes);
HR := NtSetInformationProcess(GetCurrentProcess(), SE_PROC_INFO, @BreakOnTermination, SizeOf(BreakOnTermination));
Result := HR = S_OK;
end;
end;
end;
FreeLibrary(DllHandle);
end
end;
begin
if MakeMeCritical(True) then
begin
//the user cannot termintate the process now
MessageBoxA(0, PAnsiChar('你TMD在任务管理器关闭我看看!'), PAnsiChar('不要关闭此窗口'), 0);
MakeMeCritical(False)
end
else
MessageBoxA(0, PAnsiChar('噢,NO!'), PAnsiChar('Test'), 0);
end.