|
LIEF: Library to Instrument Executable Formats Version 1.0.0
|
This class represents a COFF symbol. More...
#include <Symbol.hpp>


Classes | |
| struct | parsing_context_t |
Public Member Functions | |
| Symbol () | |
| Symbol (const Symbol &) | |
| Symbol & | operator= (const Symbol &) |
| Symbol (Symbol &&) | |
| Symbol & | operator= (Symbol &&) |
| uint16_t | type () const |
| 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()). | |
| STORAGE_CLASS | storage_class () const |
| Storage class of the symbol which indicates what kind of definition a symbol represents. | |
| BASE_TYPE | base_type () const |
| The simple (base) data type. | |
| COMPLEX_TYPE | complex_type () const |
| The complex type (if any). | |
| int16_t | section_idx () const |
| The signed integer that identifies the section, using a one-based index into the section table. Some values have special meaning: | |
| Section * | section () |
| Section associated with this symbol (if any). | |
| const Section * | section () const |
| bool | is_external () const |
| bool | is_weak_external () const |
| bool | is_absolute () const |
| bool | is_undefined () const |
| bool | is_function_line_info () const |
| bool | is_function () const |
| bool | is_file_record () const |
| it_auxiliary_symbols_t | auxiliary_symbols () |
| Auxiliary symbols associated with this symbol. | |
| it_const_auxiliary_symbols_t | auxiliary_symbols () const |
| const std::string & | name () const override |
| Name of the symbol. If the symbol does not use a short name, it returns the string pointed by the COFF string offset. | |
| std::string & | name () override |
| const String * | coff_name () const |
| COFF string used to represents the (long) symbol name. | |
| String * | coff_name () |
| std::string | demangled_name () const |
| Demangled representation of the symbol or an empty string if it can't be demangled. | |
| Symbol & | type (uint16_t ty) |
| Symbol & | storage_class (uint8_t value) |
| Symbol & | section_idx (int16_t idx) |
| AuxiliarySymbol & | add_aux (std::unique_ptr< AuxiliarySymbol > sym) |
| Add a new auxiliary record. | |
| std::string | to_string () const |
| ~Symbol () override | |
| Public Member Functions inherited from LIEF::Symbol | |
| Symbol ()=default | |
| Symbol (std::string name) | |
| Symbol (std::string name, uint64_t value) | |
| Symbol (std::string name, uint64_t value, uint64_t size) | |
| Symbol (const Symbol &)=default | |
| Symbol & | operator= (const Symbol &)=default |
| Symbol (Symbol &&)=default | |
| Symbol & | operator= (Symbol &&)=default |
| ~Symbol () override=default | |
| void | swap (Symbol &other) noexcept |
| virtual void | name (std::string name) |
| Set symbol name. | |
| virtual uint64_t | value () const |
| virtual void | value (uint64_t value) |
| virtual uint64_t | size () const |
| This size of the symbol (when applicable). | |
| virtual void | size (uint64_t value) |
| void | accept (Visitor &visitor) const override |
| Method so that the visitor can visit us. | |
| Public Member Functions inherited from LIEF::Object | |
| Object () | |
| Object (const Object &other) | |
| Object & | operator= (const Object &other) |
| Object (Object &&other) noexcept=default | |
| Object & | operator= (Object &&other) noexcept=default |
| template<class T> | |
| output_t< T > | as () |
| template<class T> | |
| output_const_t< T > | as () const |
| virtual bool | operator== (const Object &other) const |
| virtual bool | operator!= (const Object &other) const |
| virtual | ~Object () |
Static Public Member Functions | |
| static std::unique_ptr< Symbol > | parse (parsing_context_t &ctx, BinaryStream &stream, size_t *idx) |
| static constexpr bool | is_reversed_sec_idx (int16_t idx) |
| Check if the given section index is a reserved value. | |
Static Public Attributes | |
| 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 |
This class represents a COFF symbol.
| using LIEF::COFF::Symbol::auxiliary_symbols_t = std::vector<std::unique_ptr<AuxiliarySymbol>> |
| using LIEF::COFF::Symbol::it_auxiliary_symbols_t = ref_iterator<auxiliary_symbols_t&, AuxiliarySymbol*> |
| using LIEF::COFF::Symbol::it_const_auxiliary_symbols_t = const_ref_iterator<const auxiliary_symbols_t&, AuxiliarySymbol*> |
|
strong |
|
strong |
|
strong |
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 | |
| LIEF::COFF::Symbol::Symbol | ( | ) |
Referenced by operator<<, operator=(), operator=(), section_idx(), storage_class(), Symbol(), Symbol(), and type().
|
override |
| AuxiliarySymbol & LIEF::COFF::Symbol::add_aux | ( | std::unique_ptr< AuxiliarySymbol > | sym | ) |
Add a new auxiliary record.
|
inline |
Auxiliary symbols associated with this symbol.
|
inline |
|
inline |
The simple (base) data type.
|
inline |
|
inline |
COFF string used to represents the (long) symbol name.
|
inline |
| std::string LIEF::COFF::Symbol::demangled_name | ( | ) | const |
Demangled representation of the symbol or an empty string if it can't be demangled.
|
inline |
References section_idx(), and SYM_SEC_IDX_ABS.
|
inline |
References EXTERNAL, and storage_class().
Referenced by is_undefined().
|
inline |
References FILE, and storage_class().
|
inline |
References complex_type(), and TY_FUNCTION.
|
inline |
References FUNCTION, and storage_class().
|
inlinestaticconstexpr |
Check if the given section index is a reserved value.
|
inline |
References is_external(), section_idx(), SYM_SEC_IDX_UNDEF, and LIEF::Symbol::value().
|
inline |
References storage_class(), and WEAK_EXTERNAL.
|
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.
|
overridevirtual |
Reimplemented from LIEF::Symbol.
|
static |
|
inline |
|
inline |
The signed integer that identifies the section, using a one-based index into the section table. Some values have special meaning:
Referenced by is_absolute(), and is_undefined().
|
inline |
Storage class of the symbol which indicates what kind of definition a symbol represents.
Referenced by is_external(), is_file_record(), is_function_line_info(), and is_weak_external().
|
inline |
References Symbol(), and LIEF::Symbol::value().
| std::string LIEF::COFF::Symbol::to_string | ( | ) | const |
References LIEF_API.
Referenced by operator<<.
|
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()).
|
staticconstexpr |
Referenced by complex_type().
|
staticconstexpr |
The symbol has an absolute (non-relocatable) value and is not an address.
Referenced by is_absolute().
|
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.
|
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.
Referenced by is_undefined().