LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
SpcSpOpusInfo.hpp
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"
22#include "LIEF/errors.hpp"
23#include "LIEF/PE/signature/Attribute.hpp"
24
25
26namespace LIEF {
27class VectorStream;
28namespace PE {
29
41class LIEF_API SpcSpOpusInfo : public Attribute {
42
43 friend class Parser;
44 friend class SignatureParser;
45
46 public:
47 SpcSpOpusInfo(std::string program_name, std::string more_info) :
48 Attribute(Attribute::TYPE::SPC_SP_OPUS_INFO),
49 program_name_(std::move(program_name)),
50 more_info_(std::move(more_info))
51 {}
52
54 SpcSpOpusInfo("", "")
55 {}
56
57 SpcSpOpusInfo(const SpcSpOpusInfo&) = default;
58 SpcSpOpusInfo& operator=(const SpcSpOpusInfo&) = default;
59
60 std::unique_ptr<Attribute> clone() const override {
61 return std::unique_ptr<Attribute>(new SpcSpOpusInfo{*this});
62 }
63
65 const std::string& program_name() const {
66 return program_name_;
67 }
68
70 const std::string& more_info() const {
71 return more_info_;
72 }
73
75 std::string print() const override;
76
77 static bool classof(const Attribute* attr) {
78 return attr->type() == Attribute::TYPE::SPC_SP_OPUS_INFO;
79 }
80
81 void accept(Visitor& visitor) const override;
82
83 ~SpcSpOpusInfo() override = default;
84
85 private:
86 std::string program_name_;
87 std::string more_info_;
88};
89
90}
91}
92
93#endif
Interface over PKCS #7 attribute.
Definition Attribute.hpp:30
virtual TYPE type() const
Concrete type of the attribute.
Definition Attribute.hpp:60
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
Interface over the structure described by the OID 1.3.6.1.4.1.311.2.1.12
Definition SpcSpOpusInfo.hpp:41
const std::string & program_name() const
Program description provided by the publisher.
Definition SpcSpOpusInfo.hpp:65
std::string print() const override
Print information about the attribute.
const std::string & more_info() const
Other information such as an url.
Definition SpcSpOpusInfo.hpp:70
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32