event_inject_error_code

Description of the 'event_inject_error_code' function in HyperDbg Scripts

Function

event_inject_error_code

Syntax

event_inject_error_code( InterruptionType, Vector, ErrorCode);

Parameters

[ Expression (InterruptionType)]

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

[ Expression (Vector)]

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

[ Expression (ErrorCode)]

The target error code number of the interrupt/exception/fault.

Description

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

Examples

event_inject_error_code(3, e, 2);

Injects a page-fault (Hardware Exception = 3 and Vector equal to Page-fault = 0xe, and Error code equal to Write Access = 2) to the target debuggee.

Remarks

This function will set the error code. If the target interrupt/exception/fault doesn't need an error code (see the table above), you should use the event_inject.

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.

event_inject

Last updated