自己写了个蓝屏“病毒”
对电脑无害,用来恶搞不错
今天又更新出了v9版本,带乱更改鼠标位置功能和查找配置文件功能
制作时间:加上之前的:三天
原创代码,禁止转载!
源代码:
#define _CRT_SECURE_NO_WARNINGS
#include<windows.h>
#include <iostream>
#include <stdlib.h>
#include <mmsystem.h>
#include <bits/stdc++.h>
//#include <opencv2/opencv.hpp>
//#pragma comment(lib,"winmm.lib")
#define KEY_DOWN(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
using namespace std;
int x = GetSystemMetrics(SM_CXSCREEN);
int y = GetSystemMetrics(SM_CYSCREEN);
int i=1000;
int main(){
std::ifstream ofs,blue;
ofs.open("music.mp3", std::ios::in | std::ios::binary);
blue.open("bluescreen.exe",std::ios::in | std::ios::binary);
if(ofs.is_open()&&blue.is_open()){
cout<<"成功找到所有配置文件!";
}else{
MessageBox(NULL,"缺少配置文件,无法运行!","错误",MB_ICONERROR|MB_OK);
return 0;
}
int msg;
msg=MessageBox(NULL,TEXT("你好,我是一个病毒,确定要运行吗?"),TEXT("警告"),MB_OKCANCEL|MB_ICONWARNING);
if(msg==2){
return 0;
}else{
msg=MessageBox(NULL,TEXT("运行病毒,电脑废了活该!"),TEXT("再次确认"),MB_OKCANCEL|MB_ICONWARNING);
if(msg==2){
return 0;
}
}
system("cls");
mciSendString(TEXT("open music.mp3 alias b"),NULL,0,NULL);
mciSendString(TEXT("play b"),NULL,0,NULL);
system("color 0c");
char words[1000]={"哈哈哈,你的电脑废了\n系统还有1分钟蓝屏,好好享受最后的一分钟吧"};
for(int i=1;i<64;i++){
cout<<words[i-1];
SetCursorPos(rand() % x, rand() % y);
Sleep(100);
}
//system("color 00");
cout<<"\ntip:不要试图关闭程序,否则电脑立即死亡!";
cout<<"\n蓝屏倒计时:\n60秒";
SetCursorPos(rand() % x, rand() % y);
Sleep(450);
SetCursorPos(rand() % x, rand() % y);
Sleep(450);
for(int i=59;i>-1;i--){
cout<<"\b\b\b\b"<<i<<"秒";
SetCursorPos(rand() % x, rand() % y);
Sleep(450);
SetCursorPos(rand() % x, rand() % y);
Sleep(450);
}
msg=MessageBox(NULL,TEXT("你真的要蓝屏吗?"),TEXT("警告"),MB_OKCANCEL|MB_ICONWARNING);
if(msg==1){
system("cls");
WinExec("bluescreen.exe",SW_SHOWMINIMIZED);
//HWND hwnd=GetForegroundWindow();
//ShowWindow(hwnd,SW_MAXIMIZE);
/*for(int i=0;i<=10;i++){
WinExec("可关闭弹窗.exe",SW_SHOWNORMAL);
}
msg=MessageBox(NULL,TEXT("你真的要关机吗?"),TEXT("最后的警告"),MB_OKCANCEL|MB_ICONWARNING);
if(msg==1){
system("shutdown -s -t 30");
cout<<"最后一次机会,按[f3]撤销关机";
while(1){
if(KEY_DOWN(VK_F3)){
system("shutdown -a");
system("cls");
}
}
}*/
}
//for(int i=0;i<=3;i++){
// HWND hwnd=GetForegroundWindow();
// ShowWindow(hwnd,SW_MINIMIZE);
//}
system("cls");
//cout<<"别急,欣赏完音乐再走!";
while(1){
Sleep(2000);
//cout<<"!";
}
}
注意:本代码是v8版本,更多版本持续更新中……
已编译文件下载:>点这里<