Skip to content

Latest commit

 

History

History
54 lines (30 loc) · 4.75 KB

event_inject.md

File metadata and controls

54 lines (30 loc) · 4.75 KB
description
Description of the 'event_inject' function in HyperDbg Scripts

event_inject

Function

event_inject

Syntax

event_inject( InterruptionType, Vector);

Parameters

[ Expression (InterruptionType)]

Type of the target interrupt/exception/fault (see the Remarks section for more information). Can be selected from the following table:

Interruption TypeDescription
0External interrupt
1Reserved
2Non-maskable interrupt (NMI)
3Hardware exception (e.g,. #PF)
4Software interrupt (INT n)
5Privileged software exception (INT1)
6Software exception (INT3 or INTO)
7Other event

[ Expression (Vector)]

The vector number (interrupt IDT vector number) of the target interrupt/exception/fault. Can be selected from the following table:

NameVector nr.TypeMnemonicError code?
Divide-by-zero Error0 (0x0)Fault#DENo
Debug1 (0x1)Fault/Trap#DBNo
Non-maskable Interrupt2 (0x2)Interrupt-No
Breakpoint3 (0x3)Trap#BPNo
Overflow4 (0x4)Trap#OFNo
Bound Range Exceeded5 (0x5)Fault#BRNo
Invalid Opcode6 (0x6)Fault#UDNo
Device Not Available7 (0x7)Fault#NMNo
Double Fault8 (0x8)Abort#DFYes (Zero)
Coprocessor Segment Overrun9 (0x9)Fault-No
Invalid TSS10 (0xA)Fault#TSYes
Segment Not Present11 (0xB)Fault#NPYes
Stack-Segment Fault12 (0xC)Fault#SSYes
General Protection Fault13 (0xD)Fault#GPYes
Page Fault14 (0xE)Fault#PFYes
Reserved15 (0xF)--No
x87 Floating-Point Exception16 (0x10)Fault#MFNo
Alignment Check17 (0x11)Fault#ACYes
Machine Check18 (0x12)Abort#MCNo
SIMD Floating-Point Exception19 (0x13)Fault#XM/#XFNo
Virtualization Exception20 (0x14)Fault#VENo
Reserved21-29 (0x15-0x1D)--No
Security Exception30 (0x1E)-#SXYes
Reserved31 (0x1F)--No
Triple Fault---No
FPU Error InterruptIRQ 13Interrupt#FERRNo

Description

Injects an interrupt/exception/fault which will be delivered once you continue the debuggee.

Examples

event_inject(6, 3);

Injects a breakpoint (Software Exception = 6 and Vector equal to Breakpoint = 3) to the target debuggee.

Remarks

This function won't set the error code. If the target interrupt/exception/fault needs an error code (see the table above), you should use the event_inject_error_code.

The interruption type determines the details of how the injection is performed. In general, you should use the type hardware exception for all exceptions other than the following:

  • breakpoint exceptions (#BP; a VMM should use the type software exception);
  • overflow exceptions (#OF a VMM should use the use type software exception); and
  • those debug exceptions (#DB) that are generated by INT1 (a VMM should use the use type privileged software exception).
  • The type of other event is used for the injection of events that are not delivered through the IDT.

Starting from v0.6, this function was added to the HyperDbg debugger.

Related

event_inject_error_code