ClamAV is an open source (GPLv2) anti-virus toolkit.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
clamav/win32
Josh Soref 7cd9337a70 Spelling Adjustments (#30) 7 years ago
..
3rdparty Spelling Adjustments (#30) 7 years ago
Setup-x64 updating win32 proj files. 7 years ago
Setup-x86 updating win32 proj files. 7 years ago
clamav-for-windows Spelling Adjustments (#30) 7 years ago
compat Spelling Adjustments (#30) 7 years ago
conf_examples setting up insteller project files to create setup.exe that install the missing redistributables. adding sample config files that are targetted towards windows. fixing setup-x86 configuration to actually include 32bit binaries instead of using the 64bit binaries. removing the broken Release-Static configuration. 8 years ago
llvmbuild Spelling Adjustments (#30) 7 years ago
res updating version numbers after reversioning. Updating README, NEWS. 7 years ago
.gitignore updating git commits, sln to fix build, and most importantly adding macro definitions to cltypes in support of Windows. 8 years ago
ClamAV.sln setting up insteller project files to create setup.exe that install the missing redistributables. adding sample config files that are targetted towards windows. fixing setup-x86 configuration to actually include 32bit binaries instead of using the 64bit binaries. removing the broken Release-Static configuration. 8 years ago
LLVMcodegen.vcxproj bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
LLVMcodegen.vcxproj.filters bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
LLVMjit.vcxproj bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
LLVMjit.vcxproj.filters bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
LLVMsystem.vcxproj bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
LLVMsystem.vcxproj.filters bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
LLVMx86codegen.vcxproj bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
LLVMx86codegen.vcxproj.filters bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
README.md Updating win32 readme 8 years ago
UpgradeLog.htm bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
UpgradeLog2.htm bb11378 - updating ClamAV to support VS 2015, patch based on pull request by Keith Jones 9 years ago
clamav-config.h bb11343: Adding configure option to remove yara at compile-time. 10 years ago
clambc.vcxproj Fix spelling mistake 8 years ago
clambc.vcxproj.filters win32: project files updated to vs10; 64bit stuff will be restored soon 15 years ago
clamconf.vcxproj Fix spelling mistake 8 years ago
clamconf.vcxproj.filters win32: project files updated to vs10; 64bit stuff will be restored soon 15 years ago
clamd.vcxproj Fix spelling mistake 8 years ago
clamd.vcxproj.filters bb11062 - adding idmef_logging references to clamd vs2015 proj 9 years ago
clamdscan.vcxproj setting up insteller project files to create setup.exe that install the missing redistributables. adding sample config files that are targetted towards windows. fixing setup-x86 configuration to actually include 32bit binaries instead of using the 64bit binaries. removing the broken Release-Static configuration. 8 years ago
clamdscan.vcxproj.filters Build on Win32 11 years ago
clamscan.vcxproj Fix spelling mistake 8 years ago
clamscan.vcxproj.filters Build on Win32 11 years ago
configure.bat win32: configure.js 16 years ago
configure.js win32: properly handle release versions 14 years ago
freshclam.vcxproj Fix spelling mistake 8 years ago
freshclam.vcxproj.filters Change Windows build to use OpenSSL 1.1.0.c 9 years ago
libclamav.def win32: fixes for sigtool imphash linking 9 years ago
libclamav.vcxproj Fix lib path 8 years ago
libclamav.vcxproj.filters Change Windows build to use OpenSSL 1.1.0.c 9 years ago
libclamavcxx.vcxproj Fix spelling mistake 8 years ago
libclamavcxx.vcxproj.filters Build on Win32 11 years ago
libclamunrar.def win32: add unrar s'port 16 years ago
libclamunrar.vcxproj Fix lib path 8 years ago
libclamunrar.vcxproj.filters win32: project files updated to vs10; 64bit stuff will be restored soon 15 years ago
libclamunrar_iface.def win32: add unrar s'port 16 years ago
libclamunrar_iface.vcxproj Fix lib path 8 years ago
libclamunrar_iface.vcxproj.filters win32: project files updated to vs10; 64bit stuff will be restored soon 15 years ago
mspack.vcxproj moving mspack visual studio project into win32 directory. 8 years ago
mspack.vcxproj.filters moving mspack visual studio project into win32 directory. 8 years ago
openssl.vcxproj Regargeting openssl solution to match the other projects. 8 years ago
openssl.vcxproj.filters adding openssl visual studio project to provide the openssl DLLs to the Setup installer projects. there may be an even cleaner solution but this works. 8 years ago
platform.h bb11250 - Removing deprecated function gethostbyname from Windows. 10 years ago
sigtool.vcxproj Fix spelling mistake 8 years ago
sigtool.vcxproj.filters Change Windows build to use OpenSSL 1.1.0.c 9 years ago
target.h win32 fixes: bb#2152 and bb#2153 15 years ago
update-win32.pl Spelling Adjustments (#30) 7 years ago

README.md

ClamAV for Win32

News

In order to support more advanced features planned in future releases, ClamAV has switched to using OpenSSL for hashing. The ClamAV Visual Studio project included with ClamAV's source code requires the OpenSSL distributables to be placed in a specific directory. This article will teach you how to compile OpenSSL on a Microsoft Windows system and how to link ClamAV against OpenSSL.

Read More here

Starting from version 0.98 the windows version of ClamAV requires all the input to be UTF-8 encoded.

This affects:

  • the API, notably the cl_scanfile() function
  • clamd socket input, e.g. the commands SCAN, CONTSCAN, MUTLISCAN, etc.
  • clamd socket output, i.e replies to the above queries

For legacy reasons ANSI (i.e. CP_ACP) input will still be accepted and processed as before, but with two important remarks: First, socket replies to ANSI queries will still be UTF-8 encoded. Second, ANSI sequences which are also valid UTF-8 sequences will be handled as UTF-8.

As a side note, console output (stdin and stderr) will always be OEM encoded, even when redirected to a file.

Requirements

To build the source code you will need:

  • Git for Windows with a git "shell"
  • Microsoft Visual Studio 2015: the community version is just fine. You will need the Microsoft Visual Studio Installer Projects extension in order to load and build the Setup x86 and Setup x64 projects that build the .msi installers.

To build the installer, you also need:

ClamAV is supported for Windows 7+, but Windows 10 is recommended. Visual Studio 2017 should work fine, but we currently work with Visual Studio 2015.

Getting the code

ClamAV source code is freely available via github at https://github.com/vrtadmin/clamav-devel

To obtain a copy of the code, open a Git Bash terminal. Navigate to a directory where you want to store the code, eg "workspace" and clone the repository using the https web URL. For example:

  1. cd
  2. mkdir workspace
  3. cd workspace
  4. git clone https://github.com/vrtadmin/clamav-devel.git

Step into the win32 directory and open an Explorer window.

  1. cd clamav-devel
  2. cd win32
  3. explorer .

ClamAV for Windows uses the same code base as Unix/Linux based operating systems. However, Windows specific files for building ClamAV are found under the win32 directory.

Code configuration

After downloading the source code, minimal configuration is required:

  1. Run the win32/configure.bat script from within the git shell. Skip this step if you are building from an official release tarball.
  2. Obtain OpenSSL V1.1.0 or higher. You will need the headers, libs, and bins for the platform (Win32 or x64) that you're targeting.
  3. Place the headers and binaries in a directory with the following structure: ├───Win32 │ ├───include │ │ └───openssl <-- openssl headers in here │ └───lib <-- .DLLs and .LIBs in here └───x64 ├───include │ └───openssl <-- openssl headers in here └───lib <-- .DLLs and .LIBs in here
  4. Add an environment variable with the name CLAM_DEPENDENCIES and set the value to the path of the above directory.

Compilation

Open win32/ClamAV.sln in Visual Studio and build all. The output directory for the binaries is either /win32/(Win32|x64)/Debug or /win32/(Win32|x64)/Release depending on the configuration you pick.

Note: at the time of writing Batch Build is broken in Visual Studio. Use MSBuild instead.

Special notes

The ClamAV tools in win32 are the same as in unix, so refer to their respective manpage for general usage. The major differences are listed below:

  • Config files path search order:

    1. The content of the registry key "HKEY_LOCAL_MACHINE/Software/ClamAV/ConfDir"
    2. The directory where libclamav.dll is located
    3. "C:\ClamAV"
  • Database files path search order:

    1. The content of the registry key "HKEY_LOCAL_MACHINE/Software/ClamAV/DataDir"
    2. The directory "database" inside the directory where libclamav.dll is located
    3. "C:\ClamAV\db"
  • Globbing Since the Windows command prompt doesn't take care of wildcard expansion, minimal emulation of unix glob() is performed internally. It supports "*" and "?" only.

  • File paths Please always use the backslash as the path separator. SMB Network shares and UNC paths are supported.

  • Debug builds Malloc in debug (as opposed to release) mode fails after allocating some 90k chunks; such builds won't be able to handle large databases. Just do yourself a favour and always build in release mode.

Special thanks

Special thanks to Gianluigi Tiesi and Mark Pizzolato for their valuable help in coding and testing.