資源簡介
C++ 編寫的殺毒軟件,可自定義特征,有中文注解

代碼片段和文件信息
//?BAV.cpp?:?Defines?the?entry?point?for?the?console?application.
//
#include?“stdafx.h“
#include?“VirusDB.h“
#include?“Scanobject.h“
#include?“VirusInfo.h“
#include?“Engine.h“
int?_tmain(int?argc?_TCHAR*?argv[])
{
//////////////////////////////////////////////////////////////////////////
//
//?參數檢查
//
if(argc<2)
{
printf(“Not?enough?parameter!\nBAV?[drive:]path\n“);
return?-1;
}
//////////////////////////////////////////////////////////////////////////
//
//?病毒庫裝載,先不從文件裝載,后面版本增加。
//
CVirusDB?cVDB;
if(?!cVDB.Load(NULL)?)
return?-2;
//////////////////////////////////////////////////////////////////////////
//
//?掃描
//
CEngine cBavEngine;
PSCAN_RESULTS?pScanResults?=?NULL;
if(?cBavEngine.Load(&cVDB)?)
{
SCAN_PARAM stScanParam;
stScanParam.nSize =?sizeof(SCAN_PARAM);
stScanParam.strPathName =?argv[1]; //?TODO:?Add?path?verify?here
stScanParam.eAction =?BA_SCAN;
pScanResults?=?cBavEngine.Scan(&stScanParam);
}
//////////////////////////////////////////////////////////////////////////
//
//?show?results
//
if(pScanResults)
{
CVirusInfo cVInfo;
printf(“\n----------------------?Done?----------------------\n“);
printf(“Total?%d?file(s)?%d?virus(es)?detected.\n\n“?pScanResults->dwObjCount?pScanResults->dwRecCount);
printf(“Total?%d?milliseconds?%d?ms/file.\n“?pScanResults->dwTime?pScanResults->dwTime/pScanResults->dwObjCount);
PSCAN_RECORD?pScanRecord?=?pScanResults->pScanRecords;
while(?pScanRecord?)
{
printf(“\“%s\“?infected?by?\“%s\“?virus.\n“?pScanRecord->pScanobject->GetobjectName()?cVInfo.GetNameByID(pScanRecord->dwVirusID));
pScanRecord?=?pScanRecord->pNext;
}
}
//////////////////////////////////////////////////////////////////////////
//?
//?clean?up
//
cBavEngine.Release();
cVDB.Unload();
return?0;
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件???????1955??2005-07-09?23:51??BAV\BAV.cpp
?????文件??????16384??2005-07-14?00:01??BAV\BAV.proj
?????文件????????895??2005-07-04?14:38??BAV\BAV.sln
?????文件???????4691??2005-07-12?00:52??BAV\BAV.vcproj
?????目錄??????????0??2005-08-21?03:52??BAV\Debug
?????文件???????3640??2005-08-21?02:20??BAV\define.h
?????文件???????3046??2005-07-13?23:56??BAV\Engine.cpp
?????文件????????769??2005-07-11?23:17??BAV\Engine.h
?????文件???????2524??2005-08-21?00:00??BAV\Fileob
?????文件????????711??2005-08-20?23:44??BAV\Fileob
?????文件???????2371??2005-08-20?23:58??BAV\MemFileob
?????文件????????585??2005-08-20?23:45??BAV\MemFileob
?????文件???????3663??2005-08-21?03:51??BAV\ParsePE.cpp
?????文件????????245??2005-08-20?16:28??BAV\ParsePE.h
?????文件???????1585??2005-08-21?03:38??BAV\ReadMe.txt
?????文件????????196??2005-08-20?15:35??BAV\Scanob
?????文件????????685??2005-08-20?23:45??BAV\Scanob
?????文件????????290??2005-07-04?14:38??BAV\stdafx.cpp
?????文件????????457??2005-07-07?15:00??BAV\stdafx.h
?????文件???????8679??2005-08-21?03:00??BAV\VirusDB.cpp
?????文件????????452??2005-08-20?14:04??BAV\VirusDB.h
?????文件????????478??2005-08-21?01:23??BAV\VirusInfo.cpp
?????文件????????129??2005-07-09?16:03??BAV\VirusInfo.h
?????目錄??????????0??2005-08-21?03:51??BAV
-----------?---------??----------?-----??----
????????????????54648????????????????????25
- 上一篇:基于C語言的AT指令代碼實現
- 下一篇:C++本科作業--模擬動物園
評論
共有 條評論