Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
marirs committed Oct 26, 2024
1 parent 7e9af2f commit 63aa6f6
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 16 deletions.
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "capa"
version = "0.3.17"
version = "0.3.18"
description = "File capability extractor."
authors = ["Marirs <[email protected]>", "Andrey Mnatsakanov <[email protected]>", "Jorge Alejandro Durán Royo<[email protected]>"]
keywords = ["capa", "fce", "capability", "aslr", "reverse"]
Expand All @@ -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"

Expand Down
2 changes: 2 additions & 0 deletions src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub enum Os {
FENIXOS,
CLOUD,
UNDEFINED,
ARCH_SPECIFIC,

Check warning on line 44 in src/consts.rs

View workflow job for this annotation

GitHub Actions / Test Rust stable on windows-latest

variant `ARCH_SPECIFIC` should have an upper camel case name

Check warning on line 44 in src/consts.rs

View workflow job for this annotation

GitHub Actions / Test Rust stable on macos-latest

variant `ARCH_SPECIFIC` should have an upper camel case name

Check warning on line 44 in src/consts.rs

View workflow job for this annotation

GitHub Actions / Test Rust stable on ubuntu-latest

variant `ARCH_SPECIFIC` should have an upper camel case name
}

impl Display for Os {
Expand All @@ -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"),
}
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/extractor/smda.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ impl Extractor {
}

pub fn get_elf_os(elf: &goblin::elf::Elf) -> Result<Os> {
eprintln!("{}", elf.header.e_ident[7]);
match elf.header.e_ident[7] {
0x00 => Ok(Os::UNDEFINED),
0x01 => Ok(Os::HPUX),
Expand All @@ -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<Os> {
Expand Down
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T> = std::result::Result<T, Error>;
Expand Down Expand Up @@ -245,7 +245,7 @@ impl FileCapabilities {
fn new(
#[cfg(feature = "properties")] extractor: &Box<dyn extractor::Extractor>,
) -> Result<FileCapabilities> {
Ok(FileCapabilities {
let ss = FileCapabilities {
#[cfg(feature = "properties")]
properties: Properties {
format: FileCapabilities::get_format(extractor)?,
Expand All @@ -264,7 +264,8 @@ impl FileCapabilities {
security_checks: BTreeSet::new(),
map_features: HashMap::new(),
capabilities_associations: BTreeMap::new(),
})
};
Ok(ss)
}

fn update_capabilities(
Expand Down

0 comments on commit 63aa6f6

Please sign in to comment.