LIEF: Library to Instrument Executable Formats Version 0.16.0
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
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 uint16_t flags() const {
41 return flags_;
42 }
43 uint16_t catalog() const {
46 return catalog_;
47 }
48 uint32_t catalog_offset() const {
49 return catalog_offset_;
50 }
51 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
Object.hpp
LIEF::PE::CodeIntegrity
Definition CodeIntegrity.hpp:30
LIEF::PE::CodeIntegrity::accept
void accept(Visitor &visitor) const override
LIEF::PE::CodeIntegrity::CodeIntegrity
CodeIntegrity()=default
LIEF::PE::CodeIntegrity::operator=
CodeIntegrity & operator=(const CodeIntegrity &)=default
LIEF::PE::CodeIntegrity::flags
uint16_t flags() const
Flags to indicate if CI information is available, etc.
Definition CodeIntegrity.hpp:40
LIEF::PE::CodeIntegrity::catalog
uint16_t catalog() const
0xFFFF means not available
Definition CodeIntegrity.hpp:45
LIEF::PE::CodeIntegrity::catalog
void catalog(uint16_t catalog)
Definition CodeIntegrity.hpp:60
LIEF::PE::CodeIntegrity::CodeIntegrity
CodeIntegrity(const CodeIntegrity &)=default
LIEF::PE::CodeIntegrity::catalog_offset
void catalog_offset(uint32_t catalog_offset)
Definition CodeIntegrity.hpp:63
LIEF::PE::CodeIntegrity::catalog_offset
uint32_t catalog_offset() const
Definition CodeIntegrity.hpp:48
LIEF::PE::CodeIntegrity::~CodeIntegrity
~CodeIntegrity() override=default
LIEF::PE::CodeIntegrity::reserved
void reserved(uint32_t reserved)
Definition CodeIntegrity.hpp:66
LIEF::PE::CodeIntegrity::flags
void flags(uint16_t flags)
Definition CodeIntegrity.hpp:57
LIEF::PE::CodeIntegrity::reserved
uint32_t reserved() const
Additional bitmask to be defined later.
Definition CodeIntegrity.hpp:53
LIEF::PE::CodeIntegrity::operator<<
friend std::ostream & operator<<(std::ostream &os, const CodeIntegrity &entry)
LIEF::PE::CodeIntegrity::CodeIntegrity
CodeIntegrity(const details::pe_code_integrity &header)
LIEF::PE::details
Definition CodeIntegrity.hpp:26
LIEF::PE
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41