C++恶搞病毒!!!!附下载连接和代码!

源码和程序

提取码:1145

程序运行后会迅速在C盘创建一个叫做V.txt文件,写入一段话,等你准备翻译的时候程序打开5次cmd又迅速全部关闭,再来一遍刚刚的操作,玩笑程序,可能被杀毒软件拦截。

注意,此软件要以管理员身份运行,在我打包好的程序中已经有管理员权限,但是你们自己复制代码运行后exe文件要提权哦。

#include<windows.h>
#include<conio.h>
#include<fstream>
#include<iostream>
#include<filesystem>
#include<tlhelp32.h>
#include<tchar.h>
using namespace std;
int CreateFiles() {
	string filePath = "C:\\V.txt";
	filesystem::path pathObj(filePath);
	if (!filesystem::exists(pathObj.parent_path())) {
		if (!filesystem::create_directories(pathObj.parent_path())) {
			cerr << "Failed to create directory." << endl;
			return -1;
		}
	}
	if (filesystem::exists(filePath)) {
		if (!filesystem::remove(filePath)) {
			cerr << "Failed to remove existing file." << endl;
			return -1;
		}
	}
	ofstream outfile(filePath);
	if (outfile.is_open()) {
		outfile << "Congratulations, your computer has a virus. I hope it is well." << endl;
		outfile.close();
		cout << "File created successfully." << endl;
	} else {
		cerr << "Failed to create file." << endl;
		return -1;
	}
	
	return 0;
}
int main(){
	CreateFiles();
	system("start C:\\V.txt");
	Sleep(1000);
	for(int i=0;i<=5;i++)system("start cmd");
	Sleep(100);
	system("TASKKILL /F /IM cmd.exe /T");
	Sleep(2000);
	for(int i=0;i<=5;i++)system("start cmd");
	Sleep(100);
	system("TASKKILL /F /IM cmd.exe /T");
	system("pause");
	return 0;
}

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值