Trait lief::generic::Binary

pub trait Binary {
    // Provided methods
    fn entrypoint(&self) -> u64 { ... }
    fn imagebase(&self) -> u64 { ... }
    fn is_pie(&self) -> bool { ... }
    fn has_nx(&self) -> bool { ... }
    fn original_size(&self) -> u64 { ... }
    fn debug_info(&self) -> Option<DebugInfo<'_>> { ... }
}

Provided Methods§

fn entrypoint(&self) -> u64

Binary’s entrypoint

fn imagebase(&self) -> u64

Default base address where the binary should be mapped

fn is_pie(&self) -> bool

Whether the current binary is an executable and position independent

fn has_nx(&self) -> bool

Whether the binary defines a non-executable stack

fn original_size(&self) -> u64

Original file size of the binary

fn debug_info(&self) -> Option<DebugInfo<'_>>

Return the debug info if present. It can be either a crate::pdb::DebugInfo or crate::dwarf::DebugInfo.

For ELF and Mach-O binaries, it returns the given DebugInfo object only if the binary embeds the DWARF debug info in the binary itself.

For PE file, this function tries to find the external PDB using the crate::pe::debug::CodeViewPDB::filename output (if present). One can also use crate::pdb::load or crate::pdb::DebugInfo::from to get PDB debug info.

This function requires LIEF's extended version otherwise it **always** return `None`

Implementors§

§

impl Binary for lief::elf::Binary

§

impl Binary for lief::macho::Binary

§

impl Binary for lief::pe::Binary