Building Custom Engines

You can develop your own custom engine integration. We provide documentation on how to do this as well as sample code in C & C#.

What you need to do

  1. Install Metadefender Core 3.8.0 or newer.

  2. Download the custom engine template package here. This download includes the following templates:
    • Template for C custom engine (vc10)
    • Template for C# custom engine (vc10)

  3. Obtain Metadefender Core custom engine handler (omsCEHandler.exe). This file is included in the template package's bin folder.

  4. Implement the custom engine interface.

  5. Build the custom engine library (DLL).

  6. Deploy the custom engine library (DLL) with the Metadefender Core custom engine handler (omsCEHandler.exe).

Installation and configuration

This section covers the configuration of Metadefender Core in order to load and use your custom engine. The following properties must be defined and configured in the omsConfig.ini, located in the Metadefender Core installation directory.

Section or attribute

Value

Description

[custom_engine_***]

Replace *** with a unique identifier for your engine. (e.g., [custom_engine_myav] or [custom_engine_mycompany])

A unique section name to group the settings for your custom engine. This section must be unique and begin with “custom_engine”. If you do not name the section appropriately, Metadefender Core will not detect your custom engine.

custom_engine_dir

Absolute path to the directory. Do not end this path with a trailing separator.

e.g., c:\my Custom Engine AV

The directory where your custom engine binaries reside. At a minimum, this includes omsCEHandler.exe and the C interface DLL.

custom_unique_id

4-10 characters starting with “ce” prefix

e.g., ce01

This is used for communication between Metadefender Core and the omsCEHandler processes. If you have multiple custom engines, this must be unique for each engine.

custom_dll_name

Custom engine DLL name

e.g., sampleCustomEng.DLL

The sample custom engine project generates “sampleCustomEng.DLL” by default, but you can modify as you wish.

custom_engine_type

Numerical value

0 – Indicates the engine is a scan engine

 

support_multithread

Numerical Value.

0 – No

1 – Yes

You must set this attribute to 0 if your custom engine is not thread-safe. If you are not sure, set to 0.

Example

The following is an example of the properties that need to be configured for the omsConfig.ini file.

[custom_engine_myav]
custom_engine_dir=c:\my Custom Engine AV
custom_dll_name=sampleCustomEng.dll
custom_engine_type=0
support_multithread=0
custom_unique_id=ce01

When uninstalling or upgrading Metadefender Core

Any configuration pertaining to the custom engines will not be preserved if you uninstall and reinstall Metadefender Core. You must backup and then restore the following changes after your installation or upgrade is complete:

  • omsConfig.ini (changes made pertaining to the custom engines)

  • Any custom engine directories located under the Metadefender Core installation folder