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