libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
CLIENT_ID.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
20#include <introvirt/util/json/json.hh>
22
23#include <cstdint>
24#include <memory>
25#include <ostream>
26
27namespace introvirt {
28namespace windows {
29namespace nt {
30
37class CLIENT_ID {
38 public:
39 virtual uint64_t UniqueProcess() const = 0;
40 virtual uint64_t UniqueThread() const = 0;
41
42 virtual void UniqueProcess(uint64_t UniqueProcess) = 0;
43 virtual void UniqueThread(uint64_t UniqueThread) = 0;
44
45 virtual void write(std::ostream& os, const std::string& linePrefix = "") const = 0;
46
47 virtual Json::Value json() const = 0;
48 virtual operator Json::Value() const = 0;
49
50 virtual guest_ptr<void> ptr() const = 0;
51
52 static std::unique_ptr<CLIENT_ID> make_unique(const NtKernel& kernel,
53 const guest_ptr<void>& ptr);
54
55 virtual ~CLIENT_ID() = default;
56};
57
58std::ostream& operator<<(std::ostream& os, const CLIENT_ID& cid);
59
60} /* namespace nt */
61} /* namespace windows */
62
63namespace inject {
64
65template <>
66class GuestAllocation<windows::nt::CLIENT_ID> final
67 : public GuestAllocationComplexBase<windows::nt::CLIENT_ID> {
68 public:
70 GuestAllocation(uint64_t UniqueProcess, uint64_t UniqueThread);
71};
72
73} // namespace inject
74
75} /* namespace introvirt */
Definition guest_ptr.hh:88
Definition GuestAllocation.hh:179
GuestAllocation(uint64_t UniqueProcess, uint64_t UniqueThread)
Definition GuestAllocation.hh:31
Class for handling the Windows NT CLIENT_ID structure.
Definition CLIENT_ID.hh:37
virtual void UniqueThread(uint64_t UniqueThread)=0
virtual Json::Value json() const =0
virtual uint64_t UniqueProcess() const =0
virtual uint64_t UniqueThread() const =0
virtual void write(std::ostream &os, const std::string &linePrefix="") const =0
virtual void UniqueProcess(uint64_t UniqueProcess)=0
virtual guest_ptr< void > ptr() const =0
static std::unique_ptr< CLIENT_ID > make_unique(const NtKernel &kernel, const guest_ptr< void > &ptr)
Abstraction for the Windows NT kernel.
Definition NtKernel.hh:37
Type-safe guest virtual address pointer and guest_ptr template.
std::ostream & operator<<(std::ostream &, APPHELPCACHESERVICECLASS val)
Core IntroVirt classes.
Definition Cr0.hh:20