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

Class SMB2QueryInfoRequest

pager_lib/smb/smb2_structs.py:724–759  ·  view source on GitHub ↗

References: =========== - [MS-SMB2]: 2.2.37

Source from the content-addressed store, hash-verified

722
723
724class SMB2QueryInfoRequest(Structure):
725 """
726 References:
727 ===========
728 - [MS-SMB2]: 2.2.37
729 """
730
731 STRUCTURE_FORMAT = "<HBBIHHIII16s"
732 STRUCTURE_SIZE = struct.calcsize(STRUCTURE_FORMAT)
733
734 def __init__(self, fid, flags, additional_info, info_type, file_info_class, input_buf, output_buf_len):
735 self.fid = fid
736 self.flags = flags
737 self.additional_info = additional_info
738 self.info_type = info_type
739 self.file_info_class = file_info_class
740 self.output_buf_len = output_buf_len
741 self.input_buf = input_buf or b''
742
743 def initMessage(self, message):
744 Structure.initMessage(self, message)
745 message.command = SMB2_COM_QUERY_INFO
746
747 def prepare(self, message):
748 message.data = struct.pack(self.STRUCTURE_FORMAT,
749 41, # Structure size. Must be 41 as mandated by [MS-SMB2] 2.2.37
750 self.info_type, # InfoType
751 self.file_info_class, # FileInfoClass
752 self.output_buf_len, # OutputBufferLength
753 SMB2Message.HEADER_SIZE + self.STRUCTURE_SIZE, # InputBufferOffset
754 0, # Reserved
755 len(self.input_buf), # InputBufferLength
756 self.additional_info, # AdditionalInformation
757 self.flags, # Flags
758 self.fid # FileId
759 ) + self.input_buf
760
761
762class SMB2QueryInfoResponse(Structure):

Callers 1

createCBMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected