Trait armorlib::preprocessor::Preprocessor
[−]
[src]
pub trait Preprocessor { fn process(&self, binary_object: &BinaryObject) -> HashMap<String, String>; fn info(&self) -> (&'static str, &'static str); fn name(&self) -> &'static str { ... } fn description(&self) -> &'static str { ... } }
A trait that defines the necessary functions of a Preprocessor
. A Preprocessor
is a
modular component that has no dependencies on other preprocessors. It creates a HashMap
of String
s mapped to other String
s that can then be accessed by the scan modules.
For more information on how to contribute your own preprocessor, see
docs/contributing/PREPROCESSORS.md
.
Required Methods
fn process(&self, binary_object: &BinaryObject) -> HashMap<String, String>
Process the given BinaryObject
and return a HashMap of String
s.
fn info(&self) -> (&'static str, &'static str)
Returns a tuple of the name and description of the preprocessor. It is important that the first item of the tuple, the name, does not change once a preprocessor has been added to the master ArmorLib codebase, as the name is what scan modules rely on to ensure that the preprocessor's data is in scope. The name should be in snake case.
Provided Methods
fn name(&self) -> &'static str
Returns a &'static str
of the name of the preprocessor. This is the name that the
scan modules will rely on to ensure that the preprocessor's data is available, so it
is important that this information does not change.
fn description(&self) -> &'static str
Returns a &'static str
of the description of the preprocessor.
Implementors
impl Preprocessor for FiletypePrepreprocessor
impl Preprocessor for TextPreprocessor
impl Preprocessor for HexPreprocessor
impl Preprocessor for HashPreprocessor