[NTOS:EX] HACK: on livecd, disable security features in NtSystemDebugControl

WinDBG can do some local debugging using 'windbg -kl'. In that case,
WinDBG tries to directly use NtSystemDebugControl. If this function
returns an error, WinDBG extracts a driver from its resources.
WinDBG will send IOCTLs to this driver, and this driver will call
KdSystemDebugControl.

However, on livecd (where %SYSTEMROOT% is read-only), WinDBG is unable
to extract the driver from its resources, and can't use the driver to
call KdSystemDebugControl.

As a work-around, allow all control classes in NtSystemDebugControl
in case of livecd.
WinDBG local debugging now also works on livecd (windbg -kl).
This commit is contained in:
Hervé Poussineau 2024-09-22 21:43:25 +02:00 committed by Hermès Bélusca-Maïto
parent 032e4407fa
commit 199d6ac256
No known key found for this signature in database
GPG Key ID: 3B2539C65E7B93D0

View File

@ -261,7 +261,17 @@ NtSystemDebugControl(
case SysDbgWriteBusData:
case SysDbgCheckLowMemory:
/* Those are implemented in KdSystemDebugControl */
Status = STATUS_NOT_IMPLEMENTED;
if (InitIsWinPEMode)
{
Status = KdSystemDebugControl(Command,
InputBuffer, InputBufferLength,
OutputBuffer, OutputBufferLength,
&Length, PreviousMode);
}
else
{
Status = STATUS_NOT_IMPLEMENTED;
}
break;
case SysDbgBreakPoint: