Class that represents a PE-COFF symbol.
More...
#include <Symbol.hpp>
|
enum class | STORAGE_CLASS : int32_t {
INVALID = 0xFF
, END_OF_FUNCTION = -1
, NONE = 0
, AUTOMATIC = 1
,
EXTERNAL = 2
, STATIC = 3
, REGISTER = 4
, EXTERNAL_DEF = 5
,
LABEL = 6
, UNDEFINED_LABEL = 7
, MEMBER_OF_STRUCT = 8
, ARGUMENT = 9
,
STRUCT_TAG = 10
, MEMBER_OF_UNION = 11
, UNION_TAG = 12
, TYPE_DEFINITION = 13
,
UNDEFINED_STATIC = 14
, ENUM_TAG = 15
, MEMBER_OF_ENUM = 16
, REGISTER_PARAM = 17
,
BIT_FIELD = 18
, BLOCK = 100
, FUNCTION = 101
, END_OF_STRUCT = 102
,
FILE = 103
, SECTION = 104
, WEAK_EXTERNAL = 105
, CLR_TOKEN = 107
} |
| Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#storage-class. More...
|
|
enum class | BASE_TYPE : uint32_t {
TY_NULL = 0
, TY_VOID = 1
, TY_CHAR = 2
, TY_SHORT = 3
,
TY_INT = 4
, TY_LONG = 5
, TY_FLOAT = 6
, TY_DOUBLE = 7
,
TY_STRUCT = 8
, TY_UNION = 9
, TY_ENUM = 10
, TY_MOE = 11
,
TY_BYTE = 12
, TY_WORD = 13
, TY_UINT = 14
, TY_DWORD = 15
} |
|
enum class | COMPLEX_TYPE : uint32_t { TY_NULL = 0
, TY_POINTER = 1
, TY_FUNCTION = 2
, TY_ARRAY = 3
} |
|
using | auxiliary_symbols_t = std::vector<std::unique_ptr<AuxiliarySymbol>> |
|
using | it_auxiliary_symbols_t = ref_iterator<auxiliary_symbols_t&, AuxiliarySymbol*> |
|
using | it_const_auxiliary_symbols_t = const_ref_iterator<const auxiliary_symbols_t&, AuxiliarySymbol*> |
|
template<class T > |
using | output_t = add_pointer_t<decay_t<T>> |
|
template<class T > |
using | output_const_t = add_pointer_t<add_const_t<decay_t<T>>> |
|
|
static constexpr auto | SYM_SEC_IDX_DEBUG = -2 |
| The symbol provides general type or debugging information but does not correspond to a section. Microsoft tools use this setting along with .file records.
|
|
static constexpr auto | SYM_SEC_IDX_ABS = -1 |
| The symbol has an absolute (non-relocatable) value and is not an address.
|
|
static constexpr auto | SYM_SEC_IDX_UNDEF = 0 |
| The symbol record is not yet assigned a section. A value of zero indicates that a reference to an external symbol is defined elsewhere. A value of non-zero is a common symbol with a size that is specified by the value.
|
|
static constexpr auto | SYM_COMPLEX_TYPE_SHIFT = 4 |
|
Class that represents a PE-COFF symbol.
Usually PE debug information (including symbols) are wrapped in a PDB file referenced by the CodeViewPDB object.
The PE format allows to define (by COFF inheritance) a symbol table that is different from the regular PDB symbols. This table contains COFF(16) symbols which can reference auxiliary symbols.
- Warning
- The LIEF::Symbol::value() should be interpreted in perspective of the Symbol::storage_class().
Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#coff-symbol-table
◆ auxiliary_symbols_t
◆ it_auxiliary_symbols_t
◆ it_const_auxiliary_symbols_t
◆ BASE_TYPE
Enumerator |
---|
TY_NULL | No type information or unknown base type.
|
TY_VOID | Used with void pointers and functions.
|
TY_CHAR | A character (signed byte).
|
TY_SHORT | A 2-byte signed integer.
|
TY_INT | A natural integer type on the target.
|
TY_LONG | A 4-byte signed integer.
|
TY_FLOAT | A 4-byte floating-point number.
|
TY_DOUBLE | An 8-byte floating-point number.
|
TY_STRUCT | A structure.
|
TY_UNION | An union.
|
TY_ENUM | An enumerated type.
|
TY_MOE | A member of enumeration (a specific value).
|
TY_BYTE | A byte; unsigned 1-byte integer.
|
TY_WORD | A word; unsigned 2-byte integer.
|
TY_UINT | An unsigned integer of natural size.
|
TY_DWORD | An unsigned 4-byte integer.
|
◆ COMPLEX_TYPE
Enumerator |
---|
TY_NULL | No complex type; simple scalar variable.
|
TY_POINTER | A pointer to base type.
|
TY_FUNCTION | A function that returns a base type.
|
TY_ARRAY | An array of base type.
|
◆ STORAGE_CLASS
Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#storage-class.
Enumerator |
---|
INVALID | |
END_OF_FUNCTION | Physical end of function.
|
NONE | No symbol.
|
AUTOMATIC | Stack variable.
|
EXTERNAL | External symbol.
|
STATIC | Static.
|
REGISTER | Register variable.
|
EXTERNAL_DEF | External definition.
|
LABEL | Label.
|
UNDEFINED_LABEL | Undefined label.
|
MEMBER_OF_STRUCT | Member of structure.
|
ARGUMENT | Function argument.
|
STRUCT_TAG | Structure tag.
|
MEMBER_OF_UNION | Member of union.
|
UNION_TAG | Union tag.
|
TYPE_DEFINITION | Type definition.
|
UNDEFINED_STATIC | Undefined static.
|
ENUM_TAG | Enumeration tag.
|
MEMBER_OF_ENUM | Member of enumeration.
|
REGISTER_PARAM | Register parameter.
|
BIT_FIELD | Bit field.
|
BLOCK | |
FUNCTION | |
END_OF_STRUCT | End of structure.
|
FILE | File name.
|
SECTION | |
WEAK_EXTERNAL | Duplicate tag.
|
CLR_TOKEN | |
◆ Symbol() [1/3]
LIEF::PE::Symbol::Symbol |
( |
| ) |
|
◆ Symbol() [2/3]
LIEF::PE::Symbol::Symbol |
( |
const Symbol & | | ) |
|
◆ Symbol() [3/3]
LIEF::PE::Symbol::Symbol |
( |
Symbol && | | ) |
|
◆ ~Symbol()
LIEF::PE::Symbol::~Symbol |
( |
| ) |
|
|
override |
◆ accept()
void LIEF::PE::Symbol::accept |
( |
Visitor & | visitor | ) |
const |
|
overridevirtual |
◆ add_aux()
Add a new auxiliary record.
◆ auxiliary_symbols() [1/2]
Auxiliary symbols associated with this symbol.
◆ auxiliary_symbols() [2/2]
◆ base_type()
BASE_TYPE LIEF::PE::Symbol::base_type |
( |
| ) |
const |
|
inline |
The simple (base) data type.
◆ coff_name() [1/2]
◆ coff_name() [2/2]
const COFFString * LIEF::PE::Symbol::coff_name |
( |
| ) |
const |
|
inline |
COFF string used to represents the (long) symbol name.
◆ complex_type()
The complex type (if any)
◆ is_external()
bool LIEF::PE::Symbol::is_external |
( |
| ) |
const |
|
inline |
◆ is_file_record()
bool LIEF::PE::Symbol::is_file_record |
( |
| ) |
const |
|
inline |
◆ is_function_line_info()
bool LIEF::PE::Symbol::is_function_line_info |
( |
| ) |
const |
|
inline |
◆ is_reversed_sec_idx()
static constexpr bool LIEF::PE::Symbol::is_reversed_sec_idx |
( |
int16_t | idx | ) |
|
|
inlinestaticconstexpr |
Check if the given section index is a reserved value.
◆ is_undefined()
bool LIEF::PE::Symbol::is_undefined |
( |
| ) |
const |
|
inline |
◆ is_weak_external()
bool LIEF::PE::Symbol::is_weak_external |
( |
| ) |
const |
|
inline |
◆ name() [1/2]
const std::string & LIEF::PE::Symbol::name |
( |
| ) |
const |
|
overridevirtual |
Name of the symbol. If the symbol does not use a short name, it returns the string pointed by the COFF string offset.
Reimplemented from LIEF::Symbol.
◆ name() [2/2]
std::string & LIEF::PE::Symbol::name |
( |
| ) |
|
|
overridevirtual |
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ parse()
◆ section_idx() [1/2]
int16_t LIEF::PE::Symbol::section_idx |
( |
| ) |
const |
|
inline |
The signed integer that identifies the section, using a one-based index into the section table. Some values have special meaning:
- 0: The symbol record is not yet assigned a section. A value of zero indicates that a reference to an external symbol is defined elsewhere. A value of non-zero is a common symbol with a size that is specified by the value.
- -1: The symbol has an absolute (non-relocatable) value and is not an address.
- -2: The symbol provides general type or debugging information but does not correspond to a section. Microsoft tools use this setting along with
.file
records
◆ section_idx() [2/2]
Symbol & LIEF::PE::Symbol::section_idx |
( |
int16_t | idx | ) |
|
|
inline |
◆ storage_class() [1/2]
Storage class of the symbol which indicates what kind of definition a symbol represents.
◆ storage_class() [2/2]
Symbol & LIEF::PE::Symbol::storage_class |
( |
uint8_t | value | ) |
|
|
inline |
◆ type() [1/2]
uint16_t LIEF::PE::Symbol::type |
( |
| ) |
const |
|
inline |
The symbol type. The first byte represents the base type (see: base_type()) while the upper byte represents the complex type, if any (see: complex_type()).
◆ type() [2/2]
Symbol & LIEF::PE::Symbol::type |
( |
uint16_t | ty | ) |
|
|
inline |
◆ SYM_COMPLEX_TYPE_SHIFT
auto LIEF::PE::Symbol::SYM_COMPLEX_TYPE_SHIFT = 4 |
|
staticconstexpr |
◆ SYM_SEC_IDX_ABS
auto LIEF::PE::Symbol::SYM_SEC_IDX_ABS = -1 |
|
staticconstexpr |
The symbol has an absolute (non-relocatable) value and is not an address.
◆ SYM_SEC_IDX_DEBUG
auto LIEF::PE::Symbol::SYM_SEC_IDX_DEBUG = -2 |
|
staticconstexpr |
The symbol provides general type or debugging information but does not correspond to a section. Microsoft tools use this setting along with .file
records.
◆ SYM_SEC_IDX_UNDEF
auto LIEF::PE::Symbol::SYM_SEC_IDX_UNDEF = 0 |
|
staticconstexpr |
The symbol record is not yet assigned a section. A value of zero indicates that a reference to an external symbol is defined elsewhere. A value of non-zero is a common symbol with a size that is specified by the value.
The documentation for this class was generated from the following file: