LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
LoadConfigurationV0.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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_LOAD_CONFIGURATION_V0_H
17#define LIEF_PE_LOAD_CONFIGURATION_V0_H
18#include <ostream>
19
20#include "LIEF/visibility.h"
22
23namespace LIEF {
24namespace PE {
25
26namespace details {
27template<class T>
29}
30
33 public:
34 static constexpr VERSION WIN_VERSION = VERSION::SEH;
35
37
40
41 template<class T>
43
44 VERSION version() const override {
45 return WIN_VERSION;
46 }
47
50 uint64_t se_handler_table() const {
51 return se_handler_table_;
52 }
53
55 uint64_t se_handler_count() const {
56 return se_handler_count_;
57 }
58
59 void se_handler_table(uint64_t se_handler_table) {
60 se_handler_table_ = se_handler_table;
61 }
62 void se_handler_count(uint64_t se_handler_count) {
63 se_handler_count_ = se_handler_count;
64 }
65
66 ~LoadConfigurationV0() override = default;
67
68 static bool classof(const LoadConfiguration* config) {
69 return config->version() == WIN_VERSION;
70 }
71
72 void accept(Visitor& visitor) const override;
73
74 std::ostream& print(std::ostream& os) const override;
75
76 protected:
77 uint64_t se_handler_table_ = 0;
78 uint64_t se_handler_count_ = 0;
79};
80}
81}
82
83#endif
LoadConfiguration enhanced with SEH.
Definition LoadConfigurationV0.hpp:32
uint64_t se_handler_table() const
The VA of the sorted table of RVAs of each valid, unique SE handler in the image.
Definition LoadConfigurationV0.hpp:50
VERSION version() const override
(SDK) Version of the structure
Definition LoadConfigurationV0.hpp:44
uint64_t se_handler_count() const
The count of unique handlers in the table.
Definition LoadConfigurationV0.hpp:55
LoadConfigurationV0(const LoadConfigurationV0 &)=default
~LoadConfigurationV0() override=default
void se_handler_table(uint64_t se_handler_table)
Definition LoadConfigurationV0.hpp:59
void accept(Visitor &visitor) const override
LoadConfigurationV0(const details::load_configuration_v0< T > &header)
std::ostream & print(std::ostream &os) const override
static bool classof(const LoadConfiguration *config)
Definition LoadConfigurationV0.hpp:68
LoadConfigurationV0 & operator=(const LoadConfigurationV0 &)=default
void se_handler_count(uint64_t se_handler_count)
Definition LoadConfigurationV0.hpp:62
Class that represents the default PE's LoadConfiguration
Definition LoadConfiguration.hpp:35
virtual VERSION version() const
(SDK) Version of the structure
Definition LoadConfiguration.hpp:64
VERSION
Definition LoadConfiguration.hpp:37
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
Definition LoadConfigurationV0.hpp:28
#define LIEF_API
Definition visibility.h:41
#define LIEF_LOCAL
Definition visibility.h:42