pub fn from_file_with_base_address<P: AsRef<Path>>(
        filename: P,
        base_address: u64,
    ) -> Result<Elf> {
        let filename: &Path = filename.as_ref();
        let mut file = match File::open(filename) {
            Ok(file) => file,
            Err(e) => {
                return Err(format!("Error opening {:?}: {}", filename.to_string_lossy(), e).into())
            }
        };
        let mut buf = Vec::new();
        file.read_to_end(&mut buf)?;
        Elf::new(buf, base_address)
    }
/// Load an Elf from a file and use the given base address.
Load an Elf from a file and use the given base address.
Load an Elf from a file and use the given base address .
pub fn from_file_with_base_address<P: AsRef<Path>>(
        filename: P,
        base_address: u64,
    ) -> Result<Elf> {
        let filename: &Path = filename.as_ref();
        let mut file = match File::open(filename) {
            Ok(file) => file,
            Err(e) => {
                return Err(format!("Error opening {:?}: {}", filename.to_string_lossy(), e).into())
            }
        };
        let mut buf = Vec::new();
        file.read_to_end(&mut buf)?;
        Elf::new(buf, base_address)
    }
pub fn from_file_with_base_address < P : AsRef < Path > > ( filename : P , base_address : u64 , ) -> Result < Elf > { let filename : & Path = filename . as_ref ( ) ; let mut file = match File :: open ( filename ) { Ok ( file ) => file , Err ( e ) => { return Err ( format ! ( " " filename to_string_lossy ( ) e ) . into ( ) ) } } ; let mut buf = Vec :: new ( ) ; file . read_to_end ( & mut buf ) ? ; Elf :: new ( buf , base_address ) }
Load an Elf from a file and use the given base address.
Load an Elf from a file and use the given base address .
filename
P
base_address
u64
filename
P
base_address
u64