libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
SystemCallConverter.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 <cstdint>
22#include <memory>
23#include <unordered_map>
24#include <vector>
25
26namespace introvirt {
27namespace windows {
28
37 public:
47 SystemCallIndex normalize(uint32_t index) const;
48
58 uint32_t native(SystemCallIndex index) const;
59
65 uint32_t count() const;
66
74
79
86 static constexpr uint64_t SystemCallIndexMask = 0x1FFF;
87
88 private:
89 SystemCallIndex _normalize(uint32_t index,
90 const std::vector<SystemCallIndex>& to_normalized) const;
91
92 std::vector<SystemCallIndex> to_normalized_nt_;
93 std::vector<SystemCallIndex> to_normalized_win32k_;
94
95 std::unordered_map<SystemCallIndex, uint32_t> to_native_;
96};
97
98} // namespace windows
99} // namespace introvirt
Class for converting between native system call numbers and our SystemCall values.
Definition SystemCallConverter.hh:36
SystemCallConverter(const WindowsGuest &guest)
Construct a new System Call Table object.
~SystemCallConverter()
Destroy the instance.
uint32_t count() const
Get the number of system calls detected in the guest.
static constexpr uint64_t SystemCallIndexMask
A mask used for normalizing system calls.
Definition SystemCallConverter.hh:86
uint32_t native(SystemCallIndex index) const
Convert a normalized system call into the native value.
SystemCallIndex normalize(uint32_t index) const
Normalize a system call.
A representation of a Windows Guest OS.
Definition WindowsGuest.hh:33
SystemCallIndex
This is our "normalized" list of Windows system calls.
Definition SystemCallIndex.hh:30
Core IntroVirt classes.
Definition Cr0.hh:20