(self, message)
| 1085 | message.command = SMB_COM_WRITE_ANDX |
| 1086 | |
| 1087 | def prepare(self, message): |
| 1088 | # constant 1 is to account for the pad byte in the message.data |
| 1089 | # constant 2 is for the ByteCount field in the SMB header (i.e. field which indicates number of data bytes after the SMB parameters) |
| 1090 | data_offset = message.HEADER_STRUCT_SIZE + self.DEFAULT_ANDX_PARAM_SIZE + self.PAYLOAD_STRUCT_SIZE + 1 + 2 |
| 1091 | data_len = len(self.data_bytes) |
| 1092 | |
| 1093 | message.parameters_data = \ |
| 1094 | self.DEFAULT_ANDX_PARAM_HEADER + \ |
| 1095 | struct.pack(self.PAYLOAD_STRUCT_FORMAT, |
| 1096 | self.fid, |
| 1097 | self.offset & 0xFFFFFFFF, |
| 1098 | self.timeout, |
| 1099 | self.write_mode, |
| 1100 | data_len, # Remaining |
| 1101 | 0x0000, # Reserved |
| 1102 | len(self.data_bytes), # DataLength |
| 1103 | data_offset, # DataOffset |
| 1104 | self.offset >> 32) # OffsetHigh field defined in [MS-SMB]: 2.2.4.3.1 |
| 1105 | |
| 1106 | message.data = b'\0' + self.data_bytes |
| 1107 | |
| 1108 | |
| 1109 | class ComWriteAndxResponse(Payload): |
nothing calls this directly
no outgoing calls
no test coverage detected