Skip to content

Commit b9852e8

Browse files
hpoussinHBelusca
authored andcommitted
[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).
1 parent 5547b74 commit b9852e8

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

ntoskrnl/ex/dbgctrl.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,17 @@ NtSystemDebugControl(
267267
case SysDbgWriteBusData:
268268
case SysDbgCheckLowMemory:
269269
/* Those are implemented in KdSystemDebugControl */
270-
Status = STATUS_NOT_IMPLEMENTED;
270+
if (InitIsWinPEMode)
271+
{
272+
Status = KdSystemDebugControl(Command,
273+
InputBuffer, InputBufferLength,
274+
OutputBuffer, OutputBufferLength,
275+
&Length, PreviousMode);
276+
}
277+
else
278+
{
279+
Status = STATUS_NOT_IMPLEMENTED;
280+
}
271281
break;
272282

273283
case SysDbgBreakPoint:

0 commit comments

Comments
 (0)