LIEF: Library to Instrument Executable Formats
Version 1.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
* 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_COFF_REGULAR_HEADER_H
17
#define LIEF_COFF_REGULAR_HEADER_H
18
#include <cstdint>
19
#include "
LIEF/COFF/Header.hpp
"
20
#include "
LIEF/visibility.h
"
21
22
namespace
LIEF
{
23
namespace
COFF
{
24
26
class
LIEF_API
RegularHeader
:
public
Header
{
27
public
:
28
RegularHeader
() :
29
Header
(
KIND
::REGULAR) {}
30
32
static
std::unique_ptr<RegularHeader>
create
(
BinaryStream
& stream);
33
34
RegularHeader
&
operator=
(
const
RegularHeader
&) =
default
;
35
RegularHeader
(
const
RegularHeader
&) =
default
;
36
37
RegularHeader
&
operator=
(
RegularHeader
&&) =
default
;
38
RegularHeader
(
RegularHeader
&&) =
default
;
39
40
std::unique_ptr<Header>
clone
()
const override
{
41
return
std::unique_ptr<Header>(
new
RegularHeader
(*
this
));
42
}
43
45
uint16_t
sizeof_optionalheader
()
const
{
46
return
sizeof_optionalheader_;
47
}
48
50
uint16_t
characteristics
()
const
{
51
return
characteristics_;
52
}
53
54
void
sizeof_optionalheader
(uint16_t value) {
55
sizeof_optionalheader_ = value;
56
}
57
58
void
characteristics
(uint16_t value) {
59
characteristics_ = value;
60
}
61
62
static
bool
classof
(
const
Header
* header) {
63
return
header->
kind
() ==
Header::KIND::REGULAR
;
64
}
65
66
~RegularHeader
()
override
=
default
;
67
68
std::string
to_string
()
const override
;
69
70
protected
:
71
uint16_t sizeof_optionalheader_ = 0;
72
uint16_t characteristics_ = 0;
73
};
74
75
}
76
}
77
#endif
Header.hpp
LIEF::BinaryStream
Class that is used to a read stream of data from different sources.
Definition
BinaryStream.hpp:33
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:62
LIEF::COFF::Header::KIND
KIND
Definition
COFF/Header.hpp:35
LIEF::COFF::Header::KIND::REGULAR
@ REGULAR
Definition
COFF/Header.hpp:37
LIEF::COFF::RegularHeader::RegularHeader
RegularHeader()
Definition
RegularHeader.hpp:28
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 that follows this header (should be 0).
Definition
RegularHeader.hpp:45
LIEF::COFF::RegularHeader::characteristics
void characteristics(uint16_t value)
Definition
RegularHeader.hpp:58
LIEF::COFF::RegularHeader::RegularHeader
RegularHeader(RegularHeader &&)=default
LIEF::COFF::RegularHeader::clone
std::unique_ptr< Header > clone() const override
Definition
RegularHeader.hpp:40
LIEF::COFF::RegularHeader::sizeof_optionalheader
void sizeof_optionalheader(uint16_t value)
Definition
RegularHeader.hpp:54
LIEF::COFF::RegularHeader::to_string
std::string to_string() const override
LIEF::COFF::RegularHeader::classof
static bool classof(const Header *header)
Definition
RegularHeader.hpp:62
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:50
LIEF::COFF::RegularHeader::~RegularHeader
~RegularHeader() override=default
LIEF::COFF::RegularHeader::operator=
RegularHeader & operator=(const RegularHeader &)=default
LIEF::COFF
Definition
AuxiliarySymbol.hpp:29
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:43
Generated by
1.17.0