clamav获取病毒库版本号

sigtool查看病毒库信息

sigtool -i 病毒库名称

[root@localhost Desktop]# sigtool -i main.cvd 
File: main.cvd
Build time: 07 Jun 2017 17:38 -0400
Version: 58
Signatures: 4566249
Functionality level: 60
Builder: sigmgr
MD5: 57462fd73f1cfdb356b9dca66da2b732
Digital signature: KWRdhTG+Own6ohh0wn5+vqg1d8ULKCxxxQeKuSA155B3ijxBKgf+bV3IXPcmZrIBUDn1xi8FmyvB63UieykwN/Avq5mTjHIVO8zFnC7wVF7dhdcEYn9Nt+Pmk/HXXx0voylYkidvgZmrxI8jx4a/Re6n3hHQJoCZrkHM15GER8j
Verification OK.

 

代码获取病毒库版本号

int ret;
if((ret = cl_init(CL_INIT_DEFAULT)) != CL_SUCCESS) {
	return;
}

string cvdname = "daily.cvd";
struct cl_cvd *cvd;
if((cvd =cl_cvdhead(cvdname.c_str())) == NULL){
	printf("Can't read/parse CVD header info\n");
}else{
	printf("Build time:%s\n", cvd->time);
	printf("Version:%u\n", cvd->version);
	cl_cvdfree(cvd;
}

 

你可能感兴趣的:(C++)