LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
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:
Inheritance graph
[legend]
Collaboration diagram for LIEF::ELF::Parser:
Collaboration graph
[legend]

Public Types

enum  ELF_TYPE { ELF_UNKNOWN , ELF32 , ELF64 }
 

Public Member Functions

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

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 Function Documentation

◆ 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

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