yggdrasil-elf/README.md
2015-02-09 20:53:52 -08:00

603 B

Build Status

rust-elf

Pure-Rust library for parsing ELF files

Documentation

Example:

extern crate elf;

use std::path::Path;

let path = Path::new("/some/file/path");
let file = match elf::File::open(&path) {
    Ok(f) => f,
    Err(e) => panic!("Error: {:?}", e),
};

let text_scn = match file.get_section(String::from_str(".text")) {
    Some(s) => s,
    None => panic!("Failed to look up .text section"),
};

println!("{}", text_scn.data);