LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
CodeIntegrity.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_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
31 public:
32 CodeIntegrity() = default;
33 CodeIntegrity(const details::pe_code_integrity& header);
34 ~CodeIntegrity() override = default;
35
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
void accept(Visitor &visitor) const override
CodeIntegrity & operator=(const CodeIntegrity &)=default
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
void catalog(uint16_t catalog)
Definition CodeIntegrity.hpp:60
CodeIntegrity(const CodeIntegrity &)=default
void catalog_offset(uint32_t catalog_offset)
Definition CodeIntegrity.hpp:63
uint32_t catalog_offset() const
Definition CodeIntegrity.hpp:48
~CodeIntegrity() override=default
void reserved(uint32_t reserved)
Definition CodeIntegrity.hpp:66
void flags(uint16_t flags)
Definition CodeIntegrity.hpp:57
uint32_t reserved() const
Additional bitmask to be defined later.
Definition CodeIntegrity.hpp:53
friend std::ostream & operator<<(std::ostream &os, const CodeIntegrity &entry)
CodeIntegrity(const details::pe_code_integrity &header)
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41