### Install rust-strings in Python Source: https://github.com/iddohau/rust-strings/blob/main/README.md Installs the rust-strings library using pip for Python projects. ```bash pip install rust-strings ``` -------------------------------- ### Add rust-strings to Rust project Source: https://github.com/iddohau/rust-strings/blob/main/README.md Adds the rust-strings library as a dependency to a Rust project using Cargo. ```toml [dependencies] rust-strings = "0.6.0" ``` -------------------------------- ### Dump strings to file in Rust Source: https://github.com/iddohau/rust-strings/blob/main/README.md Dumps extracted strings from a byte array to a specified file path using Rust's dump_strings function. ```rust use rust_strings::BytesConfig; use std::path::PathBuf; let config = BytesConfig::new(b"test\x00".to_vec()); dump_strings(&config, PathBuf::from("strings.json")); ``` -------------------------------- ### Extract strings from file with Rust config Source: https://github.com/iddohau/rust-strings/blob/main/README.md Extracts strings from a file using Rust's FileConfig, allowing configuration of minimum length and encoding. ```rust use rust_strings::{FileConfig, strings}; use std::path::Path; let config = FileConfig::new(Path::new("/bin/ls")).with_min_length(5); let extracted_strings = strings(&config); ``` -------------------------------- ### Dump strings to JSON file in Python Source: https://github.com/iddohau/rust-strings/blob/main/README.md Dumps extracted strings from a byte array to a specified JSON file, including minimum length and encoding. ```python # You can also dump to json file rust_strings.dump_strings("strings.json", bytes=b"test\x00\x00", min_length=4, encodings=["ascii"]) # `strings.json` content: # [["test", 0]] ``` -------------------------------- ### Extract strings from bytes with Rust config Source: https://github.com/iddohau/rust-strings/blob/main/README.md Extracts strings from a byte array using Rust's BytesConfig, verifying the extracted strings. ```rust use rust_strings::BytesConfig; let config = BytesConfig::new(b"test\x00".to_vec()); let extracted_strings = strings(&config); assert_eq!(vec![(String::from("test"), 0)], extracted_strings.unwrap()); ``` -------------------------------- ### Extract strings with custom buffer size in Python Source: https://github.com/iddohau/rust-strings/blob/main/README.md Extracts strings from a file path, allowing customization of the buffer size used for reading. The default buffer size is 1MB. ```python # You can also set buffer size when reading from file (default is 1mb) rust_strings.strings(file_path="/bin/ls", min_length=5, buffer_size=1024) ``` -------------------------------- ### Extract ASCII strings from file in Python Source: https://github.com/iddohau/rust-strings/blob/main/README.md Extracts ASCII strings from a specified file path with a minimum string length. It returns a list of tuples, where each tuple contains the extracted string and its offset. ```python import rust_strings # Get all ascii strings from file with minimun length of string rust_strings.strings(file_path="/bin/ls", min_length=3) # [('ELF', 1), # ('/lib64/ld-linux-x86-64.so.2', 680), # ('GNU', 720), # ('.