HyperDbg Debugger
Loading...
Searching...
No Matches
Events.h
Go to the documentation of this file.
1
12#pragma once
13
15// Definitions //
17
22#ifndef RESERVED_MSR_RANGE_LOW
23# define RESERVED_MSR_RANGE_LOW 0x40000000
24#endif // !RESERVED_MSR_RANGE_LOW
25
30#ifndef RESERVED_MSR_RANGE_HI
31# define RESERVED_MSR_RANGE_HI 0x4000109F
32#endif // !RESERVED_MSR_RANGE_HI
33
38#define EXCEPTION_BITMAP_MASK_ALL 0xffffffff
39
41// Enums //
43
59
61// Structures //
63
68typedef union _INTERRUPT_INFO
69{
70 struct
71 {
73 /* 0=Ext Int, 1=Rsvd, 2=NMI, 3=Exception, 4=Soft INT,
74 * 5=Priv Soft Trap, 6=Unpriv Soft Trap, 7=Other */
76 UINT32 DeliverCode : 1; /* 0=Do not deliver, 1=Deliver */
78 UINT32 Valid : 1; /* 0=Not valid, 1=Valid. Must be checked first */
82
93
95// Functions //
97
98VOID
99EventInjectInterruptOrException(_In_ VMEXIT_INTERRUPT_INFORMATION InterruptExit);
100
101VOID
103 _In_ VMEXIT_INTERRUPT_INFORMATION InterruptExit,
104 _In_ UINT64 PageFaultAddress,
105 _In_ PAGE_FAULT_EXCEPTION PageFaultCode);
106
107VOID
109
110VOID
112 EXCEPTION_VECTORS Vector,
113 BOOLEAN DeliverErrorCode,
114 UINT32 ErrorCode);
115
116VOID
118
119VOID
121
122VOID
124
125VOID
127
128VOID
130
131VOID
133
134VOID
136 UINT64 AddressFrom,
137 UINT64 AddressTo,
138 UINT32 PageFaultCode);
UCHAR BOOLEAN
Definition BasicTypes.h:39
#define VOID
Definition BasicTypes.h:33
unsigned __int64 UINT64
Definition BasicTypes.h:21
unsigned int UINT32
Definition BasicTypes.h:48
UINT64 Address
Definition HyperDbgScriptImports.h:67
VOID EventInjectNmi(VIRTUAL_MACHINE_STATE *VCpu)
Inject NMI to the guest (Event Injection)
Definition Events.c:96
VOID EventInjectPageFaults(_Inout_ VIRTUAL_MACHINE_STATE *VCpu, _In_ VMEXIT_INTERRUPT_INFORMATION InterruptExit, _In_ UINT64 PageFaultAddress, _In_ PAGE_FAULT_EXCEPTION PageFaultCode)
inject #PFs to the guest
Definition Events.c:192
VOID EventInjectInterruptOrException(_In_ VMEXIT_INTERRUPT_INFORMATION InterruptExit)
re-inject interrupt or exception to the guest
Definition Events.c:155
VOID EventInjectUndefinedOpcode(VIRTUAL_MACHINE_STATE *VCpu)
Inject #UD to the guest (Invalid Opcode - Undefined Opcode)
Definition Events.c:79
VOID EventInjectPageFaultWithoutErrorCode(UINT64 PageFaultAddress)
Inject #PF to the guest (Page-Fault for EFER Injector)
Definition Events.c:124
VOID EventInjectInterruption(INTERRUPT_TYPE InterruptionType, EXCEPTION_VECTORS Vector, BOOLEAN DeliverErrorCode, UINT32 ErrorCode)
Injects interruption to a guest.
Definition Events.c:24
VOID EventInjectBreakpoint()
Inject #BP to the guest (Event Injection)
Definition Events.c:46
VOID EventInjectPageFaultRangeAddress(VIRTUAL_MACHINE_STATE *VCpu, UINT64 AddressFrom, UINT64 AddressTo, UINT32 PageFaultCode)
Inject a range of page-faults.
Definition Events.c:237
union _INTERRUPT_INFO INTERRUPT_INFO
Interrupt injection and event format.
VOID EventInjectDebugBreakpoint()
Inject Debug Breakpoint Exception.
Definition Events.c:112
struct _EVENT_INFORMATION EVENT_INFORMATION
Event information.
struct _EVENT_INFORMATION * PEVENT_INFORMATION
VOID EventInjectGeneralProtection()
Inject #GP to the guest (Event Injection)
Definition Events.c:62
union _INTERRUPT_INFO * PINTERRUPT_INFO
_INTERRUPT_TYPE
Type of interrupts.
Definition Events.h:49
@ INTERRUPT_TYPE_HARDWARE_EXCEPTION
Definition Events.h:53
@ INTERRUPT_TYPE_EXTERNAL_INTERRUPT
Definition Events.h:50
@ INTERRUPT_TYPE_PRIVILEGED_SOFTWARE_INTERRUPT
Definition Events.h:55
@ INTERRUPT_TYPE_SOFTWARE_EXCEPTION
Definition Events.h:56
@ INTERRUPT_TYPE_RESERVED
Definition Events.h:51
@ INTERRUPT_TYPE_NMI
Definition Events.h:52
@ INTERRUPT_TYPE_SOFTWARE_INTERRUPT
Definition Events.h:54
@ INTERRUPT_TYPE_OTHER_EVENT
Definition Events.h:57
enum _INTERRUPT_TYPE INTERRUPT_TYPE
Type of interrupts.
VOID EventInjectPageFaultWithCr2(VIRTUAL_MACHINE_STATE *VCpu, UINT64 Address, UINT32 PageFaultCode)
Inject page-fault with an address as cr2.
Definition Events.c:281
enum _EXCEPTION_VECTORS EXCEPTION_VECTORS
Exceptions enum.
Event information.
Definition Events.h:88
INTERRUPT_INFO InterruptInfo
Definition Events.h:89
UINT64 ErrorCode
Definition Events.h:91
UINT32 InstructionLength
Definition Events.h:90
The status of each core after and before VMX.
Definition State.h:290
Interrupt injection and event format.
Definition Events.h:69
UINT32 Reserved
Definition Events.h:77
UINT32 Vector
Definition Events.h:72
UINT32 DeliverCode
Definition Events.h:76
UINT32 Valid
Definition Events.h:78
UINT32 Flags
Definition Events.h:80
UINT32 InterruptType
Definition Events.h:75
struct _INTERRUPT_INFO::@7 Fields