LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
SpcSpOpusInfo.hpp
Go to the documentation of this file.
1
2/* Copyright 2017 - 2024 R. Thomas
3 * Copyright 2017 - 2024 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_SPC_SP_OPUS_INFO_H
18#define LIEF_PE_ATTRIBUTES_SPC_SP_OPUS_INFO_H
19#include <memory>
20
21#include "LIEF/visibility.h"
23
24
25namespace LIEF {
26namespace PE {
27class LIEF_API SpcSpOpusInfo : public Attribute {
40
41 friend class Parser;
42 friend class SignatureParser;
43
44 public:
45 SpcSpOpusInfo(std::string program_name, std::string more_info) :
46 Attribute(Attribute::TYPE::SPC_SP_OPUS_INFO),
47 program_name_(std::move(program_name)),
48 more_info_(std::move(more_info))
49 {}
50
52 SpcSpOpusInfo("", "")
53 {}
54
55 SpcSpOpusInfo(const SpcSpOpusInfo&) = default;
56 SpcSpOpusInfo& operator=(const SpcSpOpusInfo&) = default;
57
58 std::unique_ptr<Attribute> clone() const override {
59 return std::unique_ptr<Attribute>(new SpcSpOpusInfo{*this});
60 }
61 const std::string& program_name() const {
64 return program_name_;
65 }
66 const std::string& more_info() const {
69 return more_info_;
70 }
71 std::string print() const override;
74
75 static bool classof(const Attribute* attr) {
76 return attr->type() == Attribute::TYPE::SPC_SP_OPUS_INFO;
77 }
78
79 void accept(Visitor& visitor) const override;
80
81 ~SpcSpOpusInfo() override = default;
82
83 private:
84 std::string program_name_;
85 std::string more_info_;
86};
87
88}
89}
90
91#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::SpcSpOpusInfo
Interface over the structure described by the OID 1.3.6.1.4.1.311.2.1.12
Definition SpcSpOpusInfo.hpp:39
LIEF::PE::SpcSpOpusInfo::program_name
const std::string & program_name() const
Program description provided by the publisher.
Definition SpcSpOpusInfo.hpp:63
LIEF::PE::SpcSpOpusInfo::SpcSpOpusInfo
SpcSpOpusInfo(std::string program_name, std::string more_info)
Definition SpcSpOpusInfo.hpp:45
LIEF::PE::SpcSpOpusInfo::clone
std::unique_ptr< Attribute > clone() const override
Definition SpcSpOpusInfo.hpp:58
LIEF::PE::SpcSpOpusInfo::operator=
SpcSpOpusInfo & operator=(const SpcSpOpusInfo &)=default
LIEF::PE::SpcSpOpusInfo::print
std::string print() const override
Print information about the attribute.
LIEF::PE::SpcSpOpusInfo::SpcSpOpusInfo
SpcSpOpusInfo()
Definition SpcSpOpusInfo.hpp:51
LIEF::PE::SpcSpOpusInfo::accept
void accept(Visitor &visitor) const override
LIEF::PE::SpcSpOpusInfo::more_info
const std::string & more_info() const
Other information such as an url.
Definition SpcSpOpusInfo.hpp:68
LIEF::PE::SpcSpOpusInfo::~SpcSpOpusInfo
~SpcSpOpusInfo() override=default
LIEF::PE::SpcSpOpusInfo::classof
static bool classof(const Attribute *attr)
Definition SpcSpOpusInfo.hpp:75
LIEF::PE::SpcSpOpusInfo::SpcSpOpusInfo
SpcSpOpusInfo(const SpcSpOpusInfo &)=default
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