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

Class that represents the LC_DYLD_CHAINED_FIXUPS command. More...

#include <DyldChainedFixups.hpp>

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

Classes

struct  chained_starts_in_segment
 Structure that mirrors the raw dyld_chained_starts_in_segment which aims at providing information about the chained rebase/bind fixups. More...
 

Public Types

using chained_starts_in_segments_t = std::vector< chained_starts_in_segment >
 Internal container for storing chained_starts_in_segment.
 
using it_chained_starts_in_segments_t = ref_iterator< chained_starts_in_segments_t & >
 Iterator that outputs chained_starts_in_segment&.
 
using it_const_chained_starts_in_segments_t = const_ref_iterator< const chained_starts_in_segments_t & >
 Iterator that outputs const chained_starts_in_segment&.
 
using binding_info_t = std::vector< std::unique_ptr< ChainedBindingInfo > >
 Internal container for storing DyldBindingInfo.
 
using it_binding_info = ref_iterator< binding_info_t &, ChainedBindingInfo * >
 Iterator which outputs DyldBindingInfo&.
 
using it_const_binding_info = const_ref_iterator< const binding_info_t &, ChainedBindingInfo * >
 Iterator which outputs const DyldBindingInfo&.
 
- 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 > > >
 

Public Member Functions

 DyldChainedFixups (const details::linkedit_data_command &cmd)
 
DyldChainedFixupsclone () const override
 
uint32_t data_offset () const
 Offset of the LC_DYLD_CHAINED_FIXUPS chained payload. This offset should point in the __LINKEDIT segment.
 
uint32_t data_size () const
 Size of the LC_DYLD_CHAINED_FIXUPS payload.
 
void data_offset (uint32_t offset)
 
void data_size (uint32_t size)
 
it_binding_info bindings ()
 Iterator over the bindings (ChainedBindingInfo) associated with this command.
 
it_const_binding_info bindings () const
 Iterator over the bindings (ChainedBindingInfo) associated with this command.
 
it_chained_starts_in_segments_t chained_starts_in_segments ()
 Iterator over the chained fixup metadata.
 
it_const_chained_starts_in_segments_t chained_starts_in_segments () const
 
uint32_t fixups_version () const
 Chained fixups version. The loader (dyld v852.2) checks that this value is set to 0.
 
void fixups_version (uint32_t version)
 
uint32_t starts_offset () const
 offset of dyld_chained_starts_in_image in chain_data
 
void starts_offset (uint32_t offset)
 
uint32_t imports_offset () const
 Offset of imports table in chain data.
 
void imports_offset (uint32_t offset)
 
uint32_t symbols_offset () const
 Offset of symbol strings in chain data.
 
void symbols_offset (uint32_t offset)
 
uint32_t imports_count () const
 Number of imported symbol names.
 
void imports_count (uint32_t cnt)
 
uint32_t symbols_format () const
 The compression algorithm (if any) used to store the symbols 0 means uncompressed while 1 means zlib compressed.
 
void symbols_format (uint32_t fmt)
 
DYLD_CHAINED_FORMAT imports_format () const
 The format of the imports (ChainedBindingInfo)
 
void imports_format (DYLD_CHAINED_FORMAT fmt)
 
void accept (Visitor &visitor) const override
 
std::ostream & print (std::ostream &os) const override
 
- 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)
 

Detailed Description

Class that represents the LC_DYLD_CHAINED_FIXUPS command.

This command aims at providing rebase and binding information like the DyldInfo's bytecode. Compared to the DyldInfo bytecode, these chained fixups are taking less space.

Member Function Documentation

◆ accept()

void LIEF::MachO::DyldChainedFixups::accept ( Visitor visitor) const
overridevirtual

Implements LIEF::Object.

◆ clone()

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

Reimplemented from LIEF::MachO::LoadCommand.

◆ print()

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

Reimplemented from LIEF::MachO::LoadCommand.

◆ symbols_format()

uint32_t LIEF::MachO::DyldChainedFixups::symbols_format ( ) const
inline

The compression algorithm (if any) used to store the symbols 0 means uncompressed while 1 means zlib compressed.

As far of the version v852.2 of dyld loader, it only supports uncompressed format


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