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
COFF
RegularHeader.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#ifndef LIEF_COFF_REGULAR_HEADER_H
16
#define LIEF_COFF_REGULAR_HEADER_H
17
#include "
LIEF/COFF/Header.hpp
"
18
#include "
LIEF/visibility.h
"
19
#include <cstdint>
20
21
22
namespace
LIEF::COFF
{
23
25
class
LIEF_API
RegularHeader
:
public
Header
{
26
public
:
27
RegularHeader
() :
28
Header
(
KIND
::REGULAR) {}
29
31
static
std::unique_ptr<RegularHeader>
create
(
BinaryStream
& stream);
32
33
RegularHeader
&
operator=
(
const
RegularHeader
&) =
default
;
34
RegularHeader
(
const
RegularHeader
&) =
default
;
35
36
RegularHeader
&
operator=
(
RegularHeader
&&) =
default
;
37
RegularHeader
(
RegularHeader
&&) =
default
;
38
39
std::unique_ptr<Header>
clone
()
const override
{
40
return
std::unique_ptr<Header>(
new
RegularHeader
(*
this
));
41
}
42
44
uint16_t
sizeof_optionalheader
()
const
{
45
return
sizeof_optionalheader_;
46
}
47
49
uint16_t
characteristics
()
const
{
50
return
characteristics_;
51
}
52
53
void
sizeof_optionalheader
(uint16_t value) {
54
sizeof_optionalheader_ = value;
55
}
56
57
void
characteristics
(uint16_t value) {
58
characteristics_ = value;
59
}
60
61
static
bool
classof
(
const
Header
* header) {
62
return
header->
kind
() ==
Header::KIND::REGULAR
;
63
}
64
65
~RegularHeader
()
override
=
default
;
66
67
std::string
to_string
()
const override
;
68
69
protected
:
70
uint16_t sizeof_optionalheader_ = 0;
71
uint16_t characteristics_ = 0;
72
};
73
74
}
75
76
#endif
Header.hpp
LIEF::BinaryStream
Class that is used to a read stream of data from different sources.
Definition
BinaryStream.hpp:34
LIEF::COFF::Header::Header
Header()=default
LIEF::COFF::Header::kind
KIND kind() const
The type of this header: whether it is regular or using the /bigobj format.
Definition
COFF/Header.hpp:61
LIEF::COFF::Header::KIND
KIND
Definition
COFF/Header.hpp:34
LIEF::COFF::Header::KIND::REGULAR
@ REGULAR
Definition
COFF/Header.hpp:36
LIEF::COFF::RegularHeader::RegularHeader
RegularHeader()
Definition
RegularHeader.hpp:27
LIEF::COFF::RegularHeader::RegularHeader
RegularHeader(const RegularHeader &)=default
LIEF::COFF::RegularHeader::operator=
RegularHeader & operator=(RegularHeader &&)=default
LIEF::COFF::RegularHeader::sizeof_optionalheader
uint16_t sizeof_optionalheader() const
The size of the optional header which follows this header (should be 0).
Definition
RegularHeader.hpp:44
LIEF::COFF::RegularHeader::characteristics
void characteristics(uint16_t value)
Definition
RegularHeader.hpp:57
LIEF::COFF::RegularHeader::RegularHeader
RegularHeader(RegularHeader &&)=default
LIEF::COFF::RegularHeader::clone
std::unique_ptr< Header > clone() const override
Definition
RegularHeader.hpp:39
LIEF::COFF::RegularHeader::sizeof_optionalheader
void sizeof_optionalheader(uint16_t value)
Definition
RegularHeader.hpp:53
LIEF::COFF::RegularHeader::to_string
std::string to_string() const override
LIEF::COFF::RegularHeader::classof
static bool classof(const Header *header)
Definition
RegularHeader.hpp:61
LIEF::COFF::RegularHeader::create
static std::unique_ptr< RegularHeader > create(BinaryStream &stream)
Create a RegularHeader from the given stream.
LIEF::COFF::RegularHeader::characteristics
uint16_t characteristics() const
Characteristics.
Definition
RegularHeader.hpp:49
LIEF::COFF::RegularHeader::~RegularHeader
~RegularHeader() override=default
LIEF::COFF::RegularHeader::operator=
RegularHeader & operator=(const RegularHeader &)=default
LIEF::COFF
Definition
AuxiliarySymbol.hpp:29
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:44
Generated by
1.19.0