LIEF: Library to Instrument Executable Formats Version 0.15.1
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 {
25
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
49
51 std::string print() const override {
52 return id_;
53 }
54
56 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
Interface over PKCS #7 attribute.
Definition PE/signature/Attribute.hpp:28
TYPE
Definition PE/signature/Attribute.hpp:34
virtual TYPE type() const
Concrete type of the attribute.
Definition PE/signature/Attribute.hpp:61
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
std::unique_ptr< Attribute > clone() const override
Definition MsManifestBinaryID.hpp:64
const std::string & manifest_id() const
The manifest id as a string.
Definition MsManifestBinaryID.hpp:56
MsManifestBinaryID(std::string binid)
Definition MsManifestBinaryID.hpp:42
void manifest_id(const std::string &id)
Definition MsManifestBinaryID.hpp:60
virtual ~MsManifestBinaryID()=default
std::string print() const override
Print information about the attribute.
Definition MsManifestBinaryID.hpp:51
MsManifestBinaryID & operator=(const MsManifestBinaryID &)=default
MsManifestBinaryID(const MsManifestBinaryID &)=default
static bool classof(const Attribute *attr)
Definition MsManifestBinaryID.hpp:68
void accept(Visitor &visitor) const override
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:47
Definition SignatureParser.hpp:37
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41