libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
UNICODE_STRING.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
21
22#include <introvirt/core/fwd.hh>
24
25#include <locale>
26#include <memory>
27#include <string>
28
29namespace introvirt {
30namespace windows {
31namespace nt {
32
38 public:
42 uint16_t Length() const override = 0;
43
47 virtual void Length(uint16_t length) = 0;
48
49 /*
50 * @returns The maximum length of the string, in bytes
51 */
52 virtual uint16_t MaximumLength() const = 0;
53 virtual void MaximumLength(uint16_t MaximumLength) = 0;
54
55 virtual guest_ptr<void> BufferAddress() const = 0;
56 virtual void BufferAddress(const guest_ptr<void>& ptr) = 0;
57
58 Json::Value json() const override = 0;
59
60 virtual guest_ptr<void> ptr() const = 0;
61
62 static std::unique_ptr<UNICODE_STRING> make_unique(const NtKernel& kernel,
63 const guest_ptr<void>& gva);
64
65 ~UNICODE_STRING() override = default;
66};
67
68} /* namespace nt */
69} /* namespace windows */
70
71namespace inject {
72
73template <>
74class GuestAllocation<windows::nt::UNICODE_STRING> final
75 : public GuestAllocationComplexBase<windows::nt::UNICODE_STRING> {
76 public:
77 explicit GuestAllocation(const std::string& value);
78 explicit GuestAllocation(const std::string& value, unsigned int MaximumLength);
79};
80
81} /* namespace inject */
82} /* namespace introvirt */
Definition guest_ptr.hh:88
Definition GuestAllocation.hh:179
GuestAllocation(const std::string &value, unsigned int MaximumLength)
Definition GuestAllocation.hh:31
Base UTF-16 class.
Definition Utf16String.hh:34
Abstraction for the Windows NT kernel.
Definition NtKernel.hh:37
Class for the Windows UNICODE_STRING structure.
Definition UNICODE_STRING.hh:37
static std::unique_ptr< UNICODE_STRING > make_unique(const NtKernel &kernel, const guest_ptr< void > &gva)
virtual void Length(uint16_t length)=0
Change the value of the Length field.
virtual guest_ptr< void > BufferAddress() const =0
virtual void MaximumLength(uint16_t MaximumLength)=0
virtual void BufferAddress(const guest_ptr< void > &ptr)=0
virtual uint16_t MaximumLength() const =0
Json::Value json() const override=0
uint16_t Length() const override=0
virtual guest_ptr< void > ptr() const =0
Type-safe guest virtual address pointer and guest_ptr template.
Core IntroVirt classes.
Definition Cr0.hh:20