Struct elfio::StringSectionAccessor [−][src]
pub struct StringSectionAccessor<'a> { /* fields omitted */ }
Expand description
A section data accessor intended to string tables
For example:
use std::fs::File; use std::io; use std::io::{BufReader, Error}; use elfio::{Elfio, StringSectionAccessor}; // Uncomment in the real code fn main() -> io::Result<()> { let elf_file = File::open("tests/files/hello_64")?; let mut file_reader = BufReader::new(elf_file); let mut elf = elfio::Elfio::new(); elf.load(&mut file_reader)?; let section = elf.get_section_by_name(".strtab"); match section { Some(s) => { let strtab = StringSectionAccessor::new(s); println!("{}", strtab.get_string(1)); } None => return Err(Error::new(io::ErrorKind::Other, "section not found")), } Ok(()) }
Implementations
Creates a new instance of the string table accessor
Returns a string from string table by its index
Auto Trait Implementations
impl<'a> !RefUnwindSafe for StringSectionAccessor<'a>
impl<'a> !Send for StringSectionAccessor<'a>
impl<'a> !Sync for StringSectionAccessor<'a>
impl<'a> Unpin for StringSectionAccessor<'a>
impl<'a> !UnwindSafe for StringSectionAccessor<'a>