Event

Event handling helpers and classes.

class pyintrovirt.event.CallbackEventHandler(*args: Any, **kwargs: Any)[source]

Bases: EventCallback

Event callback handler.

process_event(event: introvirt.Event)[source]

Callback from the introvirt.EventCallback

register_event_callback(event_type: introvirt.EventType, callback: EventCallback)[source]

Set a callback to be called for a specific event type.

set_global_event_callback(callback: EventCallback)[source]

Set a callback to be called with every event type.

class pyintrovirt.event.Event(iv_event: introvirt.Event)[source]

Bases: object

A more helpful wrapper around introvirt.Event that exposes more functionality from one object.

event_type() introvirt.EventType[source]

Wrap in an introvirt.EventType object.

get_result() None | int[source]

Get the result value if there is one. Only valid for system calls right now.

get_result_str() None | str[source]

Get the result value if there is one as a string. Only valid for system calls right now.

get_syscall_handler() None | introvirt.WindowsSystemCall[source]

Get the lowest level OS-specific system call handler for the system call if there is one.

has_result() bool[source]

Return True if this event includes a syscall result.

hook_return(enabled: bool)[source]

Set whether or not we’ll hook the return. Only valid on system calls.

is_syscall() bool[source]

Is it a system call event.

property kpcr: introvirt.KPCR

Get the KPCR from the task.

property pid: int

Get the process ID for the task associated with the event.

property process_name: str

Get the task info process name.

property supported: None | bool

Checks supported. Only valid for system calls with a handler.

property syscall_index: None | introvirt.SystemCallIndex

Get the system call index if it’s a system call.

property syscall_name: None | str

Get the system call name if it’s a system call.

property tid: int

Get the thread ID for the task associated with the event.

to_dict() dict[source]

Convert the event to a dictionary.

property vcpu: introvirt.Vcpu

Get access to the VCPU object.

will_return() None | bool[source]

This is valid for system calls. Everything else will always return False.

class pyintrovirt.event.EventCallback(*args, **kwargs)[source]

Bases: Protocol

The event callback function signature.