Skip to main content

binsec/check/
mod.rs

1pub mod elf;
2pub mod mach;
3pub mod pe;
4
5use crate::BinResult;
6
7// represents map used to store tabulated results
8pub type GenericMap = std::collections::BTreeMap<String, serde_json::Value>;
9
10/// Compilation properties we assess on every binary format we support.
11pub trait UniversalCompilationProperties {
12    fn binary_type(&self) -> &str;
13    fn is_stripped(&self) -> bool;
14    //fn is_cxx(&self) -> bool;
15    fn compiler_runtime(&self, bytes: &[u8]) -> Option<String>;
16}
17
18/// Defines trait implemented by each supported libgoblin binary format
19pub trait Analyze {
20    fn compilation(&self, bytes: &[u8]) -> BinResult<GenericMap>;
21    fn mitigations(&self) -> GenericMap;
22    fn instrumentation(&self) -> GenericMap;
23}