Contains information about the SMB2_IOCTL response from the server. If the message has no errors, each instance contains the following attributes: - ctlcode (integer) - fid (16-bytes string) - flags (integer) - in_data (string) - out_data (string) References: =
| 590 | |
| 591 | |
| 592 | class SMB2IoctlResponse(Structure): |
| 593 | """ |
| 594 | Contains information about the SMB2_IOCTL response from the server. |
| 595 | |
| 596 | If the message has no errors, each instance contains the following attributes: |
| 597 | - ctlcode (integer) |
| 598 | - fid (16-bytes string) |
| 599 | - flags (integer) |
| 600 | - in_data (string) |
| 601 | - out_data (string) |
| 602 | |
| 603 | References: |
| 604 | =========== |
| 605 | - [MS-SMB2]: 2.2.32 |
| 606 | """ |
| 607 | |
| 608 | STRUCTURE_FORMAT = "<HHI16sIIIIII" |
| 609 | STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT) |
| 610 | |
| 611 | def decode(self, message): |
| 612 | assert message.command == SMB2_COM_IOCTL |
| 613 | |
| 614 | if message.status == 0: |
| 615 | struct_size, _, self.ctlcode, self.fid, \ |
| 616 | input_offset, input_len, output_offset, output_len, \ |
| 617 | self.flags, _ = struct.unpack(self.STRUCTURE_FORMAT, message.raw_data[SMB2Message.HEADER_SIZE:SMB2Message.HEADER_SIZE+self.STRUCTURE_SIZE]) |
| 618 | |
| 619 | if input_len > 0: |
| 620 | self.in_data = message.raw_data[input_offset:input_offset+input_len] |
| 621 | else: |
| 622 | self.in_data = b'' |
| 623 | |
| 624 | if output_len > 0: |
| 625 | self.out_data = message.raw_data[output_offset:output_offset+output_len] |
| 626 | else: |
| 627 | self.out_data = b'' |
| 628 | |
| 629 | |
| 630 | class SMB2CloseRequest(Structure): |