LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
PE
PE/ParserConfig.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 Quarkslab
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef LIEF_PE_PARSER_CONFIG_H
17
#define LIEF_PE_PARSER_CONFIG_H
18
#include "
LIEF/visibility.h
"
19
#include <cstdint>
20
#include <optional>
21
#include <ostream>
22
#include <string>
23
24
25
namespace
LIEF::PE
{
26
28
struct
LIEF_API
ParserConfig
{
30
static
const
ParserConfig
&
default_conf
() {
31
static
const
ParserConfig
DEFAULT
;
32
return
DEFAULT
;
33
}
34
36
static
ParserConfig
all
() {
37
ParserConfig
config;
38
config.
parse_exceptions
=
true
;
39
config.
parse_arm64x_binary
=
true
;
40
return
config;
41
}
42
44
bool
parse_signature
=
true
;
45
47
bool
parse_exports
=
true
;
48
50
bool
parse_imports
=
true
;
51
53
bool
parse_rsrc
=
true
;
54
56
bool
parse_reloc
=
true
;
57
62
bool
parse_exceptions
=
false
;
63
68
bool
parse_arm64x_binary
=
false
;
69
73
std::optional<uint64_t>
rebase
;
74
75
std::string
to_string
()
const
;
76
77
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
78
const
ParserConfig
& config) {
79
os << config.
to_string
();
80
return
os;
81
}
82
};
83
84
}
85
86
#endif
LIEF::PE
Namespace related to the LIEF's PE module.
Definition
Abstract/Header.hpp:32
LIEF::PE::IMPHASH_MODE::DEFAULT
@ DEFAULT
Default implementation.
Definition
PE/utils.hpp:35
LIEF::PE::ParserConfig
This structure is used to configure the behavior of the PE Parser (PE::Parser).
Definition
PE/ParserConfig.hpp:28
LIEF::PE::ParserConfig::parse_imports
bool parse_imports
Whether to parse the PE Import Directory.
Definition
PE/ParserConfig.hpp:50
LIEF::PE::ParserConfig::parse_signature
bool parse_signature
Whether to parse the PE Authenticode signature.
Definition
PE/ParserConfig.hpp:44
LIEF::PE::ParserConfig::parse_exceptions
bool parse_exceptions
Whether to parse in-depth exception metadata.
Definition
PE/ParserConfig.hpp:62
LIEF::PE::ParserConfig::parse_rsrc
bool parse_rsrc
Whether to parse the PE resources tree.
Definition
PE/ParserConfig.hpp:53
LIEF::PE::ParserConfig::to_string
std::string to_string() const
LIEF::PE::ParserConfig::rebase
std::optional< uint64_t > rebase
If set, this value holds the original image base from which the binary should be rebased....
Definition
PE/ParserConfig.hpp:73
LIEF::PE::ParserConfig::parse_reloc
bool parse_reloc
Whether to parse PE relocations.
Definition
PE/ParserConfig.hpp:56
LIEF::PE::ParserConfig::parse_exports
bool parse_exports
Whether to parse the PE Export Directory.
Definition
PE/ParserConfig.hpp:47
LIEF::PE::ParserConfig::operator<<
friend std::ostream & operator<<(std::ostream &os, const ParserConfig &config)
Definition
PE/ParserConfig.hpp:77
LIEF::PE::ParserConfig::all
static ParserConfig all()
Returns a configuration that enables all optional parsing features.
Definition
PE/ParserConfig.hpp:36
LIEF::PE::ParserConfig::default_conf
static const ParserConfig & default_conf()
Returns the default configuration for the PE Parser.
Definition
PE/ParserConfig.hpp:30
LIEF::PE::ParserConfig::parse_arm64x_binary
bool parse_arm64x_binary
Whether to parse nested ARM64X binaries.
Definition
PE/ParserConfig.hpp:68
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0