能力值:
( LV9,RANK:280 )
|
-
-
2 楼
SetPrivilege(SE_SHUTDOWN_NAME, TRUE); NtRaiseHardError(0xC000021A, 3, 4, args, OptionShutdownSystem, &x);
|
能力值:
( LV2,RANK:10 )
|
-
-
3 楼
感谢抽时间分析,解释了我的疑惑
|
能力值:
( LV2,RANK:10 )
|
-
-
4 楼
//======================================================================
//By TiKEY!
//E-mail:tyk5555@hotmail.com
//QQ:574436201
//======================================================================
#include <Windows.h>
#include "NTHeaders.h"
HINSTANCE hInst; // 当前实例
typedef UINT (CALLBACK* NTRAISEHARDERROR)(NTSTATUS, ULONG, PUNICODE_STRING, PVOID,HARDERROR_RESPONSE_OPTION, PHARDERROR_RESPONSE);
typedef UINT (CALLBACK* RTLADJUSTPRIVILEGE)(ULONG, BOOL, BOOL, PINT);
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd)
{
HINSTANCE hDLL = LoadLibrary(TEXT("ntdll.dll"));
NTRAISEHARDERROR NtRaiseHardError;
RTLADJUSTPRIVILEGE RtlAdjustPrivilege;
int nEn = 0;
HARDERROR_RESPONSE reResponse;
if (hDLL != NULL)
{
NtRaiseHardError = (NTRAISEHARDERROR)GetProcAddress(hDLL, "NtRaiseHardError");
RtlAdjustPrivilege = (RTLADJUSTPRIVILEGE)GetProcAddress(hDLL, "RtlAdjustPrivilege");
if (!NtRaiseHardError)
{
// handle the error
FreeLibrary(hDLL);
return 0;
}
if (!RtlAdjustPrivilege)
{
// handle the error
FreeLibrary(hDLL);
return 0;
}
RtlAdjustPrivilege(0x13, TRUE, FALSE, &nEn);//0x13 = SeShutdownPrivilege
NtRaiseHardError(0xC000021A,0,0,0,OptionShutdownSystem,&reResponse);
}
return 1;
} 补充个网络上搜索的 完整测试代码
最后于 2021-6-11 19:33
被小希希编辑
,原因:
|
|
|