MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / ComReadAndxResponse

Class ComReadAndxResponse

pager_lib/smb/smb_structs.py:1173–1196  ·  view source on GitHub ↗

References: =========== - [MS-CIFS]: 2.2.4.42.2 - [MS-SMB]: 2.2.4.2.2

Source from the content-addressed store, hash-verified

1171
1172
1173class ComReadAndxResponse(Payload):
1174 """
1175 References:
1176 ===========
1177 - [MS-CIFS]: 2.2.4.42.2
1178 - [MS-SMB]: 2.2.4.2.2
1179 """
1180
1181 PAYLOAD_STRUCT_FORMAT = '<BBHHHHHHHHHHH'
1182 PAYLOAD_STRUCT_SIZE = struct.calcsize(PAYLOAD_STRUCT_FORMAT)
1183
1184 def decode(self, message):
1185 assert message.command == SMB_COM_READ_ANDX
1186
1187 if not message.status.hasError:
1188 if len(message.parameters_data) < self.PAYLOAD_STRUCT_SIZE:
1189 raise ProtocolError('Not enough data to decode SMB_COM_READ_ANDX parameters', message.raw_data, message)
1190
1191 _, _, _, _, _, _, self.data_length, data_offset, _, _, _, _, _ = struct.unpack(self.PAYLOAD_STRUCT_FORMAT,
1192 message.parameters_data[:self.PAYLOAD_STRUCT_SIZE])
1193
1194 offset = data_offset - message.HEADER_STRUCT_SIZE - self.PAYLOAD_STRUCT_SIZE - 2 # constant 2 is for the ByteCount field in the SMB header (i.e. field which indicates number of data bytes after the SMB parameters)
1195 self.data = message.data[offset:offset+self.data_length]
1196 assert len(self.data) == self.data_length
1197
1198
1199class ComDeleteRequest(Payload):

Callers 1

_decodePayloadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected