此病毒利用U盘传播,破坏word文档,比较讨厌,但做的实在是比较垃圾,写了个小程序清理它...希望对大家编程有帮助
//Orgnization:CQU Crazy Guys
//Blog:http://blog.donews.com/sguy
//Author:Sguy
//E-mail:sguy_xfocus@163.com
#include <windows.h>
#include <iostream>
#include <fstream>
#include <tlhelp32.h>
using namespace std;
#pragma comment (lib,"kernel32.lib")
const char *KillWin="winword.exe";
void Usage();
void KillWinwordExe();
void KillWinWordProcess(const char *KillWin);
void main()
{
Usage();
KillWinWordProcess(KillWin);
cout<<"***************** Winword Process is Terminated *********************"<<endl;
KillWinwordExe();
}
void KillWinWordProcess(const char *KillWin)
{
HANDLE hWin;
PROCESSENTRY32 process;
process.dwSize = sizeof(PROCESSENTRY32);
void* photo = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
Process32First(photo, &process);
while(photo != NULL)
{
Process32Next(photo, &process);
hWin = OpenProcess(PROCESS_TERMINATE, false, process.th32ProcessID);
if(!strcmp(process.szExeFile, KillWin))
{
TerminateProcess(hWin, 0);
CloseHandle(hWin);
break;
}
if(GetLastError() == ERROR_NO_MORE_FILES)
{
break;
}
CloseHandle(hWin);
}
}
void KillWinwordExe()
{
char SysPath[MAX_PATH];
char szTemp[MAX_PATH];
GetSystemDirectory(SysPath, sizeof(SysPath));
strcat(SysPath,"\\winword.exe");
ofstream outfile("C:\\tmp.bat",ios_base::app);
if(!outfile)
cout<<"Error!"<<endl;
else
{
outfile<<"@echo off"<<endl;
outfile<<":KillWin"<<endl;
outfile<<"attrib -a -r -s -h "<<SysPath<<endl;
outfile<<"del "<<SysPath<<endl;
for(int i=0;i<26;++i)
{
wsprintf(szTemp,"%c:\\",'A'+i);
outfile<<"del "<<szTemp<<"kangen.exe"<<endl;
}
outfile<<"if exist "<<SysPath<<" goto KillWin"<<endl;
outfile<<"del %0"<<endl;
}
outfile.close();
cout<<"***************** All kangen related files killed *********************"<<endl;
ShellExecute(NULL, "open", "c:\\tmp.bat", NULL, NULL, SW_HIDE);
}
void Usage()
{
cout<<"////////////////////////////////////////////////////////////////////////////////"<<endl;
cout<<"*********************************Author:Sguy************************************"<<endl;
cout<<"***************** Application is running *********************"<<endl;
cout<<"////////////////////////////////////////////////////////////////////////////////"<<endl;
MessageBox ( NULL,"保存、关闭您当前打开的word文档,然后点确定", "Warning", MB_OK );
}