LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
GenericContent.hpp
Go to the documentation of this file.
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_GENERIC_CONTENT_H
17#define LIEF_PE_GENERIC_CONTENT_H
18
19#include "LIEF/visibility.h"
20#include "LIEF/span.hpp"
21
23
24namespace LIEF {
25namespace PE {
27 friend class SignatureParser;
28
29 public:
31 GenericContent(oid_t oid);
32 GenericContent(const GenericContent&) = default;
33 GenericContent& operator=(const GenericContent&) = default;
34
35 std::unique_ptr<Content> clone() const override {
36 return std::unique_ptr<Content>(new GenericContent{*this});
37 }
38
39 const oid_t& oid() const {
40 return oid_;
41 }
42
43 span<const uint8_t> raw() const {
44 return raw_;
45 }
46
47 span<uint8_t> raw() {
48 return raw_;
49 }
50
51 ~GenericContent() override;
52
53 void print(std::ostream& os) const override;
54 void accept(Visitor& visitor) const override;
55
56 LIEF_API friend std::ostream& operator<<(std::ostream& os, const GenericContent& content) {
57 content.print(os);
58 return os;
59 }
60
61 static bool classof(const ContentInfo::Content* content);
62
63 private:
64 oid_t oid_;
65 std::vector<uint8_t> raw_;
66};
67}
68}
69#endif
Definition ContentInfo.hpp:83
Definition GenericContent.hpp:26
void print(std::ostream &os) const override
span< uint8_t > raw()
Definition GenericContent.hpp:47
static bool classof(const ContentInfo::Content *content)
void accept(Visitor &visitor) const override
GenericContent(const GenericContent &)=default
span< const uint8_t > raw() const
Definition GenericContent.hpp:43
const oid_t & oid() const
Definition GenericContent.hpp:39
GenericContent & operator=(const GenericContent &)=default
friend std::ostream & operator<<(std::ostream &os, const GenericContent &content)
Definition GenericContent.hpp:56
std::unique_ptr< Content > clone() const override
Definition GenericContent.hpp:35
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:36
#define LIEF_API
Definition visibility.h:41