15#ifndef LIEF_COFF_PARSER_H
16#define LIEF_COFF_PARSER_H
42 static LIEF_API std::unique_ptr<Binary>
43 parse(std::unique_ptr<BinaryStream> stream,
47 static LIEF_API std::unique_ptr<Binary>
53 template<
class PathT, enable_if_path_t<PathT> = 0>
54 static std::unique_ptr<Binary>
57 return parse(file.string(), config);
65 friend bool operator<(SymSec lhs, SymSec rhs) {
66 return lhs.sec_idx < rhs.sec_idx;
69 friend bool operator==(SymSec lhs, SymSec rhs) {
70 return lhs.sec_idx == rhs.sec_idx && lhs.symbol == rhs.symbol;
73 friend bool operator!=(SymSec lhs, SymSec rhs) {
90 Parser(std::unique_ptr<BinaryStream> stream,
const ParserConfig& config,
101 std::unique_ptr<BinaryStream> stream_;
102 std::unique_ptr<Binary> bin_;
105 std::map<uint32_t, size_t> memoize_coff_str_;
106 std::map<size_t, Symbol*> symbol_idx_;
Class that represents a COFF Binary.
Definition COFF/Binary.hpp:45
Class used to configure the COFF parser.
Definition COFF/ParserConfig.hpp:23
static const ParserConfig & default_conf()
Definition COFF/ParserConfig.hpp:25
static std::unique_ptr< Binary > parse(std::unique_ptr< BinaryStream > stream, const ParserConfig &config=ParserConfig::default_conf())
Parse the COFF binary referenced by the stream argument with the given config.
std::vector< SymSec > SymSecMap
<=> std::unordered_multimap<section index, Symbol*>
Definition COFF/Parser.hpp:79
static std::unique_ptr< Binary > parse(const PathT &file, const ParserConfig &config=ParserConfig::default_conf())
Same as parse(std::string_view, const ParserConfig&) but the file is given as a std::filesystem::path...
Definition COFF/Parser.hpp:55
static constexpr size_t MAX_NB_SECTIONS
Definition COFF/Parser.hpp:38
static std::unique_ptr< Binary > parse(std::string_view file, const ParserConfig &config=ParserConfig::default_conf())
Parse the COFF binary pointed by the file argument with the given config.
This class represents a COFF section.
Definition COFF/Section.hpp:40
This class represents a string located in the COFF string table.
Definition String.hpp:34
This class represents a COFF symbol.
Definition COFF/Symbol.hpp:36
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:118
#define LIEF_MAYBE_UNUSED
Definition compiler_attributes.hpp:62
Definition AuxiliarySymbol.hpp:29
#define LIEF_API
Definition visibility.h:44
#define LIEF_LOCAL
Definition visibility.h:45