LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
ContentType.hpp
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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_CONTENT_TYPE_H
17#define LIEF_PE_ATTRIBUTES_CONTENT_TYPE_H
18#include <memory>
19
20#include "LIEF/visibility.h"
21#include "LIEF/PE/signature/Attribute.hpp"
22#include "LIEF/PE/signature/types.hpp"
23
24
25namespace LIEF {
26class VectorStream;
27namespace PE {
28
37class LIEF_API ContentType : public Attribute {
38
39 friend class Parser;
40 friend class SignatureParser;
41
42 public:
43 ContentType() :
44 Attribute(Attribute::TYPE::CONTENT_TYPE)
45 {}
46 ContentType(oid_t oid) :
47 Attribute(Attribute::TYPE::CONTENT_TYPE),
48 oid_{std::move(oid)}
49 {}
50 ContentType(const ContentType&) = default;
51 ContentType& operator=(const ContentType&) = default;
52
54 const oid_t& oid() const {
55 return oid_;
56 }
57
59 std::string print() const override;
60
61 std::unique_ptr<Attribute> clone() const override {
62 return std::unique_ptr<Attribute>(new ContentType{*this});
63 }
64
65 static bool classof(const Attribute* attr) {
66 return attr->type() == Attribute::TYPE::CONTENT_TYPE;
67 }
68
69 void accept(Visitor& visitor) const override;
70 ~ContentType() override = default;
71
72 private:
73 oid_t oid_;
74};
75
76}
77}
78
79#endif
Interface over PKCS #7 attribute.
Definition Attribute.hpp:30
Interface over the structure described by the OID 1.2.840.113549.1.9.3 (PKCS #9)
Definition ContentType.hpp:37
std::string print() const override
Print information about the attribute.
const oid_t & oid() const
OID as described in RFC #2985.
Definition ContentType.hpp:54
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
LIEF namespace.
Definition Abstract/Binary.hpp:32