Docs.rs
  • rust-strings-0.6.0
    • rust-strings 0.6.0
    • Permalink
    • Docs.rs crate page
    • MIT
    • Links
    • Homepage
    • Repository
    • crates.io
    • Source
    • Owners
    • iddohau
    • Dependencies
      • clap ^4.4.18 normal optional
      • pyo3 ^0.20.2 normal optional
      • tempfile ^3.9 dev
    • Versions
    • 13.64% of the crate is documented
  • Platform
    • i686-pc-windows-msvc
    • i686-unknown-linux-gnu
    • x86_64-apple-darwin
    • x86_64-pc-windows-msvc
    • x86_64-unknown-linux-gnu
  • Feature flags
  • docs.rs
    • About docs.rs
    • Badges
    • Builds
    • Metadata
    • Shorthand URLs
    • Download
    • Rustdoc JSON
    • Build queue
    • Privacy policy
  • Rust
    • Rust website
    • The Book
    • Standard Library API Reference
    • Rust by Example
    • The Cargo Guide
    • Clippy Documentation

Crate rust_strings

rust_strings0.6.0

  • All Items

Sections

  • Rust Strings
    • Examples:

Crate Items

  • Structs
  • Enums
  • Traits
  • Functions

Crates

  • rust_strings

Crate rust_strings

Source
Expand description

§Rust Strings

rust-strings is a library to extract ascii strings from binary data. It is similar to the command strings.

§Examples:

use rust_strings::{FileConfig, BytesConfig, strings, dump_strings, Encoding};
use std::path::{Path, PathBuf};

let config = FileConfig::new(Path::new("/bin/ls")).with_min_length(5);
let extracted_strings = strings(&config);

// Extract utf16le strings
let config = FileConfig::new(Path::new("C:\\Windows\\notepad.exe"))
    .with_min_length(15)
    .with_encoding(Encoding::UTF16LE);
let extracted_strings = strings(&config);

// Extract ascii and utf16le strings
let config = FileConfig::new(Path::new("C:\\Windows\\notepad.exe"))
    .with_min_length(15)
    .with_encoding(Encoding::ASCII)
    .with_encoding(Encoding::UTF16LE);
let extracted_strings = strings(&config);

let config = BytesConfig::new(b"test\x00".to_vec());
let extracted_strings = strings(&config);
assert_eq!(vec![(String::from("test"), 0)], extracted_strings.unwrap());

// Dump strings into `strings.json` file.
let config = BytesConfig::new(b"test\x00".to_vec());
dump_strings(&config, PathBuf::from("strings.json"));

Structs§

BytesConfig
EncodingNotFoundError
FileConfig
StdinConfig

Enums§

Encoding

Traits§

Config

Functions§

dump_strings
Dump strings from binary data to json file.
strings
Extract strings from binary data.

Results

Settings
Help

Query parser error: "Unexpected - (did you mean ->?)".