|
HyperDbg Debugger
|
Header for routines related to kernel mode debugging. More...
Go to the source code of this file.
Classes | |
| struct | _DEBUGGEE_REQUEST_TO_CHANGE_PROCESS |
| request to change the process More... | |
| struct | _DEBUGGEE_REQUEST_TO_CHANGE_THREAD |
| request to change the thread More... | |
| struct | _DEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT |
| request to pause and halt the system More... | |
| struct | _HARDWARE_DEBUG_REGISTER_DETAILS |
| store the details of a hardware debug register to ignore any trigger for other threads More... | |
Typedefs | |
| typedef struct _DEBUGGEE_REQUEST_TO_CHANGE_PROCESS | DEBUGGEE_REQUEST_TO_CHANGE_PROCESS |
| request to change the process | |
| typedef struct _DEBUGGEE_REQUEST_TO_CHANGE_PROCESS * | PDEBUGGEE_REQUEST_TO_CHANGE_PROCESS |
| typedef struct _DEBUGGEE_REQUEST_TO_CHANGE_THREAD | DEBUGGEE_REQUEST_TO_CHANGE_THREAD |
| request to change the thread | |
| typedef struct _DEBUGGEE_REQUEST_TO_CHANGE_THREAD * | PDEBUGGEE_REQUEST_TO_CHANGE_THREAD |
| typedef struct _DEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT | DEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT |
| request to pause and halt the system | |
| typedef struct _DEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT * | PDEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT |
| typedef struct _HARDWARE_DEBUG_REGISTER_DETAILS | HARDWARE_DEBUG_REGISTER_DETAILS |
| store the details of a hardware debug register to ignore any trigger for other threads | |
| typedef struct _HARDWARE_DEBUG_REGISTER_DETAILS * | PHARDWARE_DEBUG_REGISTER_DETAILS |
Functions | |
| VOID | KdHaltSystem (PDEBUGGER_PAUSE_PACKET_RECEIVED PausePacket) |
| Halt the system. | |
| VOID | KdHandleDebugEventsWhenKernelDebuggerIsAttached (PROCESSOR_DEBUGGING_STATE *DbgState, BOOLEAN TrapSetByDebugger) |
| Handles debug events when kernel-debugger is attached. | |
| VOID | KdManageSystemHaltOnVmxRoot (PROCESSOR_DEBUGGING_STATE *DbgState, PDEBUGGER_TRIGGERED_EVENT_DETAILS EventDetails) |
| manage system halt on vmx-root mode | |
| VOID | KdHandleNmi (_Inout_ PROCESSOR_DEBUGGING_STATE *DbgState) |
| VOID | KdInitializeKernelDebugger () |
| initialize kernel debugger | |
| VOID | KdUninitializeKernelDebugger () |
| uninitialize kernel debugger | |
| VOID | KdInitializeInstantEventPools () |
| Initialize the required pools for instant events. | |
| VOID | KdSendFormatsFunctionResult (UINT64 Value) |
| Send the result of formats command to the kernel debugger. | |
| VOID | KdSendCommandFinishedSignal (UINT32 CoreId) |
| Notify debugger that the execution of command finished. | |
| VOID | KdHandleBreakpointAndDebugBreakpointsCallback (_In_ UINT32 CoreId, _In_ DEBUGGEE_PAUSING_REASON Reason, PDEBUGGER_TRIGGERED_EVENT_DETAILS EventDetails) |
| VOID | KdHandleBreakpointAndDebugBreakpoints (_Inout_ PROCESSOR_DEBUGGING_STATE *DbgState, _In_ DEBUGGEE_PAUSING_REASON Reason, PDEBUGGER_TRIGGERED_EVENT_DETAILS EventDetails) |
| VOID | KdHandleHaltsWhenNmiReceivedFromVmxRoot (_Inout_ PROCESSOR_DEBUGGING_STATE *DbgState) |
| BOOLEAN | KdHandleMtfCallback (UINT32 CoreId) |
| Handle Monitor Trap Flag (MTF) callback for kernel debugger. | |
| BOOLEAN | KdCheckImmediateMessagingMechanism (UINT32 OperationCode) |
| Checks whether the immediate messaging mechism is needed or not. | |
| BOOLEAN | KdResponsePacketToDebugger (_In_ _Strict_type_match_ DEBUGGER_REMOTE_PACKET_TYPE PacketType, _In_ _Strict_type_match_ DEBUGGER_REMOTE_PACKET_REQUESTED_ACTION Response, _In_reads_bytes_opt_(OptionalBufferLength) CHAR *OptionalBuffer, _In_ UINT32 OptionalBufferLength) |
| BOOLEAN | KdLoggingResponsePacketToDebugger (_In_reads_bytes_(OptionalBufferLength) CHAR *OptionalBuffer, _In_ UINT32 OptionalBufferLength, _In_ UINT32 OperationCode) |
| BOOLEAN | KdCheckGuestOperatingModeChanges (UINT16 PreviousCsSelector, UINT16 CurrentCsSelector) |
| Check if the execution mode (kernel-mode to user-mode or user-mode to kernel-mode) changed. | |
| BOOLEAN | KdIsGuestOnUsermode32Bit () |
| determines if the guest was in 32-bit user-mode or 64-bit (long mode) | |
| VOID | KdHandleNmiBroadcastDebugBreaks (UINT32 CoreId, BOOLEAN IsOnVmxNmiHandler) |
| Handle broadcast NMIs for halting cores in vmx-root mode. | |
| VOID | KdUnlockTheHaltedCore (PROCESSOR_DEBUGGING_STATE *DbgState) |
| unlock the target core | |
| BOOLEAN | KdCheckTheHaltedCore (PROCESSOR_DEBUGGING_STATE *DbgState) |
| check the lock state of the target core | |
| BOOLEAN | KdQueryDebuggerQueryThreadOrProcessTracingDetailsByCoreId (UINT32 CoreId, DEBUGGER_THREAD_PROCESS_TRACING TracingType) |
| Query for process/thread interception status. | |
| BOOLEAN | KdQueryIgnoreHandlingMov2DebugRegs (UINT32 CoreId) |
| Query to ignore handling mov 2 debug regs exiting. | |
Variables | |
| volatile LONG | DebuggerResponseLock |
| Vmx-root lock for sending response of debugger. | |
| volatile LONG | DebuggerHandleBreakpointLock |
| Vmx-root lock for handling breaks to debugger. | |
Header for routines related to kernel mode debugging.
request to change the process
request to change the thread
| typedef struct _DEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT DEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT |
request to pause and halt the system
| typedef struct _HARDWARE_DEBUG_REGISTER_DETAILS HARDWARE_DEBUG_REGISTER_DETAILS |
store the details of a hardware debug register to ignore any trigger for other threads
| typedef struct _DEBUGGEE_REQUEST_TO_CHANGE_PROCESS * PDEBUGGEE_REQUEST_TO_CHANGE_PROCESS |
| typedef struct _DEBUGGEE_REQUEST_TO_CHANGE_THREAD * PDEBUGGEE_REQUEST_TO_CHANGE_THREAD |
| typedef struct _DEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT * PDEBUGGEE_REQUEST_TO_IGNORE_BREAKS_UNTIL_AN_EVENT |
| typedef struct _HARDWARE_DEBUG_REGISTER_DETAILS * PHARDWARE_DEBUG_REGISTER_DETAILS |
Check if the execution mode (kernel-mode to user-mode or user-mode to kernel-mode) changed.
| PreviousCsSelector | |
| CurrentCsSelector |
Checks whether the immediate messaging mechism is needed or not.
| OperationCode |
| BOOLEAN KdCheckTheHaltedCore | ( | PROCESSOR_DEBUGGING_STATE * | DbgState | ) |
check the lock state of the target core
| DbgState | The state of the debugger on the target core |
| VOID KdHaltSystem | ( | PDEBUGGER_PAUSE_PACKET_RECEIVED | PausePacket | ) |
Halt the system.
| PausePacket |
| VOID KdHandleBreakpointAndDebugBreakpoints | ( | _Inout_ PROCESSOR_DEBUGGING_STATE * | DbgState, |
| _In_ DEBUGGEE_PAUSING_REASON | Reason, | ||
| PDEBUGGER_TRIGGERED_EVENT_DETAILS | EventDetails ) |
| VOID KdHandleBreakpointAndDebugBreakpointsCallback | ( | _In_ UINT32 | CoreId, |
| _In_ DEBUGGEE_PAUSING_REASON | Reason, | ||
| PDEBUGGER_TRIGGERED_EVENT_DETAILS | EventDetails ) |
| VOID KdHandleDebugEventsWhenKernelDebuggerIsAttached | ( | PROCESSOR_DEBUGGING_STATE * | DbgState, |
| BOOLEAN | TrapSetByDebugger ) |
Handles debug events when kernel-debugger is attached.
| DbgState | The state of the debugger on the current core |
| TrapSetByDebugger | Shows whether a trap set by debugger or not |
| VOID KdHandleHaltsWhenNmiReceivedFromVmxRoot | ( | _Inout_ PROCESSOR_DEBUGGING_STATE * | DbgState | ) |
Handle Monitor Trap Flag (MTF) callback for kernel debugger.
This function will be called from vmx-root mode
| CoreId |
| VOID KdHandleNmi | ( | _Inout_ PROCESSOR_DEBUGGING_STATE * | DbgState | ) |
Handle broadcast NMIs for halting cores in vmx-root mode.
| CoreId | |
| IsOnVmxNmiHandler |
| VOID KdInitializeInstantEventPools | ( | ) |
Initialize the required pools for instant events.
| VOID KdInitializeKernelDebugger | ( | ) |
initialize kernel debugger
this function should be called on vmx non-root
| BOOLEAN KdIsGuestOnUsermode32Bit | ( | ) |
determines if the guest was in 32-bit user-mode or 64-bit (long mode)
this function should be called from vmx-root
| BOOLEAN KdLoggingResponsePacketToDebugger | ( | _In_reads_bytes_(OptionalBufferLength) CHAR * | OptionalBuffer, |
| _In_ UINT32 | OptionalBufferLength, | ||
| _In_ UINT32 | OperationCode ) |
| VOID KdManageSystemHaltOnVmxRoot | ( | PROCESSOR_DEBUGGING_STATE * | DbgState, |
| PDEBUGGER_TRIGGERED_EVENT_DETAILS | EventDetails ) |
manage system halt on vmx-root mode
This function should only be called from KdHandleBreakpointAndDebugBreakpoints
| DbgState | The state of the debugger on the current core |
| EventDetails | |
| MainCore | the core that triggered the event |
| BOOLEAN KdQueryDebuggerQueryThreadOrProcessTracingDetailsByCoreId | ( | UINT32 | CoreId, |
| DEBUGGER_THREAD_PROCESS_TRACING | TracingType ) |
Query for process/thread interception status.
| CoreId | |
| TracingType |
Query to ignore handling mov 2 debug regs exiting.
| CoreId |
| BOOLEAN KdResponsePacketToDebugger | ( | _In_ _Strict_type_match_ DEBUGGER_REMOTE_PACKET_TYPE | PacketType, |
| _In_ _Strict_type_match_ DEBUGGER_REMOTE_PACKET_REQUESTED_ACTION | Response, | ||
| _In_reads_bytes_opt_(OptionalBufferLength) CHAR * | OptionalBuffer, | ||
| _In_ UINT32 | OptionalBufferLength ) |
| VOID KdSendCommandFinishedSignal | ( | UINT32 | CoreId | ) |
Notify debugger that the execution of command finished.
| CoreId |
| VOID KdSendFormatsFunctionResult | ( | UINT64 | Value | ) |
Send the result of formats command to the kernel debugger.
| Value |
| VOID KdUninitializeKernelDebugger | ( | ) |
uninitialize kernel debugger
this function should be called on vmx non-root
| VOID KdUnlockTheHaltedCore | ( | PROCESSOR_DEBUGGING_STATE * | DbgState | ) |
unlock the target core
| DbgState | The state of the debugger on the target core |
| volatile LONG DebuggerHandleBreakpointLock |
Vmx-root lock for handling breaks to debugger.
| volatile LONG DebuggerResponseLock |
Vmx-root lock for sending response of debugger.