libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
MMVAD.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
22
23#include <cstdint>
24#include <memory>
25#include <string>
26#include <vector>
27
28namespace introvirt {
29namespace windows {
30namespace nt {
31
35enum class VadStructure {
37 MMVAD,
38
40};
41
48class MMVAD {
49 public:
60
62 virtual std::string tag() const = 0;
63
65 virtual VadStructure structure() const = 0;
66
67 virtual uint64_t CommitCharge() const = 0;
68
70 virtual uint64_t StartingVpn() const = 0;
72 virtual uint64_t EndingVpn() const = 0;
74 virtual const FILE_OBJECT* FileObject() const = 0;
76 virtual std::shared_ptr<const MMVAD> LeftChild() const = 0;
78 virtual std::shared_ptr<const MMVAD> RightChild() const = 0;
80 virtual std::shared_ptr<const MMVAD> Parent() const = 0;
82 virtual VadType Type() const = 0;
84 virtual PAGE_PROTECTION Protection() const = 0;
86 virtual const MEMORY_ALLOCATION_TYPE& Allocation() const = 0;
88 virtual bool Private() const = 0;
89
91 virtual uint64_t RegionSize() const = 0;
92
94 virtual uint64_t StartingAddress() const = 0;
95
97 virtual uint64_t EndingAddress() const = 0;
98
99 virtual guest_ptr<void> ptr() const = 0;
100
101 virtual bool locked() const = 0;
102
103 virtual std::vector<std::shared_ptr<const MMVAD>> VadTreeInOrder() const = 0;
104
105 virtual uint64_t FirstPrototypePte() const = 0;
106 virtual uint64_t LastContiguousPte() const = 0;
107
114 virtual std::shared_ptr<const MMVAD> search(uint64_t virtual_address) const = 0;
115
116 virtual ~MMVAD() = default;
117};
118
122const std::string& to_string(MMVAD::VadType);
123
127std::ostream& operator<<(std::ostream&, MMVAD::VadType);
128
132const std::string& to_string(VadStructure);
133
137std::ostream& operator<<(std::ostream&, VadStructure);
138
139} // namespace nt
140} // namespace windows
141} // namespace introvirt
Definition guest_ptr.hh:88
Definition FILE_OBJECT.hh:66
Class for MEMORY_ALLOCATION_TYPE flags.
Definition MEMORY_ALLOCATION_TYPE.hh:54
An entry inside a process's VAD table.
Definition MMVAD.hh:48
virtual VadType Type() const =0
VadType
Definition MMVAD.hh:50
@ VadNone
Definition MMVAD.hh:51
@ VadLargePages
Definition MMVAD.hh:56
@ VadDevicePhysicalMemory
Definition MMVAD.hh:52
@ VadImageMap
Definition MMVAD.hh:53
@ VadAwe
Definition MMVAD.hh:54
@ VadRotatePhysical
Definition MMVAD.hh:57
@ VadLargePageSection
Definition MMVAD.hh:58
@ VadWriteWatch
Definition MMVAD.hh:55
virtual uint64_t EndingAddress() const =0
virtual std::string tag() const =0
virtual std::shared_ptr< const MMVAD > LeftChild() const =0
virtual std::shared_ptr< const MMVAD > RightChild() const =0
virtual VadStructure structure() const =0
virtual const MEMORY_ALLOCATION_TYPE & Allocation() const =0
virtual const FILE_OBJECT * FileObject() const =0
virtual std::shared_ptr< const MMVAD > Parent() const =0
virtual guest_ptr< void > ptr() const =0
virtual uint64_t RegionSize() const =0
virtual uint64_t EndingVpn() const =0
virtual bool Private() const =0
virtual std::vector< std::shared_ptr< const MMVAD > > VadTreeInOrder() const =0
virtual PAGE_PROTECTION Protection() const =0
virtual std::shared_ptr< const MMVAD > search(uint64_t virtual_address) const =0
Search for the MMVAD entry for the given address in children.
virtual uint64_t StartingVpn() const =0
virtual bool locked() const =0
virtual uint64_t FirstPrototypePte() const =0
virtual uint64_t LastContiguousPte() const =0
virtual uint64_t StartingAddress() const =0
virtual uint64_t CommitCharge() const =0
Definition PAGE_PROTECTION.hh:30
Type-safe guest virtual address pointer and guest_ptr template.
VadStructure
Definition MMVAD.hh:35
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20