libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
Guest.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
21#include <memory>
22#include <ostream>
23#include <string>
24
25namespace introvirt {
26
27class GuestImpl;
28
35class Guest {
36 public:
42 virtual OS os() const = 0;
43
50 virtual bool x64() const = 0;
51
59 virtual guest_ptr<void> allocate(size_t& region_size, bool executable = false) = 0;
60
67 virtual void guest_free(const guest_ptr<void>& ptr, size_t region_size) = 0;
68
72 virtual bool page_in(Event& event, uint64_t virtual_address) = 0;
73
79 virtual GuestImpl& impl() = 0;
80 virtual const GuestImpl& impl() const = 0;
81
85 virtual ~Guest() = default;
86};
87
88} // namespace introvirt
Interface class for hypervisor events.
Definition Event.hh:43
Base interface for a Guest.
Definition Guest.hh:35
virtual guest_ptr< void > allocate(size_t &region_size, bool executable=false)=0
Allocate a region of memory in the guest.
virtual bool page_in(Event &event, uint64_t virtual_address)=0
virtual ~Guest()=default
Destroy the instance.
virtual OS os() const =0
Get the Guest OS type.
virtual void guest_free(const guest_ptr< void > &ptr, size_t region_size)=0
Free a region of memory in the guest.
virtual bool x64() const =0
Check if the guest is 64-bit.
virtual const GuestImpl & impl() const =0
virtual GuestImpl & impl()=0
Used internally.
Definition guest_ptr.hh:88
Type-safe guest virtual address pointer and guest_ptr template.
Core IntroVirt classes.
Definition Cr0.hh:20
OS
Definition Event.hh:36