现在的位置: 首页 > 综合 > 正文

NOD32病毒库自动更新代码

2014年01月08日 ⁄ 综合 ⁄ 共 1162字 ⁄ 字号 评论关闭

偶算是nod32
的铁杆粉丝了,一直用这个东东,最近nod32
封杀了不少国内的发布免费ID的站点,使IP查找起来比较麻烦了,索性就用官方发布的离线升级包弄个更新服务器,自己用。

官方离线升级包下载地址是:http://www.eset.com.cn/html/download/offline.shtml

vc
写了段代码,自动下载更新包并解压至指定目录,然后指定更新目录为那个目录就好了,建一个计划任务,每天更新一次就实现自动
更新了。

以下是简单的代码:

  1. // download.cpp : 定义控制台应用程序的入口点。  
  2. //code By:Neeao  
  3. //http://Neeao.com  
  4.  
  5. #include "stdafx.h"  
  6. #include <windows.h>  
  7. #include <urlmon.h>  
  8.  
  9.  
  10. #pragma comment(lib, "urlmon.lib")  
  11.  
  12.  
  13. int  _tmain( int  argc, _TCHAR* argv[]) 
  14. {    
  15.  
  16.     HRESULT  hr=URLDownloadToFile(NULL, "http://down1.eset.com.cn/eset/offlinev2.rar" , "d://offlinev2.rar" ,0,NULL); 
  17.      
  18.     SHELLEXECUTEINFO ShExecInfo = {0};  
  19.     ShExecInfo.cbSize = sizeof (SHELLEXECUTEINFO);  
  20.     ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;  
  21.     ShExecInfo.hwnd = NULL;  
  22.     ShExecInfo.lpVerb = NULL;  
  23.     ShExecInfo.lpFile = "C://Program Files//WinRAR//RAR.exe" //调用rar  
  24.     ShExecInfo.lpParameters = "e d://offlinev2.rar -o+ D://offlinev2//" //执行的命令  
  25.     ShExecInfo.lpDirectory = NULL;  
  26.     ShExecInfo.nShow = SW_SHOW;  
  27.     ShExecInfo.hInstApp = NULL;  
  28.     ShellExecuteEx(&ShExecInfo);  
  29.     WaitForSingleObject(ShExecInfo.hProcess,INFINITE);//等解压缩完毕继续往下执行  
  30.      
  31.     return  0; 
  32. }
  33. 摘自:http://neeao.com/archives/19/

抱歉!评论已关闭.