libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
PAGE_PROTECTION.hh
Go to the documentation of this file.
1/*
2 * Copyright 2021 Assured Information Security, Inc.
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#pragma once
17
18#include <introvirt/util/json/json.hh>
19
20#include <cstdint>
21#include <memory>
22#include <string>
23
24namespace introvirt {
25namespace windows {
26namespace nt {
27
28/* TODO(papes): Clean up the PAGE_PROTECTION class */
29
30class PAGE_PROTECTION final {
31 public:
46
53 static PAGE_PROTECTION fromVadProtection(uint32_t protection);
54
61 bool operator==(const PAGE_PROTECTION& other) const;
62
69
73 bool isExecutable() const;
74
78 bool isWritable() const;
79
83 bool isReadable() const;
84
88 bool isCopyOnWrite() const;
89
93 bool isRWX() const;
94
99
104
109
113 uint32_t value() const;
114
115 operator uint32_t() const;
116
120 std::string string() const;
121
127 PAGE_PROTECTION(uint32_t protection = 0);
128
135
142
144
145 private:
146 uint32_t protection_;
147};
148
149std::string to_string(PAGE_PROTECTION prot);
150
151std::ostream& operator<<(std::ostream&, PAGE_PROTECTION prot);
152
153} // namespace nt
154} // namespace windows
155} // namespace introvirt
Definition PAGE_PROTECTION.hh:30
PAGE_PROTECTION(PageProtectionFlag flag)
PAGE_PROTECTION(uint32_t protection=0)
PageProtectionFlag
Definition PAGE_PROTECTION.hh:32
@ PAGE_NOCACHE
Definition PAGE_PROTECTION.hh:43
@ PAGE_EXECUTE_READWRITE
Definition PAGE_PROTECTION.hh:40
@ UNKNOWN
Definition PAGE_PROTECTION.hh:33
@ PAGE_GUARD
Definition PAGE_PROTECTION.hh:42
@ PAGE_WRITECOMBINE
Definition PAGE_PROTECTION.hh:44
@ PAGE_EXECUTE_READ
Definition PAGE_PROTECTION.hh:39
@ PAGE_NOACCESS
Definition PAGE_PROTECTION.hh:34
@ PAGE_READONLY
Definition PAGE_PROTECTION.hh:35
@ PAGE_WRITECOPY
Definition PAGE_PROTECTION.hh:37
@ PAGE_READWRITE
Definition PAGE_PROTECTION.hh:36
@ PAGE_EXECUTE_WRITECOPY
Definition PAGE_PROTECTION.hh:41
@ PAGE_EXECUTE
Definition PAGE_PROTECTION.hh:38
PAGE_PROTECTION & operator=(const PAGE_PROTECTION &other)
static PAGE_PROTECTION fromVadProtection(uint32_t protection)
PAGE_PROTECTION(const PAGE_PROTECTION &other)
bool operator==(const PAGE_PROTECTION &other) const
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20