Struct goblin::mach::symbols::Symbols
[−]
[src]
pub struct Symbols<'a> { pub nsyms: usize, // some fields omitted }
A zero-copy "nlist" style symbol table ("stab"), including the string table
Fields
nsyms: usize
Methods
impl<'a> Symbols<'a>
[src]
fn new(
bytes: &'a [u8],
start: usize,
count: usize,
strtab: usize
) -> Result<Symbols<'a>>
bytes: &'a [u8],
start: usize,
count: usize,
strtab: usize
) -> Result<Symbols<'a>>
Creates a new symbol table with count
elements, from the start
offset, using the string table at strtab
, with a default ctx.
Beware, this will provide incorrect results if you construct this on a 32-bit mach binary, using a 64-bit machine; use parse
instead if you want 32/64 bit support
fn parse(
bytes: &'a [u8],
symtab: &SymtabCommand,
ctx: Ctx
) -> Result<Symbols<'a>>
bytes: &'a [u8],
symtab: &SymtabCommand,
ctx: Ctx
) -> Result<Symbols<'a>>
fn get(&self, index: usize) -> Result<(&'a str, Nlist)>
Parses a single Nlist symbol from the binary, with its accompanying name
Trait Implementations
impl<'a, T: ?Sized> TryFromCtx<'a, (usize, SymbolsCtx), T> for Symbols<'a> where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
type Error = Error
fn try_from_ctx(
bytes: &'a T,
(offset, SymbolsCtx { nsyms: nsyms, strtab: strtab, ctx: ctx }): (usize, SymbolsCtx)
) -> Result<Self>
bytes: &'a T,
(offset, SymbolsCtx { nsyms: nsyms, strtab: strtab, ctx: ctx }): (usize, SymbolsCtx)
) -> Result<Self>