LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
MsManifestBinaryID.hpp
Go to the documentation of this file.
1
2/* Copyright 2017 - 2023 R. Thomas
3 * Copyright 2017 - 2023 Quarkslab
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17#ifndef LIEF_PE_ATTRIBUTES_MS_MANIFEST_BINARY_ID_H
18#define LIEF_PE_ATTRIBUTES_MS_MANIFEST_BINARY_ID_H
19
20#include "LIEF/visibility.h"
22
23namespace LIEF {
24namespace PE {
36
37 friend class Parser;
38 friend class SignatureParser;
39
40 public:
42 MsManifestBinaryID(std::string binid) :
43 Attribute(Attribute::TYPE::MS_PLATFORM_MANIFEST_BINARY_ID),
44 id_(std::move(binid))
45 {}
46
47 MsManifestBinaryID(const MsManifestBinaryID&) = default;
48 MsManifestBinaryID& operator=(const MsManifestBinaryID&) = default;
49 std::string print() const override {
52 return id_;
53 }
54 const std::string& manifest_id() const {
57 return id_;
58 }
59
60 void manifest_id(const std::string& id) {
61 id_ = id;
62 }
63
64 std::unique_ptr<Attribute> clone() const override {
65 return std::unique_ptr<Attribute>(new MsManifestBinaryID{*this});
66 }
67
68 static bool classof(const Attribute* attr) {
69 return attr->type() == Attribute::TYPE::MS_PLATFORM_MANIFEST_BINARY_ID;
70 }
71
72 void accept(Visitor& visitor) const override;
73
74 virtual ~MsManifestBinaryID() = default;
75
76 private:
77 std::string id_;
78};
79
80}
81}
82
83#endif
Attribute.hpp
LIEF::PE::Attribute
Interface over PKCS #7 attribute.
Definition PE/signature/Attribute.hpp:29
LIEF::PE::Attribute::type
virtual TYPE type() const
Concrete type of the attribute.
Definition PE/signature/Attribute.hpp:62
LIEF::PE::MsManifestBinaryID
Interface over the structure described by the OID 1.3.6.1.4.1.311.10.3.28 (szOID_PLATFORM_MANIFEST_BI...
Definition MsManifestBinaryID.hpp:35
LIEF::PE::MsManifestBinaryID::clone
std::unique_ptr< Attribute > clone() const override
Definition MsManifestBinaryID.hpp:64
LIEF::PE::MsManifestBinaryID::manifest_id
const std::string & manifest_id() const
The manifest id as a string.
Definition MsManifestBinaryID.hpp:56
LIEF::PE::MsManifestBinaryID::MsManifestBinaryID
MsManifestBinaryID(std::string binid)
Definition MsManifestBinaryID.hpp:42
LIEF::PE::MsManifestBinaryID::manifest_id
void manifest_id(const std::string &id)
Definition MsManifestBinaryID.hpp:60
LIEF::PE::MsManifestBinaryID::~MsManifestBinaryID
virtual ~MsManifestBinaryID()=default
LIEF::PE::MsManifestBinaryID::print
std::string print() const override
Print information about the attribute.
Definition MsManifestBinaryID.hpp:51
LIEF::PE::MsManifestBinaryID::operator=
MsManifestBinaryID & operator=(const MsManifestBinaryID &)=default
LIEF::PE::MsManifestBinaryID::MsManifestBinaryID
MsManifestBinaryID(const MsManifestBinaryID &)=default
LIEF::PE::MsManifestBinaryID::classof
static bool classof(const Attribute *attr)
Definition MsManifestBinaryID.hpp:68
LIEF::PE::MsManifestBinaryID::accept
void accept(Visitor &visitor) const override
LIEF::PE::MsManifestBinaryID::MsManifestBinaryID
MsManifestBinaryID()=delete
LIEF::PE
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41