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
signature
attributes
GenericType.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_ATTRIBUTES_GENERIC_TYPE_H
17
#define LIEF_PE_ATTRIBUTES_GENERIC_TYPE_H
18
#include <memory>
19
#include <vector>
20
21
#include "
LIEF/visibility.h
"
22
#include "
LIEF/span.hpp
"
23
#include "
LIEF/PE/signature/Attribute.hpp
"
24
#include "
LIEF/PE/signature/types.hpp
"
25
26
namespace
LIEF
{
27
class
VectorStream
;
28
namespace
PE
{
29
31
class
LIEF_API
GenericType
:
public
Attribute
{
32
friend
class
Parser
;
33
friend
class
SignatureParser
;
34
35
public
:
36
GenericType
() :
37
Attribute
(
Attribute
::
TYPE
::GENERIC_TYPE)
38
{}
39
GenericType
(
oid_t
oid
, std::vector<uint8_t> raw) :
40
Attribute
(
Attribute
::
TYPE
::GENERIC_TYPE),
41
oid_{std::move(
oid
)},
42
raw_{std::move(raw)}
43
{}
44
GenericType
(
const
GenericType
&) =
default
;
45
GenericType
&
operator=
(
const
GenericType
&) =
default
;
46
47
std::unique_ptr<Attribute>
clone
()
const override
{
48
return
std::unique_ptr<Attribute>(
new
GenericType
{*
this
});
49
}
50
52
const
oid_t
&
oid
()
const
{
53
return
oid_;
54
}
55
57
span<const uint8_t>
raw_content
()
const
{
58
return
raw_;
59
}
60
62
std::string
print
()
const override
;
63
64
void
accept
(
Visitor
& visitor)
const override
;
65
66
~GenericType
()
override
=
default
;
67
68
static
bool
classof
(
const
Attribute
* attr) {
69
return
attr->
type
() ==
Attribute::TYPE::GENERIC_TYPE
;
70
}
71
72
private
:
73
oid_t
oid_;
74
std::vector<uint8_t> raw_;
75
};
76
77
}
78
}
79
80
#endif
Attribute.hpp
types.hpp
LIEF::PE::Attribute::TYPE
TYPE
Definition
PE/signature/Attribute.hpp:35
LIEF::PE::Attribute::TYPE::GENERIC_TYPE
@ GENERIC_TYPE
Definition
PE/signature/Attribute.hpp:38
LIEF::PE::Attribute::Attribute
Attribute()=delete
LIEF::PE::Attribute::type
virtual TYPE type() const
Concrete type of the attribute.
Definition
PE/signature/Attribute.hpp:62
LIEF::PE::GenericType::operator=
GenericType & operator=(const GenericType &)=default
LIEF::PE::GenericType::clone
std::unique_ptr< Attribute > clone() const override
Definition
GenericType.hpp:47
LIEF::PE::GenericType::~GenericType
~GenericType() override=default
LIEF::PE::GenericType::accept
void accept(Visitor &visitor) const override
LIEF::PE::GenericType::GenericType
GenericType()
Definition
GenericType.hpp:36
LIEF::PE::GenericType::raw_content
span< const uint8_t > raw_content() const
Original DER blob of the attribute.
Definition
GenericType.hpp:57
LIEF::PE::GenericType::GenericType
GenericType(const GenericType &)=default
LIEF::PE::GenericType::GenericType
GenericType(oid_t oid, std::vector< uint8_t > raw)
Definition
GenericType.hpp:39
LIEF::PE::GenericType::oid
const oid_t & oid() const
OID of the original attribute.
Definition
GenericType.hpp:52
LIEF::PE::GenericType::SignatureParser
friend class SignatureParser
Definition
GenericType.hpp:33
LIEF::PE::GenericType::print
std::string print() const override
Print information about the attribute.
LIEF::PE::GenericType::Parser
friend class Parser
Definition
GenericType.hpp:32
LIEF::PE::GenericType::classof
static bool classof(const Attribute *attr)
Definition
GenericType.hpp:68
LIEF::VectorStream
Definition
VectorStream.hpp:29
LIEF::Visitor
Definition
Visitor.hpp:210
LIEF::PE
Namespace related to the LIEF's PE module.
Definition
Abstract/Header.hpp:32
LIEF::PE::oid_t
std::string oid_t
Definition
PE/signature/types.hpp:23
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