18 releases

Uses new Rust 2024

new 0.3.14 Oct 18, 2025
0.3.13 Aug 22, 2025
0.3.9 Jun 25, 2025
0.3.5 May 25, 2025
0.1.0 Dec 13, 2024

#660 in Parser implementations

Download history 319/week @ 2025-06-28 358/week @ 2025-07-05 244/week @ 2025-07-12 298/week @ 2025-07-19 269/week @ 2025-07-26 324/week @ 2025-08-02 512/week @ 2025-08-09 629/week @ 2025-08-16 405/week @ 2025-08-23 342/week @ 2025-08-30 980/week @ 2025-09-06 457/week @ 2025-09-13 369/week @ 2025-09-20 549/week @ 2025-09-27 474/week @ 2025-10-04 263/week @ 2025-10-11

1,690 downloads per month

Apache-2.0

170KB
4K SLoC

Tasru: Map out dwarf binaries

Tasru allows for easy inspection of Elf binaries using Dwarf debug information.

Example usage

let debug_info = tasru::DebugInfo::new("file.elf")?;
let var_value = debug_info.variable_from_demangled_name("package::GLOBAL_VAR")?.base_type().to_u32()?;
println!("Var value: {}", var_value);

lib.rs:

Tasru: Parse Dwarf information from Elf files

Tasru allows you to easily traverse Dwarf information stored within Elf files. This can be used within a debugger to read complex data structures in a live environment, or to perform forensics on a captured image.

Example:

/// Returns the address as a value, unless `resolve` is `false`
/// in which case it returns `0`. Useful for testing memory operations.
struct FakeReader {
    resolve: bool,
}

impl tasru::memory::Read for FakeReader {
    type Error = std::io::Error; // Unused in this example

    fn read_u8(&mut self, address: u64) -> Result<u8, Self::Error> {
        if self.resolve {
            Ok(address as u8 + 8)
        } else {
            Ok(0)
        }
    }
}

// Read the elf file `example.elf`
let debug_info = tasru::DebugInfo::new(&"example.elf").expect("couldn't open example");
// Extract information on the static variable `example::ENUM`
let example_enum = debug_info.variable_from_demangled_name("example::ENUM").expect("couldn't find variable");
// Turn it into an enum (if it is one)
let example_enum = example_enum.enumeration().expect("variable isn't an enum");
// Get the current variant.
let variant = example_enum.variant(&mut FakeReader { resolve: true }).expect("couldn't determine variant");
println!("Variant is: {}", variant.name());

Most of the functionality in this crate comes from DebugInfo.

Dependencies

~3.5MB
~72K SLoC