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
PE
debug
Repro.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_REPRO_H
17
#define LIEF_PE_REPRO_H
18
#include <ostream>
19
#include <vector>
20
21
#include "
LIEF/visibility.h
"
22
#include "
LIEF/PE/debug/Debug.hpp
"
23
#include "
LIEF/span.hpp
"
24
25
namespace
LIEF
{
26
namespace
PE
{
27
28
class
Builder
;
29
class
Parser
;
30
36
class
LIEF_API
Repro
:
public
Debug
{
37
38
friend
class
Builder
;
39
friend
class
Parser
;
40
41
public
:
42
Repro
() :
43
Debug
{
Debug
::
TYPES
::REPRO}
44
{}
45
46
Repro
(std::vector<uint8_t>
hash
) :
47
Debug
{
Debug
::
TYPES
::REPRO},
48
hash_{std::move(
hash
)}
49
{}
50
51
Repro
(
const
details::pe_debug& dbg, std::vector<uint8_t>
hash
,
Section
* sec) :
52
Debug
{dbg, sec},
53
hash_{std::move(
hash
)}
54
{}
55
56
Repro
(
const
details::pe_debug& dbg,
Section
* sec) :
57
Debug
{dbg, sec}
58
{}
59
60
Repro
(
const
Repro
& other) =
default
;
61
Repro
&
operator=
(
const
Repro
& other) =
default
;
62
63
Repro
(
Repro
&&) =
default
;
64
Repro
&
operator=
(
Repro
&& other) =
default
;
65
67
span<const uint8_t>
hash
()
const
{
68
return
hash_;
69
}
70
71
span<uint8_t>
hash
() {
72
return
hash_;
73
}
74
75
void
hash
(std::vector<uint8_t> h) {
76
hash_ = std::move(h);
77
}
78
79
std::unique_ptr<Debug>
clone
()
const override
{
80
return
std::unique_ptr<Debug>(
new
Repro
(*
this
));
81
}
82
83
static
bool
classof
(
const
Debug
* debug) {
84
return
debug->type() ==
Debug::TYPES::REPRO
;
85
}
86
87
void
accept
(
Visitor
& visitor)
const override
;
88
89
std::string
to_string
()
const override
;
90
91
~Repro
()
override
=
default
;
92
93
protected
:
94
std::vector<uint8_t> hash_;
95
};
96
97
}
// Namespace PE
98
}
// Namespace LIEF
99
100
#endif
LIEF::PE::Builder
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition
PE/Builder.hpp:45
LIEF::PE::Debug::Debug
Debug()=default
LIEF::PE::Debug::TYPES
TYPES
The entry types.
Definition
debug/Debug.hpp:46
LIEF::PE::Debug::TYPES::REPRO
@ REPRO
PE determinism or reproducibility information.
Definition
debug/Debug.hpp:94
LIEF::PE::Parser
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition
PE/Parser.hpp:52
LIEF::PE::Repro::hash
span< uint8_t > hash()
Definition
Repro.hpp:71
LIEF::PE::Repro::operator=
Repro & operator=(Repro &&other)=default
LIEF::PE::Repro::Repro
Repro(Repro &&)=default
LIEF::PE::Repro::hash
void hash(std::vector< uint8_t > h)
Definition
Repro.hpp:75
LIEF::PE::Repro::accept
void accept(Visitor &visitor) const override
LIEF::PE::Repro::Builder
friend class Builder
Definition
Repro.hpp:38
LIEF::PE::Repro::to_string
std::string to_string() const override
LIEF::PE::Repro::Repro
Repro(std::vector< uint8_t > hash)
Definition
Repro.hpp:46
LIEF::PE::Repro::classof
static bool classof(const Debug *debug)
Definition
Repro.hpp:83
LIEF::PE::Repro::~Repro
~Repro() override=default
LIEF::PE::Repro::Repro
Repro(const Repro &other)=default
LIEF::PE::Repro::Repro
Repro(const details::pe_debug &dbg, Section *sec)
Definition
Repro.hpp:56
LIEF::PE::Repro::Parser
friend class Parser
Definition
Repro.hpp:39
LIEF::PE::Repro::hash
span< const uint8_t > hash() const
The hash associated with the reproducible build.
Definition
Repro.hpp:67
LIEF::PE::Repro::Repro
Repro()
Definition
Repro.hpp:42
LIEF::PE::Repro::operator=
Repro & operator=(const Repro &other)=default
LIEF::PE::Repro::Repro
Repro(const details::pe_debug &dbg, std::vector< uint8_t > hash, Section *sec)
Definition
Repro.hpp:51
LIEF::PE::Repro::clone
std::unique_ptr< Debug > clone() const override
Definition
Repro.hpp:79
LIEF::PE::Section
Class which represents a PE section.
Definition
PE/Section.hpp:46
LIEF::Visitor
Definition
Visitor.hpp:210
Debug.hpp
LIEF::PE
Namespace related to the LIEF's PE module.
Definition
Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
LIEF::span
tcb::span< ElementType, Extent > span
Definition
span.hpp:22
span.hpp
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.17.0