LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
CodeIntegrity.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_CODE_INTEGRITY_H
17#define LIEF_PE_CODE_INTEGRITY_H
18#include <ostream>
19#include <cstdint>
20
21#include "LIEF/Object.hpp"
22#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace PE {
26namespace details {
27struct pe_code_integrity;
28}
29
30class LIEF_API CodeIntegrity : public Object {
31 public:
32 CodeIntegrity() = default;
33 CodeIntegrity(const details::pe_code_integrity& header);
34 ~CodeIntegrity() override = default;
35
36 CodeIntegrity& operator=(const CodeIntegrity&) = default;
37 CodeIntegrity(const CodeIntegrity&) = default;
38
40 uint16_t flags() const {
41 return flags_;
42 }
43
45 uint16_t catalog() const {
46 return catalog_;
47 }
48 uint32_t catalog_offset() const {
49 return catalog_offset_;
50 }
51
53 uint32_t reserved() const {
54 return reserved_;
55 }
56
57 void flags(uint16_t flags) {
58 flags_ = flags;
59 }
60 void catalog(uint16_t catalog) {
61 catalog_ = catalog;
62 }
63 void catalog_offset(uint32_t catalog_offset) {
64 catalog_offset_ = catalog_offset;
65 }
66 void reserved(uint32_t reserved) {
67 reserved_ = reserved;
68 }
69
70 void accept(Visitor& visitor) const override;
71
72 LIEF_API friend std::ostream& operator<<(std::ostream& os, const CodeIntegrity& entry);
73
74 private:
75 uint16_t flags_ = 0;
76 uint16_t catalog_ = 0;
77
78 uint32_t catalog_offset_ = 0;
79 uint32_t reserved_ = 0;
80
81};
82}
83}
84
85#endif
Definition Object.hpp:25
Definition CodeIntegrity.hpp:30
uint16_t flags() const
Flags to indicate if CI information is available, etc.
Definition CodeIntegrity.hpp:40
uint16_t catalog() const
0xFFFF means not available
Definition CodeIntegrity.hpp:45
uint32_t reserved() const
Additional bitmask to be defined later.
Definition CodeIntegrity.hpp:53
LIEF namespace.
Definition Abstract/Binary.hpp:32