Detectors¶
The Detector
class allows to abstract detection tools, based on the Base
class and adding a special detection method called detect
.
Detector
Class¶
This class is the base for abstracted tools loaded from the detectors.yml
description file. It holds the registry of all the loaded child classes.
Special methods:
check(formats)
: for checking if the detector applies for the input executable formatsdetect(executable_or_folder_or_dataset)
: for detecting the packer used on an input executable, folder of executables orDataset
structuretest(executable_or_folder_or_dataset)
: for testing the detector(s) on an input executable, folder of executables orDataset
structure
Using as a class or an instance
The behavior of the detection method is different depending on the object it is called from. If calling it from:
- The
Detector
class: all the available detectors inDetector.registry
with the attributevote=True
are used and the label is determined based on a decision heuristic. - A
Detector
instance: the particular detector (e.g.DIE
) inheritingDetector
is used.
Multiple valid input types
These functions are decorated with a special function that allows to input either a single executable, a folder of executables or a dataset containing a "files
" folder with executables.