diff --git a/Cargo.toml b/Cargo.toml index e58bdfb..1617070 100755 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "capa" -version = "0.3.17" +version = "0.3.18" description = "File capability extractor." authors = ["Marirs ", "Andrey Mnatsakanov ", "Jorge Alejandro DurĂ¡n Royo"] keywords = ["capa", "fce", "capability", "aslr", "reverse"] @@ -13,30 +13,30 @@ edition = "2021" [dependencies] hex = "0.4.3" -itertools = "0.12.1" +itertools = "0.13.0" pdb = "0.8.0" petgraph = "0.6.2" regex = "1.5" fancy-regex = { git = "https://github.com/mnaza/fancy-regex.git" } serde = { version = "1", features = ["derive"] } -smda = "0.2.8" +smda = { git = "https://github.com/marirs/smda-rs.git" } thiserror = "1" walkdir = "2.3.2" yaml-rust = "0.4.5" -goblin = { version = "0.8.0", features = ["alloc"] } +goblin = { version = "0.9.1", features = ["alloc"] } maplit = "1" dnfile = { git = "https://github.com/marirs/dnfile-rs.git", branch = "master" } -lazy_static = "1.4.0" -parking_lot = "0.12.1" -serde_json = "1.0.113" -memoffset = "0.9.0" -memmap2 = "0.9.4" +lazy_static = "1" +parking_lot = "0.12.3" +serde_json = "1" +memoffset = "0.9.1" +memmap2 = "0.9.5" scroll = "0.12.0" -once_cell = "1.19.0" -dynamic-loader-cache = "0.1" +once_cell = "1.20" +dynamic-loader-cache = "0.2" [dev-dependencies] -clap = { version = "4.0.27", features = ["cargo", "derive"] } +clap = { version = "4.5", features = ["cargo", "derive"] } prettytable-rs = "0.10.0" diff --git a/src/consts.rs b/src/consts.rs index 3c11a01..f1618aa 100644 --- a/src/consts.rs +++ b/src/consts.rs @@ -41,6 +41,7 @@ pub enum Os { FENIXOS, CLOUD, UNDEFINED, + ARCH_SPECIFIC, } impl Display for Os { @@ -65,6 +66,7 @@ impl Display for Os { Os::FENIXOS => write!(f, "FenixOS"), Os::CLOUD => write!(f, "Cloud"), Os::UNDEFINED => write!(f, "undefined"), + Os::ARCH_SPECIFIC => write!(f, "Architecture-specific"), } } } diff --git a/src/extractor/smda.rs b/src/extractor/smda.rs index 3ae4854..6d32792 100644 --- a/src/extractor/smda.rs +++ b/src/extractor/smda.rs @@ -264,6 +264,7 @@ impl Extractor { } pub fn get_elf_os(elf: &goblin::elf::Elf) -> Result { + eprintln!("{}", elf.header.e_ident[7]); match elf.header.e_ident[7] { 0x00 => Ok(Os::UNDEFINED), 0x01 => Ok(Os::HPUX), @@ -282,7 +283,7 @@ impl Extractor { 0x0F => Ok(Os::AROS), 0x10 => Ok(Os::FENIXOS), 0x11 => Ok(Os::CLOUD), - _ => Err(Error::UnsupportedOsError), + _ => Ok(Os::ARCH_SPECIFIC), } } pub fn extract_os(&self) -> Result { diff --git a/src/lib.rs b/src/lib.rs index 366435a..eac1fff 100755 --- a/src/lib.rs +++ b/src/lib.rs @@ -24,7 +24,7 @@ pub(crate) mod consts; mod error; mod extractor; pub mod rules; -mod security; +pub mod security; mod sede; pub type Result = std::result::Result; @@ -245,7 +245,7 @@ impl FileCapabilities { fn new( #[cfg(feature = "properties")] extractor: &Box, ) -> Result { - Ok(FileCapabilities { + let ss = FileCapabilities { #[cfg(feature = "properties")] properties: Properties { format: FileCapabilities::get_format(extractor)?, @@ -264,7 +264,8 @@ impl FileCapabilities { security_checks: BTreeSet::new(), map_features: HashMap::new(), capabilities_associations: BTreeMap::new(), - }) + }; + Ok(ss) } fn update_capabilities(