VC 瞬间关机(使用RtlAdjustPrivilege和ZwShutdownSystem)
#include const unsigned int SE_SHUTDOWN_PRIVILEGE = 0x13; int main() { HMODULE hDll = ::LoadLibrary("ntdll.dll"); typedef int (* type_RtlAdjustPrivilege)(int, bool, bool, int*); typedef int (* type_ZwShutdownSystem)(int); type_RtlAdjustPrivilege RtlAdjustPrivilege = (type_RtlAdjustPrivilege)GetProcAddress(hDll, "RtlAdjustPrivilege"); type_ZwShutdownSystem ZwShutdownSystem = (type_ZwShutdownSystem)GetProcAddress(hDll, "ZwShutdownSystem"); int nEn = 0; int nResult = RtlAdjus tPrivilege(SE_SHUTDOWN_PRIVILEGE, true, true, &nEn); if(nResult == 0x0c000007c) { nResult = RtlAdjustPrivilege(SE_SHUTDOWN_PRIVILEGE, true, false, &nEn); } nResult = ZwShutdownSystem(2); FreeLibrary(hDll); return 0; }
文件列表
SuperDown.rar
(预估有个2文件)
SuperShutDown.cpp
808B
SuperDown.exe
36KB
用户评论