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

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.

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

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