Struct goblin::pe::symbol::Symbol [−][src]
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.
Implementations
impl Symbol
[src]
pub fn parse<'a>(
bytes: &'a [u8],
offset: usize
) -> Result<(Option<&'a str>, Symbol)>
[src]
bytes: &'a [u8],
offset: usize
) -> Result<(Option<&'a str>, Symbol)>
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 Clone for Symbol
[src]
impl Copy for Symbol
[src]
impl Debug for Symbol
[src]
impl Default for Symbol
[src]
impl FromCtx<Endian, [u8]> for Symbol
[src]
impl<'a> IntoCtx<Endian, [u8]> for &'a Symbol
[src]
impl IntoCtx<Endian, [u8]> for Symbol
[src]
impl PartialEq<Symbol> for Symbol
[src]
impl SizeWith<Endian> for Symbol
[src]
impl StructuralPartialEq for Symbol
[src]
impl<'a> TryFromCtx<'a, Endian, [u8]> for Symbol where
Symbol: 'a,
[src]
Symbol: 'a,
type Error = Error
fn try_from_ctx(
src: &'a [u8],
ctx: Endian
) -> Result<(Self, usize), Self::Error>
[src]
src: &'a [u8],
ctx: Endian
) -> Result<(Self, usize), Self::Error>
impl<'a> TryIntoCtx<Endian, [u8]> for &'a Symbol
[src]
type Error = Error
fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>
[src]
impl TryIntoCtx<Endian, [u8]> for Symbol
[src]
Auto Trait Implementations
impl RefUnwindSafe for Symbol
impl Send for Symbol
impl Sync for Symbol
impl Unpin for Symbol
impl UnwindSafe for Symbol
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,