[][src]Struct goblin::pe::symbol::Symbol

#[repr(C)]
pub struct Symbol {
    pub name: [u8; 8],
    pub value: u32,
    pub section_number: i16,
    pub typ: u16,
    pub storage_class: u8,
    pub number_of_aux_symbols: u8,
}

A COFF symbol.

Unwind information for this function can be loaded with ExceptionData::get_unwind_info.

Fields

name: [u8; 8]

The name of the symbol.

An array of 8 bytes is used if the name is not more than 8 bytes long. This array is padded with nulls on the right if the name is less than 8 bytes long.

For longer names, the first 4 bytes are all zeros, and the second 4 bytes are an offset into the string table.

value: u32

The value that is associated with the symbol.

The interpretation of this field depends on section_number and storage_class. A typical meaning is the relocatable address.

section_number: i16

A one-based index into the section table. Zero and negative values have special meanings.

typ: u16

A number that represents type.

Microsoft tools set this field to 0x20 (function) or 0x0 (not a function).

storage_class: u8

An enumerated value that represents storage class.

number_of_aux_symbols: u8

The number of auxiliary symbol table entries that follow this record.

Each auxiliary record is the same size as a standard symbol-table record (18 bytes), but rather than define a new symbol, the auxiliary record gives additional information on the last symbol defined.

Methods

impl Symbol[src]

pub fn parse<'a>(
    bytes: &'a [u8],
    offset: usize
) -> Result<(Option<&'a str>, Symbol)>
[src]

Parse the symbol at the given offset.

If the symbol has an inline name, then also returns a reference to the name's location in bytes.

pub fn name<'a>(&'a self, strtab: &'a Strtab) -> Result<&'a str>[src]

Returns the symbol name.

This may be a reference to an inline name in the symbol, or to a strtab entry.

pub fn name_offset(&self) -> Option<u32>[src]

Return the strtab offset of the symbol name.

Returns None if the name is inline.

pub fn set_name_offset(&mut self, offset: u32)[src]

Set the strtab offset of the symbol name.

pub fn base_type(&self) -> u16[src]

Return the base type of the symbol.

This type uses the IMAGE_SYM_TYPE_* definitions.

pub fn derived_type(&self) -> u16[src]

Return the derived type of the symbol.

This type uses the IMAGE_SYM_DTYPE_* definitions.

pub fn is_function_definition(&self) -> bool[src]

Return true for function definitions.

These symbols use AuxFunctionDefinition for auxiliary symbol records.

pub fn is_weak_external(&self) -> bool[src]

Return true for weak external symbols.

These symbols use AuxWeakExternal for auxiliary symbol records.

pub fn is_file(&self) -> bool[src]

Return true for file symbol records.

The auxiliary records contain the name of the source code file.

pub fn is_section_definition(&self) -> bool[src]

Return true for section definitions.

These symbols use AuxSectionDefinition for auxiliary symbol records.

Trait Implementations

impl PartialEq<Symbol> for Symbol[src]

impl Copy for Symbol[src]

impl Default for Symbol[src]

impl Clone for Symbol[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Symbol[src]

impl FromCtx<Endian, [u8]> for Symbol[src]

impl<'a> TryFromCtx<'a, Endian, [u8]> for Symbol where
    Symbol: 'a, 
[src]

type Error = Error

type Size = usize

impl<'a> IntoCtx<Endian, [u8]> for &'a Symbol[src]

impl IntoCtx<Endian, [u8]> for Symbol[src]

impl<'a> TryIntoCtx<Endian, [u8]> for &'a Symbol[src]

type Error = Error

type Size = usize

impl TryIntoCtx<Endian, [u8]> for Symbol[src]

type Error = Error

type Size = usize

impl SizeWith<Endian> for Symbol[src]

type Units = usize

Auto Trait Implementations

impl Send for Symbol

impl Unpin for Symbol

impl Sync for Symbol

impl UnwindSafe for Symbol

impl RefUnwindSafe for Symbol

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]