libintrovirt v0.57.4
IntroVirt introspection library
Loading...
Searching...
No Matches
SystemCallEvent.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
18#include <introvirt/core/fwd.hh>
19
20#include <cstdint>
21#include <string>
22
23namespace introvirt {
24
35
36class SystemCallEventImpl;
37
47 public:
53 virtual FastCallType instruction() const = 0;
54
63 virtual SystemCall* handler() = 0;
64
68 virtual const SystemCall* handler() const = 0;
69
73 virtual std::string name() const = 0;
74
80 virtual uint64_t raw_index() const = 0;
81
87 virtual void hook_return(bool enabled) = 0;
88
94 virtual bool hook_return() const = 0;
95
101 virtual uint64_t return_address() const = 0;
102
106 virtual SystemCallEventImpl& impl() = 0;
107
111 virtual ~SystemCallEvent() = default;
112
113 protected:
114 SystemCallEvent() = default;
115};
116
123const std::string& to_string(FastCallType type);
124
134std::ostream& operator<<(std::ostream& os, FastCallType type);
135
136} // namespace introvirt
Interface for system call events.
Definition SystemCallEvent.hh:46
virtual uint64_t raw_index() const =0
Get the system call number executed.
virtual SystemCallEventImpl & impl()=0
Used internally.
virtual SystemCall * handler()=0
Gets the associated system call handler with this event.
virtual bool hook_return() const =0
Check if the return is set to be hooked.
virtual uint64_t return_address() const =0
Get the address where the system call will return.
virtual ~SystemCallEvent()=default
Destroy the instance.
virtual const SystemCall * handler() const =0
Gets the associated system call handler with this event.
virtual FastCallType instruction() const =0
Get the type of fast system call instruction.
virtual std::string name() const =0
Get a string represenatation of the system call name.
virtual void hook_return(bool enabled)=0
Instruct that the system call's return should be hooked.
Definition SystemCall.hh:31
Core IntroVirt classes.
Definition Cr0.hh:20
const std::string & to_string(OS)
FastCallType
Enum class describing the type of fast system call.
Definition SystemCallEvent.hh:28
std::ostream & operator<<(std::ostream &, OS)