VOID
KiDispatchException (
IN PEXCEPTION_RECORD ExceptionRecord,
IN PKEXCEPTION_FRAME ExceptionFrame,
IN PKTRAP_FRAME TrapFrame,
IN KPROCESSOR_MODE PreviousMode,
IN BOOLEAN FirstChance
);
(1)不是FirstChance
->CHAR al = KdpTrap(rcx,rdx,r8,r9,0,1);
->al为FALSE KeBugCheckEx(0x1E...)
->al为TRUE KeContextToKframes 然后return
(2)FirstChance
->CHAR al = KdpTrap(rcx,rdx,r8,r9,0,0);al为TRUE KeContextToKframes 然后return
->al为FALSE al = RtlDispatchException();al为TRUE KeContextToKframes 然后return
->al仍为FALSE al = KdpTrap(rcx,rdx,r8,r9,0,1);al为TRUE KeContextToKframes 然后return
->al仍为FALSE KeBugCheckEx(0x1E...)
除去SEH 关键在于KdpTrap 原型:
typedef
BOOLEAN
(*PKDEBUG_ROUTINE) (
IN PKTRAP_FRAME TrapFrame,
IN PKEXCEPTION_FRAME ExceptionFrame,
IN PEXCEPTION_RECORD ExceptionRecord,
IN PCONTEXT ContextRecord,
IN KPROCESSOR_MODE PreviousMode,
IN BOOLEAN SecondChance
);