使用 int2e 關機(感覺很牛逼,分享一下)
阿新 • • 發佈:2019-01-21
原文地址:http://download.csdn.net/download/bing1564/980029
#include"windows.h"
extern "C" __declspec(dllexport) void ShutdownWindow(void)
{
const int SE_SHUTDOWN_PRIVILEGE=0x13;
typedef int (*RtlAdjustPrivilege)(int,bool, bool,int*);
int en = 0;
HMODULE module = LoadLibrary("ntdll.dll");
RtlAdjustPrivilege rtl = (RtlAdjustPrivilege)GetProcAddress(module, "RtlAdjustPrivilege");
int nRet=rtl(SE_SHUTDOWN_PRIVILEGE,TRUE,TRUE,&en);
if(nRet==0x0C000007C)
nRet = rtl(SE_SHUTDOWN_PRIVILEGE,TRUE,FALSE,&en);
}
void main()
{
ShutdownWindow();// 取得許可權
_asm//XP系統
{
push 2
mov eax,0xf9
mov edx,esp
int 0x2e
add esp,4
}
_asm//2000系統
{
push 2
mov eax,0xd9
mov edx,esp
int 0x2e
add esp,4
}
}