libpefile

Crates.iolibpefile
lib.rslibpefile
version0.2.2
sourcesrc
created_at2021-06-30 08:29:21.18739
updated_at2021-07-02 07:55:50.760437
descriptionlibrary to parse PE files (only iterating over MESSAGE_TABLE entries is supported at the moment)
homepage
repositoryhttps://github.com/janstarke/libpefile
max_upload_size
id416753
size225,700
Jan Starke (janstarke)

documentation

README

https://crates.io/crates/libpefile Build-and-Test

libpefile

library to parse PE files

Installation

cargo install libpefile

Usage example

use libpefile::*;
use std::path::PathBuf;

fn main() -> std::io::Result<()> {
    let manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap();
    let dll_file = PathBuf::from(format!("{}/samples/msaudite.dll", manifest_dir));
    let pefile = PEFile::new(dll_file)?;

    for msg in pefile.messages_iter()?.filter_map(|r| r.ok()) {
        println!("{}: '{}'", msg.msg_id, msg.text);
    }
    Ok(())
}
Commit count: 42

cargo fmt