libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
PS_ATTRIBUTE_LIST.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
19#include <introvirt/util/json/json.hh>
22
23#include <cstdint>
24#include <memory>
25
26namespace introvirt {
27namespace windows {
28namespace nt {
29
60
62 public:
63 // The attribute number
64 virtual PS_ATTRIBUTE_NUM AttributeNumber() const = 0;
65 virtual void AttributeNumber(PS_ATTRIBUTE_NUM num) = 0;
66
67 virtual uint32_t AttributeFlags() const = 0;
68 virtual void AttributeFlags(uint32_t flags) = 0;
69
70 virtual uint64_t Size() const = 0;
71 virtual void Size(uint64_t size) = 0;
72
73 virtual uint64_t Value() const = 0;
74 virtual void Value(uint64_t value) = 0;
75
76 virtual uint64_t ReturnLength() const = 0;
77 virtual void ReturnLength(uint64_t len) = 0;
78
79 /*
80 * A bit that indicates if the attribute is input-only
81 */
82 virtual bool AttributeInputOnly() const = 0;
83 virtual void AttributeInputOnly(bool input) = 0;
84
85 /*
86 * A bit that indicates the attribute can be used with threads
87 */
88 virtual bool AttributeThreads() const = 0;
89 virtual void AttributeThreads(bool threads) = 0;
90
96 virtual guest_ptr<void> ptr() const = 0;
97
104 virtual void write(std::ostream& os, const std::string& linePrefix = "") const = 0;
105
111 virtual Json::Value json() const = 0;
112
113 virtual ~PS_ATTRIBUTE() = default;
114};
115
117 public:
120
127 virtual PS_ATTRIBUTE& operator[](uint32_t index) = 0;
128 virtual const PS_ATTRIBUTE& operator[](uint32_t index) const = 0;
129
133 virtual PS_ATTRIBUTE& at(uint32_t index) = 0;
134 virtual const PS_ATTRIBUTE& at(uint32_t index) const = 0;
135
142 virtual iterator erase(const const_iterator& iter) = 0;
143
149 virtual uint32_t length() const = 0;
150
156 virtual iterator begin() = 0;
157
163 virtual iterator end() = 0;
164
170 virtual const_iterator begin() const = 0;
171
177 virtual const_iterator end() const = 0;
178
184 virtual guest_ptr<void> ptr() const = 0;
185
194 virtual uint32_t buffer_size() const = 0;
195
202 virtual void write(std::ostream& os, const std::string& linePrefix = "") const = 0;
203
209 virtual Json::Value json() const = 0;
210
211 static std::unique_ptr<PS_ATTRIBUTE_LIST> make_unique(const NtKernel& kernel,
212 const guest_ptr<void>& ptr);
213
214 virtual ~PS_ATTRIBUTE_LIST() = default;
215};
216
217const std::string& to_string(PS_ATTRIBUTE_NUM attribute);
218std::ostream& operator<<(std::ostream&, PS_ATTRIBUTE_NUM);
219
220} /* namespace nt */
221} /* namespace windows */
222} /* namespace introvirt */
Definition guest_ptr.hh:88
Abstraction for the Windows NT kernel.
Definition NtKernel.hh:37
Definition PS_ATTRIBUTE_LIST.hh:116
virtual Json::Value json() const =0
Get a Json respresentation of the buffer.
static std::unique_ptr< PS_ATTRIBUTE_LIST > make_unique(const NtKernel &kernel, const guest_ptr< void > &ptr)
virtual iterator erase(const const_iterator &iter)=0
Remove an element from the list.
virtual PS_ATTRIBUTE & operator[](uint32_t index)=0
Get an entry at the specified index.
virtual const_iterator end() const =0
Get the end iterator.
virtual guest_ptr< void > ptr() const =0
Get the address of the buffer.
virtual iterator end()=0
Get the end iterator.
virtual PS_ATTRIBUTE & at(uint32_t index)=0
Get an entry at the specified index.
virtual uint32_t length() const =0
Get the number of entries.
virtual const PS_ATTRIBUTE & operator[](uint32_t index) const =0
virtual uint32_t buffer_size() const =0
Get the total size of the buffer in bytes.
virtual void write(std::ostream &os, const std::string &linePrefix="") const =0
Write out a human-readable representation.
virtual iterator begin()=0
Get an iterator to the first entry.
virtual const PS_ATTRIBUTE & at(uint32_t index) const =0
virtual const_iterator begin() const =0
Get an iterator to the first entry.
Definition PS_ATTRIBUTE_LIST.hh:61
virtual void AttributeThreads(bool threads)=0
virtual PS_ATTRIBUTE_NUM AttributeNumber() const =0
virtual bool AttributeInputOnly() const =0
virtual void ReturnLength(uint64_t len)=0
virtual void Value(uint64_t value)=0
virtual Json::Value json() const =0
Get a Json respresentation of the buffer.
virtual bool AttributeThreads() const =0
virtual uint64_t Size() const =0
virtual void write(std::ostream &os, const std::string &linePrefix="") const =0
Write out a human-readable representation.
virtual void Size(uint64_t size)=0
virtual void AttributeNumber(PS_ATTRIBUTE_NUM num)=0
virtual uint64_t ReturnLength() const =0
virtual uint64_t Value() const =0
virtual void AttributeInputOnly(bool input)=0
virtual guest_ptr< void > ptr() const =0
Get the address of this entry.
virtual void AttributeFlags(uint32_t flags)=0
virtual uint32_t AttributeFlags() const =0
Iterator helper for _INFORMATION types that have a fixed array result.
Definition array_iterator.hh:35
Type-safe guest virtual address pointer and guest_ptr template.
PS_ATTRIBUTE_NUM
Definition PS_ATTRIBUTE_LIST.hh:30
@ PsAttributeStdHandleInfo
Definition PS_ATTRIBUTE_LIST.hh:41
@ PsAttributeImageName
Definition PS_ATTRIBUTE_LIST.hh:36
@ PsAttributeUmsThread
Definition PS_ATTRIBUTE_LIST.hh:46
@ PsAttributeJobList
Definition PS_ATTRIBUTE_LIST.hh:50
@ PsAttributeImageInfo
Definition PS_ATTRIBUTE_LIST.hh:37
@ PsAttributeBnoIsolation
Definition PS_ATTRIBUTE_LIST.hh:55
@ PsAttributeMitigationOptions
Definition PS_ATTRIBUTE_LIST.hh:47
@ PsAttributeTebAddress
Definition PS_ATTRIBUTE_LIST.hh:35
@ PsAttributeAllApplicationPackagesPolicy
Definition PS_ATTRIBUTE_LIST.hh:52
@ PsAttributePreferredNode
Definition PS_ATTRIBUTE_LIST.hh:44
@ PsAttributeChpe
Definition PS_ATTRIBUTE_LIST.hh:57
@ PsAttributeSecurityCapabilities
Definition PS_ATTRIBUTE_LIST.hh:49
@ PsAttributePriorityClass
Definition PS_ATTRIBUTE_LIST.hh:39
@ PsAttributeDesktopAppPolicy
Definition PS_ATTRIBUTE_LIST.hh:56
@ PsAttributeWin32kFilter
Definition PS_ATTRIBUTE_LIST.hh:53
@ PsAttributeSafeOpenPromptOriginClaim
Definition PS_ATTRIBUTE_LIST.hh:54
@ PsAttributeParentProcess
Definition PS_ATTRIBUTE_LIST.hh:31
@ PsAttributeIdealProcessor
Definition PS_ATTRIBUTE_LIST.hh:45
@ PsAttributeChildProcessPolicy
Definition PS_ATTRIBUTE_LIST.hh:51
@ PsAttributeProtectionLevel
Definition PS_ATTRIBUTE_LIST.hh:48
@ PsAttributeMemoryReserve
Definition PS_ATTRIBUTE_LIST.hh:38
@ PsAttributeClientId
Definition PS_ATTRIBUTE_LIST.hh:34
@ PsAttributeMax
Definition PS_ATTRIBUTE_LIST.hh:58
@ PsAttributeGroupAffinity
Definition PS_ATTRIBUTE_LIST.hh:43
@ PsAttributeErrorMode
Definition PS_ATTRIBUTE_LIST.hh:40
@ PsAttributeToken
Definition PS_ATTRIBUTE_LIST.hh:33
@ PsAttributeDebugPort
Definition PS_ATTRIBUTE_LIST.hh:32
@ PsAttributeHandleList
Definition PS_ATTRIBUTE_LIST.hh:42
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
const std::string & to_string(APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20