16#ifndef LIEF_PE_PARSER_H
17#define LIEF_PE_PARSER_H
41struct pe_resource_directory_table;
51 static constexpr size_t MAX_DATA_SIZE = 3_GB;
53 static constexpr size_t MAX_TLS_CALLBACKS = 3000;
56 static constexpr size_t MAX_DLL_NAME_SIZE = 255;
59 static constexpr size_t MAX_PADDING_SIZE = 1_GB;
78 static std::unique_ptr<Binary>
parse(
const std::string& filename,
82 static std::unique_ptr<Binary>
parse(std::vector<uint8_t> data,
86 static std::unique_ptr<Binary>
parse(std::unique_ptr<BinaryStream> stream,
93 Parser(
const std::string& file);
94 Parser(std::vector<uint8_t> data);
95 Parser(std::unique_ptr<BinaryStream> stream);
102 template<
typename PE_T>
108 template<
typename PE_T>
113 template<
typename PE_T>
116 template<
typename PE_T>
119 template<
typename PE_T>
122 template<
typename PE_T>
128 std::unique_ptr<Debug> parse_code_view(
const details::pe_debug& debug_info);
129 std::unique_ptr<Debug> parse_pogo(
const details::pe_debug& debug_info);
130 std::unique_ptr<Debug> parse_repro(
const details::pe_debug& debug_info);
132 template<
typename PE_T>
135 template<
typename PE_T>
147 std::unique_ptr<ResourceNode> parse_resource_node(
148 const details::pe_resource_directory_table& directory_table,
149 uint32_t base_offset, uint32_t current_offset, uint32_t depth = 0);
152 PE_TYPE type_ = PE_TYPE::PE32_PLUS;
153 std::unique_ptr<Binary> binary_;
154 std::set<uint32_t> resource_visited_;
155 std::unique_ptr<BinaryStream> stream_;
Class that represents a PE delayed import.
Definition DelayImport.hpp:36
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:47
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< Binary > parse(std::unique_ptr< BinaryStream > stream, const ParserConfig &conf=ParserConfig::all())
Parse a PE binary from the given BinaryStream.
static std::unique_ptr< Binary > parse(std::vector< uint8_t > data, const ParserConfig &conf=ParserConfig::all())
Parse a PE binary from a data buffer.
Parser(const Parser ©)=delete
static std::unique_ptr< Binary > parse(const std::string &filename, const ParserConfig &conf=ParserConfig::all())
Parse a PE binary from the given filename.
Parser & operator=(const Parser ©)=delete
Main interface to parse an executable regardless of its format.
Definition Abstract/Parser.hpp:30
PE_TYPE
Definition PE/enums.hpp:680
LIEF namespace.
Definition Abstract/Binary.hpp:32
result< ok_t > ok_error_t
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:108
This structure is used to tweak the PE Parser (PE::Parser)
Definition PE/ParserConfig.hpp:24
#define LIEF_API
Definition visibility.h:41