References: =========== - [MS-SMB2]: 2.2.33
| 665 | |
| 666 | |
| 667 | class SMB2QueryDirectoryRequest(Structure): |
| 668 | """ |
| 669 | References: |
| 670 | =========== |
| 671 | - [MS-SMB2]: 2.2.33 |
| 672 | """ |
| 673 | |
| 674 | STRUCTURE_FORMAT = "<HBBI16sHHI" |
| 675 | STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT) |
| 676 | |
| 677 | def __init__(self, fid, filename, info_class, flags, output_buf_len): |
| 678 | self.fid = fid |
| 679 | self.filename = filename |
| 680 | self.info_class = info_class |
| 681 | self.flags = flags |
| 682 | self.output_buf_len = output_buf_len |
| 683 | |
| 684 | def initMessage(self, message): |
| 685 | Structure.initMessage(self, message) |
| 686 | message.command = SMB2_COM_QUERY_DIRECTORY |
| 687 | |
| 688 | def prepare(self, message): |
| 689 | message.data = struct.pack(self.STRUCTURE_FORMAT, |
| 690 | 33, # Structure size. Must be 33 as mandated by [MS-SMB2] 2.2.33 |
| 691 | self.info_class, # FileInformationClass |
| 692 | self.flags, # Flags |
| 693 | 0, # FileIndex |
| 694 | self.fid, # FileID |
| 695 | SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE, # FileNameOffset |
| 696 | len(self.filename)*2, |
| 697 | self.output_buf_len) + self.filename.encode('UTF-16LE') |
| 698 | |
| 699 | |
| 700 | class SMB2QueryDirectoryResponse(Structure): |