NOD32病毒库自动更新代码

发布时间:2025-12-09 17:01:52 浏览次数:4

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

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

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

以下是简单的代码:

  • // download.cpp : 定义控制台应用程序的入口点。
  • //code By:Neeao
  • //http://Neeao.com
  •  
  • #include "stdafx.h"
  • #include <windows.h>
  • #include <urlmon.h>
  •  
  •  
  • #pragma comment(lib, "urlmon.lib")
  •  
  •  
  • int_tmain(intargc, _TCHAR* argv[]) 
  • {    
  •  
  •     HRESULThr=URLDownloadToFile(NULL,"http://down1.eset.com.cn/eset/offlinev2.rar","d://offlinev2.rar",0,NULL); 
  •      
  •     SHELLEXECUTEINFO ShExecInfo = {0};  
  •     ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);  
  •     ShExecInfo.fMask = SEE_MASK_NOCLOSEPROCESS;  
  •     ShExecInfo.hwnd = NULL;  
  •     ShExecInfo.lpVerb = NULL;  
  •     ShExecInfo.lpFile = "C://Program Files//WinRAR//RAR.exe"; //调用rar
  •     ShExecInfo.lpParameters = "e d://offlinev2.rar -o+ D://offlinev2//"; //执行的命令
  •     ShExecInfo.lpDirectory = NULL;  
  •     ShExecInfo.nShow = SW_SHOW;  
  •     ShExecInfo.hInstApp = NULL;  
  •     ShellExecuteEx(&ShExecInfo);  
  •     WaitForSingleObject(ShExecInfo.hProcess,INFINITE);//等解压缩完毕继续往下执行
  •      
  •     return0; 
  • }
  • 摘自:http://neeao.com/archives/19/
  • 需要做网站?需要网络推广?欢迎咨询客户经理 13272073477