LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
LIEF::MachO::DynamicSymbolCommand Class Reference

Class that represents the LC_DYSYMTAB command. More...

#include <DynamicSymbolCommand.hpp>

Inheritance diagram for LIEF::MachO::DynamicSymbolCommand:
Inheritance graph
[legend]
Collaboration diagram for LIEF::MachO::DynamicSymbolCommand:
Collaboration graph
[legend]

Public Member Functions

 DynamicSymbolCommand (const details::dysymtab_command &cmd)
 
DynamicSymbolCommandoperator= (const DynamicSymbolCommand &copy)
 
 DynamicSymbolCommand (const DynamicSymbolCommand &copy)
 
DynamicSymbolCommandclone () const override
 
void accept (Visitor &visitor) const override
 
std::ostream & print (std::ostream &os) const override
 
uint32_t idx_local_symbol () const
 Index of the first symbol in the group of local symbols.
 
uint32_t nb_local_symbols () const
 Number of symbols in the group of local symbols.
 
uint32_t idx_external_define_symbol () const
 Index of the first symbol in the group of defined external symbols.
 
uint32_t nb_external_define_symbols () const
 Number of symbols in the group of defined external symbols.
 
uint32_t idx_undefined_symbol () const
 Index of the first symbol in the group of undefined external symbols.
 
uint32_t nb_undefined_symbols () const
 Number of symbols in the group of undefined external symbols.
 
uint32_t toc_offset () const
 Byte offset from the start of the file to the table of contents data.
 
uint32_t nb_toc () const
 Number of entries in the table of contents.
 
uint32_t module_table_offset () const
 Byte offset from the start of the file to the module table data.
 
uint32_t nb_module_table () const
 Number of entries in the module table.
 
uint32_t external_reference_symbol_offset () const
 Byte offset from the start of the file to the external reference table data.
 
uint32_t nb_external_reference_symbols () const
 Number of entries in the external reference table.
 
uint32_t indirect_symbol_offset () const
 Byte offset from the start of the file to the indirect symbol table data.
 
uint32_t nb_indirect_symbols () const
 Number of entries in the indirect symbol table.
 
uint32_t external_relocation_offset () const
 Byte offset from the start of the file to the external relocation table data.
 
uint32_t nb_external_relocations () const
 Number of entries in the external relocation table.
 
uint32_t local_relocation_offset () const
 Byte offset from the start of the file to the local relocation table data.
 
uint32_t nb_local_relocations () const
 Number of entries in the local relocation table.
 
void idx_local_symbol (uint32_t value)
 
void nb_local_symbols (uint32_t value)
 
void idx_external_define_symbol (uint32_t value)
 
void nb_external_define_symbols (uint32_t value)
 
void idx_undefined_symbol (uint32_t value)
 
void nb_undefined_symbols (uint32_t value)
 
void toc_offset (uint32_t value)
 
void nb_toc (uint32_t value)
 
void module_table_offset (uint32_t value)
 
void nb_module_table (uint32_t value)
 
void external_reference_symbol_offset (uint32_t value)
 
void nb_external_reference_symbols (uint32_t value)
 
void indirect_symbol_offset (uint32_t value)
 
void nb_indirect_symbols (uint32_t value)
 
void external_relocation_offset (uint32_t value)
 
void nb_external_relocations (uint32_t value)
 
void local_relocation_offset (uint32_t value)
 
void nb_local_relocations (uint32_t value)
 
- Public Member Functions inherited from LIEF::MachO::LoadCommand
 LoadCommand (const details::load_command &command)
 
 LoadCommand (LOAD_COMMAND_TYPES type, uint32_t size)
 
LoadCommandoperator= (LoadCommand copy)
 
 LoadCommand (const LoadCommand &copy)
 
void swap (LoadCommand &other)
 
LOAD_COMMAND_TYPES command () const
 Command type.
 
uint32_t size () const
 Size of the command (should be greather than sizeof(load_command))
 
span< const uint8_t > data () const
 Raw command.
 
uint64_t command_offset () const
 Offset of the command within the Load Command Table
 
void data (const raw_t &data)
 
void command (LOAD_COMMAND_TYPES command)
 
void size (uint32_t size)
 
void command_offset (uint64_t offset)
 
void accept (Visitor &visitor) const override
 
- Public Member Functions inherited from LIEF::Object
 Object (const Object &other)
 
Objectoperator= (const Object &other)
 
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
 

Static Public Member Functions

static bool classof (const LoadCommand *cmd)
 
- Static Public Member Functions inherited from LIEF::MachO::LoadCommand
static bool is_linkedit_data (const LoadCommand &cmd)
 

Additional Inherited Members

- Public Types inherited from LIEF::MachO::LoadCommand
using raw_t = std::vector<uint8_t>
 
- Public Types inherited from LIEF::Object
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>>>
 

Detailed Description

Class that represents the LC_DYSYMTAB command.

This command completes the LC_SYMTAB (SymbolCommand) to provide a better granularity over the symbols layout.

Member Function Documentation

◆ accept()

void LIEF::MachO::DynamicSymbolCommand::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ clone()

DynamicSymbolCommand * LIEF::MachO::DynamicSymbolCommand::clone ( ) const
overridevirtual

Reimplemented from LIEF::MachO::LoadCommand.

◆ external_reference_symbol_offset()

uint32_t LIEF::MachO::DynamicSymbolCommand::external_reference_symbol_offset ( ) const

Byte offset from the start of the file to the external reference table data.

This field seems unused by recent Mach-O loader and should be set to 0

◆ external_relocation_offset()

uint32_t LIEF::MachO::DynamicSymbolCommand::external_relocation_offset ( ) const

Byte offset from the start of the file to the external relocation table data.

This field seems unused by recent Mach-O loader and should be set to 0

◆ indirect_symbol_offset()

uint32_t LIEF::MachO::DynamicSymbolCommand::indirect_symbol_offset ( ) const

Byte offset from the start of the file to the indirect symbol table data.

Indirect symbol table is used by the loader to speed-up symbol resolution during the lazy binding process

References:

  • dyld-519.2.1/src/ImageLoaderMachOCompressed.cpp
  • dyld-519.2.1/src/ImageLoaderMachOClassic.cpp

◆ local_relocation_offset()

uint32_t LIEF::MachO::DynamicSymbolCommand::local_relocation_offset ( ) const

Byte offset from the start of the file to the local relocation table data.

This field seems unused by recent Mach-O loader and should be set to 0

◆ module_table_offset()

uint32_t LIEF::MachO::DynamicSymbolCommand::module_table_offset ( ) const

Byte offset from the start of the file to the module table data.

This field seems unused by recent Mach-O loader and should be set to 0

◆ nb_external_reference_symbols()

uint32_t LIEF::MachO::DynamicSymbolCommand::nb_external_reference_symbols ( ) const

Number of entries in the external reference table.

This field seems unused by recent Mach-O loader and should be set to 0

◆ nb_external_relocations()

uint32_t LIEF::MachO::DynamicSymbolCommand::nb_external_relocations ( ) const

Number of entries in the external relocation table.

This field seems unused by recent Mach-O loader and should be set to 0

◆ nb_indirect_symbols()

uint32_t LIEF::MachO::DynamicSymbolCommand::nb_indirect_symbols ( ) const

Number of entries in the indirect symbol table.

See also
indirect_symbol_offset

◆ nb_local_relocations()

uint32_t LIEF::MachO::DynamicSymbolCommand::nb_local_relocations ( ) const

Number of entries in the local relocation table.

This field seems unused by recent Mach-O loader and should be set to 0

◆ nb_module_table()

uint32_t LIEF::MachO::DynamicSymbolCommand::nb_module_table ( ) const

Number of entries in the module table.

This field seems unused by recent Mach-O loader and should be set to 0

◆ nb_toc()

uint32_t LIEF::MachO::DynamicSymbolCommand::nb_toc ( ) const

Number of entries in the table of contents.

Should be set to 0 on recent Mach-O

◆ print()

std::ostream & LIEF::MachO::DynamicSymbolCommand::print ( std::ostream & os) const
overridevirtual

Reimplemented from LIEF::MachO::LoadCommand.

◆ toc_offset()

uint32_t LIEF::MachO::DynamicSymbolCommand::toc_offset ( ) const

Byte offset from the start of the file to the table of contents data.

Table of content is used by legacy Mach-O loader and this field should be set to 0


The documentation for this class was generated from the following file: