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

Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used to get a LIEF::PE::Binary. More...

#include <Parser.hpp>

Inheritance diagram for LIEF::PE::Parser:
Collaboration diagram for LIEF::PE::Parser:

Public Member Functions

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

Static Public Member Functions

static bool is_valid_import_name (const std::string &name)
 Check if the given name is a valid import.
 
static bool is_valid_dll_name (const std::string &name)
 Check if the given name is a valid DLL name.
 
static std::unique_ptr< Binaryparse (const std::string &filename, const ParserConfig &conf=ParserConfig::all())
 Parse a PE binary from the given filename.
 
static std::unique_ptr< Binaryparse (std::vector< uint8_t > data, const ParserConfig &conf=ParserConfig::all())
 Parse a PE binary from a data buffer.
 
static std::unique_ptr< Binaryparse (std::unique_ptr< BinaryStream > stream, const ParserConfig &conf=ParserConfig::all())
 Parse a PE binary from the given BinaryStream.
 
- 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 size_t MAX_DATA_SIZE = 3_GB
 Maximum size of the data read.
 
static constexpr size_t MAX_TLS_CALLBACKS = 3000
 
static constexpr size_t MAX_DLL_NAME_SIZE = 255
 
static constexpr size_t MAX_PADDING_SIZE = 1_GB
 Max size of the padding section.
 

Detailed Description

Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used to get a LIEF::PE::Binary.

Constructor & Destructor Documentation

◆ Parser()

LIEF::PE::Parser::Parser ( const Parser & copy)
delete

Member Function Documentation

◆ is_valid_dll_name()

static bool LIEF::PE::Parser::is_valid_dll_name ( const std::string & name)
static

Check if the given name is a valid DLL name.

This check verifies that:

  1. The name of the DLL is at 4
  2. All the characters are printable

◆ is_valid_import_name()

static bool LIEF::PE::Parser::is_valid_import_name ( const std::string & name)
static

Check if the given name is a valid import.

This check verified that:

  1. The name is not too large or empty (cf. https://stackoverflow.com/a/23340781)
  2. All the characters are printable

◆ operator=()

Parser & LIEF::PE::Parser::operator= ( const Parser & copy)
delete

◆ parse() [1/3]

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

Parse a PE binary from the given filename.

◆ parse() [2/3]

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

Parse a PE binary from the given BinaryStream.

◆ parse() [3/3]

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

Parse a PE binary from a data buffer.

Member Data Documentation

◆ MAX_DATA_SIZE

size_t LIEF::PE::Parser::MAX_DATA_SIZE = 3_GB
staticconstexpr

Maximum size of the data read.

◆ MAX_DLL_NAME_SIZE

size_t LIEF::PE::Parser::MAX_DLL_NAME_SIZE = 255
staticconstexpr

◆ MAX_PADDING_SIZE

size_t LIEF::PE::Parser::MAX_PADDING_SIZE = 1_GB
staticconstexpr

Max size of the padding section.

◆ MAX_TLS_CALLBACKS

size_t LIEF::PE::Parser::MAX_TLS_CALLBACKS = 3000
staticconstexpr

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