From f03bacf0662eae7f907bd3c680ac9abb9bba7528 Mon Sep 17 00:00:00 2001 From: Olivier Bilodeau Date: Fri, 31 May 2024 15:35:45 -0400 Subject: [PATCH] Log unknown NTSTATUS values --- pyrdp/parser/rdp/virtual_channel/device_redirection.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyrdp/parser/rdp/virtual_channel/device_redirection.py b/pyrdp/parser/rdp/virtual_channel/device_redirection.py index 8d3b54592..c01765ef4 100644 --- a/pyrdp/parser/rdp/virtual_channel/device_redirection.py +++ b/pyrdp/parser/rdp/virtual_channel/device_redirection.py @@ -13,6 +13,7 @@ FileCreateOptions, FileShareAccess, FileSystemInformationClass, \ GeneralCapabilityVersion, MajorFunction, MinorFunction, \ RDPDRCapabilityType, NTSTATUS +from pyrdp.logging import log from pyrdp.parser import Parser from pyrdp.pdu import DeviceAnnounce, DeviceCloseRequestPDU, DeviceCloseResponsePDU, DeviceCreateRequestPDU, \ DeviceCreateResponsePDU, DeviceDirectoryControlResponsePDU, DeviceIORequestPDU, DeviceIOResponsePDU, \ @@ -296,6 +297,8 @@ def parseDeviceIOResponse(self, stream: BytesIO) -> DeviceIOResponsePDU: deviceID = Uint32LE.unpack(stream) completionID = Uint32LE.unpack(stream) ioStatus = NTSTATUS(Uint32LE.unpack(stream)) + if ioStatus._name_ == "STATUS_PYRDP_FAILURE": + log.error("Unknown NTSTATUS value: %(value)", {"value": ioStatus._value_}) majorFunction = self.majorFunctionsForParsingResponse.pop(completionID, None)