ClamWin Free Antivirus Forum Index
ClamWin Free Antivirus
Support and Discussion Forums
Reply to topic
SDK
jlassi


Joined: 25 Feb 2008
Posts: 0
Reply with quote
Dear all,
I am preparing now my graduation prject consisting in customising an open source antivirus and include it in a CRM application,
after many searchs, I have choosen to work with clamwin, I have seen that clamwin is offering an open SDK that can be integrated with other development languages (Pls correct me if I am wrong), but I couldn't find a trace of this SDK or how it could be implemented, Could you pls guide me in this issue and tell me more details about that,
thanks in advance for your kind help,
View user's profileSend private message
GuitarBob


Joined: 09 Jul 2006
Posts: 9
Location: USA
Reply with quote
Here is a link to a commercial product ($29) that claims to be a ClamWin SDK at http://www.softpedia.com/get/Programming/SDK-DDK/Metadefender-ClamWin-SDK.shtml on the Web. However, I'll bet one of the ClamWin developers could point you in the right direction for free. Sherpya has some stuff that might help. Until you hear from him, you might check out the following: http://oss.netfarm.it/ on the Web and http://oss.netfarm.it/winpe/ on the Web.

Good luck with your project, and make your results available to the ClamWin team.

Regards,
View user's profileSend private message
Re: SDK
b0ne


Joined: 26 Oct 2006
Posts: 0
Reply with quote
jlassi wrote:
I have seen that clamwin is offering an open SDK that can be integrated with other development languages


ClamWin itself doesn't offer the SDK, but ClamAV does. The library "libclamav" is the core. It is actually very easy. All the files you need are in one of the archive files for "clamav-win32-0.92" which can be found, thanks to the many efforts of sherpya, at http://oss.netfarm.it/clamav.

The clamav API documentation is found here: http://www.clamav.net/doc/latest/html/node29.html
Quote:
LibClamAV -- Libclamav provides an easy and effective way to add a virus protection into your software. The library is thread-safe and transparently recognizes and scans within archives, mail files, MS Office document files, executables and other special formats.


The eicar test file will tell you if you have your code working, it can be found at: http://www.eicar.org/download/eicar.com

Here is some example code that I cooked up in about 10 minutes. It loads the signature databases, builds the engine, and scans a file: http://rafb.net/p/LJqYod70.html
Code:
#include <stdio>
#include <stdlib>
#include <assert>
#include "clamav.h"

int main(int argc, char *argv[])
{
   char *database_path = argv[1];
   char *scan_file = argv[2];
   struct cl_engine *clam_engine = NULL;
   unsigned int signature_count;
   int return_value;
   char *virus_name;
   unsigned long bytes_scanned;
   struct cl_limits engine_limits;
   
   if (cl_load(database_path, &clam_engine, &signature_count, CL_DB_STDOPT) != 0)
   {
      fprintf(stderr, "ERROR loading database from path %s\n", database_path);
      return EXIT_FAILURE;
   }

   if (cl_build(clam_engine) != 0)
   {
      fprintf(stderr, "ERROR building databases from path %s\n", database_path);
      cl_free(clam_engine);
      return EXIT_FAILURE;
   }
   
   engine_limits.maxreclevel = 10; /* maximum of 10 nested archives */
   engine_limits.maxfiles = 10; /* 10 files inside of an archive */
   engine_limits.maxratio = 100; /* 100% compression ratio */
   engine_limits.maxfilesize = 1048576; /* 1mb */
   engine_limits.archivememlim = 10485760; /* 10mb */
   
   return_value = cl_scanfile(scan_file, &virus_name, &bytes_scanned,
      clam_engine, &engine_limits, CL_SCAN_PE);
      
   if (return_value == CL_VIRUS)
      printf("DETECTED: %s\nFILE: %s\n", virus_name, scan_file);
   else
      printf("CLEAN: %s", scan_file);

   cl_free(clam_engine);
   return EXIT_SUCCESS;
}


C:\clam_tmp>cl /O2 clamav_example.c libclamav.lib
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.21022.08 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.

clamav_example.c
Microsoft (R) Incremental Linker Version 9.00.21022.08
Copyright (C) Microsoft Corporation. All rights reserved.

/out:clamav_example.exe
clamav_example.obj
libclamav.lib

C:\clam_tmp>clamav_example.exe c:\clam_tmp eicar.com
DETECTED: Eicar-Test-Signature
FILE: eicar.com

C:\clam_tmp>dir /b /oe
clamav_example.c
eicar.com
main.cvd
daily.cvd
libclamunrar_iface.dll
libclamav.dll
libclamunrar.dll
pthreadVC2.dll
clamav_example.exe
clamav.h
libclamav.lib
clamav_example.obj
View user's profileSend private message
budtse


Joined: 14 Jan 2006
Posts: 0
Location: Belgium
Reply with quote
b0ne had some spare time today Wink.

Jlassi,

If you have any more questions, you can ask them here and we will try to help. If you develop anything that might be usefull to others, please consider to add it to the project (keep in mind that any software linked to libclamav falls under the terms of the GPL).

success !
budtse
View user's profileSend private message
sherpya


Joined: 22 Mar 2006
Posts: 0
Location: Italy
Reply with quote
clamwin SDK (now called clamav SDK) on metadefender site is an abuse of GPL, they sell a commercial proprietary stuff that use clamav binaries in a non legal way, unfortunately last times there are a lot of lamers around that illegaly use clamav stuff Sad
ClamAV and ClamWin are free software and freely availables without charge
View user's profileSend private message
GuitarBob


Joined: 09 Jul 2006
Posts: 9
Location: USA
Reply with quote
What can be done about Metadefender selling the SDK then? Does ClamAV know about it?

Regards,
View user's profileSend private message
b0ne


Joined: 26 Oct 2006
Posts: 0
Reply with quote
http://gpl-violations.org/faq/violation-faq.html

I'm not sure if they would do anything, but it might be a start. SourceFire might also be interested in such activities.
View user's profileSend private message
GuitarBob


Joined: 09 Jul 2006
Posts: 9
Location: USA
Reply with quote
Well, I told aCaB about it, so maybe they will look into it.

Regards,
View user's profileSend private message
SDK
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic