LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
GenericContent.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 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_GENERIC_CONTENT_H
17#define LIEF_PE_GENERIC_CONTENT_H
18
20#include "LIEF/visibility.h"
21#include "LIEF/span.hpp"
22
24
25namespace LIEF {
26namespace PE {
28 friend class SignatureParser;
29
30 public:
33 GenericContent(const GenericContent&) = default;
35
36 std::unique_ptr<Content> clone() const override {
37 return std::unique_ptr<Content>(new GenericContent{*this});
38 }
39
40 const oid_t& oid() const {
41 return oid_;
42 }
43
45 return raw_;
46 }
47
49 return raw_;
50 }
51
52 ~GenericContent() override;
53
54 void print(std::ostream& os) const override;
55 void accept(Visitor& visitor) const override;
56
57 LIEF_API friend std::ostream& operator<<(std::ostream& os,
58 const GenericContent& content) {
59 content.print(os);
60 return os;
61 }
62
63 static bool classof(const ContentInfo::Content* content);
64
65 private:
66 oid_t oid_;
67 std::vector<uint8_t> raw_;
68};
69}
70}
71#endif
Definition ContentInfo.hpp:86
void print(std::ostream &os) const override
span< uint8_t > raw()
Definition GenericContent.hpp:48
static bool classof(const ContentInfo::Content *content)
void accept(Visitor &visitor) const override
GenericContent(const GenericContent &)=default
friend class SignatureParser
Definition GenericContent.hpp:28
span< const uint8_t > raw() const
Definition GenericContent.hpp:44
const oid_t & oid() const
Definition GenericContent.hpp:40
GenericContent & operator=(const GenericContent &)=default
friend std::ostream & operator<<(std::ostream &os, const GenericContent &content)
Definition GenericContent.hpp:57
std::unique_ptr< Content > clone() const override
Definition GenericContent.hpp:36
Definition Visitor.hpp:212
#define LIEF_LIFETIMEBOUND
Definition compiler_attributes.hpp:72
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
std::string oid_t
Definition PE/signature/types.hpp:23
LIEF namespace.
Definition Abstract/Binary.hpp:41
tcb::span< ElementType, Extent > span
Definition span.hpp:22
#define LIEF_API
Definition visibility.h:45