References: =========== - [MS-CIFS]: 2.2.4.43.2 - [MS-SMB]: 2.2.4.3.2
| 1107 | |
| 1108 | |
| 1109 | class ComWriteAndxResponse(Payload): |
| 1110 | """ |
| 1111 | References: |
| 1112 | =========== |
| 1113 | - [MS-CIFS]: 2.2.4.43.2 |
| 1114 | - [MS-SMB]: 2.2.4.3.2 |
| 1115 | """ |
| 1116 | |
| 1117 | PAYLOAD_STRUCT_FORMAT = '<BBHHHHH' # We follow the SMB_COM_WRITEX_ANDX server extensions in [MS-SMB]: 2.2.4.3.2 |
| 1118 | PAYLOAD_STRUCT_SIZE = struct.calcsize(PAYLOAD_STRUCT_FORMAT) |
| 1119 | |
| 1120 | def decode(self, message): |
| 1121 | assert message.command == SMB_COM_WRITE_ANDX |
| 1122 | |
| 1123 | if not message.status.hasError: |
| 1124 | if len(message.parameters_data) < self.PAYLOAD_STRUCT_SIZE: |
| 1125 | raise ProtocolError('Not enough data to decode SMB_COM_WRITE_ANDX parameters', message.raw_data, message) |
| 1126 | |
| 1127 | _, _, _, count, self.available, high_count, _ = struct.unpack(self.PAYLOAD_STRUCT_FORMAT, message.parameters_data[:self.PAYLOAD_STRUCT_SIZE]) |
| 1128 | self.count = (count & 0xFFFF) | (high_count << 16) |
| 1129 | |
| 1130 | |
| 1131 | class ComReadAndxRequest(Payload): |