LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
LIEF::ELF::Parser Class Reference

Class which parses and transforms an ELF file into a ELF::Binary object. More...

#include <Parser.hpp>

Inheritance diagram for LIEF::ELF::Parser:
Collaboration diagram for LIEF::ELF::Parser:

Public Types

enum  ELF_TYPE { ELF_UNKNOWN , ELF32 , ELF64 }
 

Public Member Functions

Parseroperator= (const Parser &)=delete
 
 Parser (const Parser &)=delete
 
 ~Parser () override
 

Static Public Member Functions

static std::unique_ptr< Binaryparse (const std::string &file, const ParserConfig &conf=ParserConfig::all())
 Parse an ELF file and return a LIEF::ELF::Binary object.
 
static std::unique_ptr< Binaryparse (const std::vector< uint8_t > &data, const ParserConfig &conf=ParserConfig::all())
 Parse the given raw data as an ELF binary and return a LIEF::ELF::Binary object.
 
static std::unique_ptr< Binaryparse (std::unique_ptr< BinaryStream > stream, const ParserConfig &conf=ParserConfig::all())
 Parse the ELF binary from the given stream and return a LIEF::ELF::Binary object.
 
- Static Public Member Functions inherited from LIEF::Parser
static std::unique_ptr< Binaryparse (const std::string &filename)
 Construct an LIEF::Binary from the given filename.
 
static std::unique_ptr< Binaryparse (const std::vector< uint8_t > &raw)
 Construct an LIEF::Binary from the given raw data.
 
static std::unique_ptr< Binaryparse (std::unique_ptr< BinaryStream > stream)
 Construct an LIEF::Binary from the given stream.
 

Static Public Attributes

static constexpr uint32_t NB_MAX_SYMBOLS = 1000000
 
static constexpr uint32_t DELTA_NB_SYMBOLS = 3000
 
static constexpr uint32_t NB_MAX_BUCKETS = NB_MAX_SYMBOLS
 
static constexpr uint32_t NB_MAX_CHAINS = 1000000
 
static constexpr uint32_t NB_MAX_SEGMENTS = 10000
 
static constexpr uint32_t NB_MAX_RELOCATIONS = 3000000
 
static constexpr uint32_t NB_MAX_DYNAMIC_ENTRIES = 1000
 
static constexpr uint32_t NB_MAX_MASKWORD = 512
 
static constexpr uint32_t MAX_SEGMENT_SIZE = 3_GB
 

Detailed Description

Class which parses and transforms an ELF file into a ELF::Binary object.

Member Enumeration Documentation

◆ ELF_TYPE

Enumerator
ELF_UNKNOWN 
ELF32 
ELF64 

Constructor & Destructor Documentation

◆ Parser()

LIEF::ELF::Parser::Parser ( const Parser & )
delete

◆ ~Parser()

LIEF::ELF::Parser::~Parser ( )
overridevirtual

Reimplemented from LIEF::Parser.

Member Function Documentation

◆ operator=()

Parser & LIEF::ELF::Parser::operator= ( const Parser & )
delete

◆ parse() [1/3]

static std::unique_ptr< Binary > LIEF::ELF::Parser::parse ( const std::string & file,
const ParserConfig & conf = ParserConfig::all() )
static

Parse an ELF file and return a LIEF::ELF::Binary object.

For weird binaries (e.g. sectionless) you can choose which method to use for counting dynamic symbols

Parameters
[in]filePath to the ELF binary
[in]confOptional configuration for the parser
Returns
LIEF::ELF::Binary as a unique_ptr

◆ parse() [2/3]

static std::unique_ptr< Binary > LIEF::ELF::Parser::parse ( const std::vector< uint8_t > & data,
const ParserConfig & conf = ParserConfig::all() )
static

Parse the given raw data as an ELF binary and return a LIEF::ELF::Binary object.

For weird binaries (e.g. sectionless) you can choose which method use to count dynamic symbols

Parameters
[in]dataRaw ELF as a std::vector of uint8_t
[in]confOptional configuration for the parser
Returns
LIEF::ELF::Binary

◆ parse() [3/3]

static std::unique_ptr< Binary > LIEF::ELF::Parser::parse ( std::unique_ptr< BinaryStream > stream,
const ParserConfig & conf = ParserConfig::all() )
static

Parse the ELF binary from the given stream and return a LIEF::ELF::Binary object.

For weird binaries (e.g. sectionless) you can choose which method use to count dynamic symbols

Parameters
[in]streamThe stream which wraps the ELF binary
[in]confOptional configuration for the parser
Returns
LIEF::ELF::Binary

Member Data Documentation

◆ DELTA_NB_SYMBOLS

uint32_t LIEF::ELF::Parser::DELTA_NB_SYMBOLS = 3000
staticconstexpr

◆ MAX_SEGMENT_SIZE

uint32_t LIEF::ELF::Parser::MAX_SEGMENT_SIZE = 3_GB
staticconstexpr

◆ NB_MAX_BUCKETS

uint32_t LIEF::ELF::Parser::NB_MAX_BUCKETS = NB_MAX_SYMBOLS
staticconstexpr

◆ NB_MAX_CHAINS

uint32_t LIEF::ELF::Parser::NB_MAX_CHAINS = 1000000
staticconstexpr

◆ NB_MAX_DYNAMIC_ENTRIES

uint32_t LIEF::ELF::Parser::NB_MAX_DYNAMIC_ENTRIES = 1000
staticconstexpr

◆ NB_MAX_MASKWORD

uint32_t LIEF::ELF::Parser::NB_MAX_MASKWORD = 512
staticconstexpr

◆ NB_MAX_RELOCATIONS

uint32_t LIEF::ELF::Parser::NB_MAX_RELOCATIONS = 3000000
staticconstexpr

◆ NB_MAX_SEGMENTS

uint32_t LIEF::ELF::Parser::NB_MAX_SEGMENTS = 10000
staticconstexpr

◆ NB_MAX_SYMBOLS

uint32_t LIEF::ELF::Parser::NB_MAX_SYMBOLS = 1000000
staticconstexpr

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