yara-rust

Build Status Crates.io Documentation

Bindings for the Yara library from VirusTotal.

More documentation can be found on the Yara's documentation.

Example

The implementation is inspired from yara-python.

```rust const RULES: &str = r#" rule contains_rust { strings: $rust = "rust" nocase condition: $rust "#;

fn main() { let compiler = Compiler::new().unwrap(); compiler.addrulesstr(RULES) .expect("Should have parsed rule"); let rules = compiler.compilerules() .expect("Should have compiled rules"); let results = rules.scanmem("I love Rust!".asbytes(), 5) .expect("Should have scanned"); assert!(results.iter().any(|r| r.identifier == "containsrust")); } ```

Features

Feature flags and Yara linking.

Look at the yara-sys crate documentation for a list of feature flags and how to link to your Yara crate.

TODO

License

Licensed under either of

at your option.