Esempio n. 1
0
 public QueryInformationResponse(byte[] buffer, int offset) : base(buffer, offset, false)
 {
     FileAttributes = (SMBFileAttributes)LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
     LastWriteTime  = UTimeHelper.ReadNullableUTime(this.SMBParameters, 2);
     FileSize       = LittleEndianConverter.ToUInt32(this.SMBParameters, 6);
     Reserved       = ByteReader.ReadBytes(this.SMBParameters, 10, 10);
 }
Esempio n. 2
0
        public SetInformationRequest(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
        {
            FileAttributes = (SMBFileAttributes)LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
            LastWriteTime  = UTimeHelper.ReadNullableUTime(this.SMBParameters, 2);
            Reserved       = ByteReader.ReadBytes(this.SMBParameters, 6, 10);

            BufferFormat = ByteReader.ReadByte(this.SMBData, 0);
            if (BufferFormat != SupportedBufferFormat)
            {
                throw new InvalidDataException("Unsupported Buffer Format");
            }
            FileName = SMB1Helper.ReadSMBString(this.SMBData, 1, isUnicode);
        }
        public Transaction2Open2Request(byte[] parameters, byte[] data, bool isUnicode) : base()
        {
            Flags          = (Open2Flags)LittleEndianConverter.ToUInt16(parameters, 0);
            AccessMode     = new AccessModeOptions(parameters, 2);
            Reserved1      = LittleEndianConverter.ToUInt16(parameters, 4);
            FileAttributes = (SMBFileAttributes)LittleEndianConverter.ToUInt16(parameters, 6);
            CreationTime   = UTimeHelper.ReadNullableUTime(parameters, 8);
            OpenMode       = new OpenMode(parameters, 12);
            AllocationSize = LittleEndianConverter.ToUInt32(parameters, 14);
            Reserved       = ByteReader.ReadBytes(parameters, 18, 10);
            FileName       = SMB1Helper.ReadSMBString(parameters, 28, isUnicode);

            ExtendedAttributeList = new FullExtendedAttributeList(data, 0);
        }
 public Transaction2Open2Response(byte[] parameters, byte[] data, bool isUnicode) : base()
 {
     FID            = LittleEndianConverter.ToUInt16(parameters, 0);
     FileAttributes = (SMBFileAttributes)LittleEndianConverter.ToUInt16(parameters, 2);
     CreationTime   = UTimeHelper.ReadNullableUTime(parameters, 4);
     FileDataSize   = LittleEndianConverter.ToUInt32(parameters, 8);
     AccessMode     = new AccessModeOptions(parameters, 12);
     ResourceType   = (ResourceType)LittleEndianConverter.ToUInt16(parameters, 14);
     NMPipeStatus   = new NamedPipeStatus(parameters, 16);
     ActionTaken    = new ActionTaken(parameters, 18);
     Reserved       = LittleEndianConverter.ToUInt32(parameters, 20);
     ExtendedAttributeErrorOffset = LittleEndianConverter.ToUInt16(parameters, 24);
     ExtendedAttributeLength      = LittleEndianConverter.ToUInt32(parameters, 26);
 }
Esempio n. 5
0
        public OpenAndXResponse(byte[] buffer, int offset) : base(buffer, offset)
        {
            int parametersOffset = 4;

            FID           = LittleEndianReader.ReadUInt16(SMBParameters, ref parametersOffset);
            FileAttrs     = (SMBFileAttributes)LittleEndianReader.ReadUInt16(SMBParameters, ref parametersOffset);
            LastWriteTime = UTimeHelper.ReadNullableUTime(SMBParameters, ref parametersOffset);
            FileDataSize  = LittleEndianReader.ReadUInt32(SMBParameters, ref parametersOffset);
            AccessRights  = (AccessRights)LittleEndianReader.ReadUInt16(SMBParameters, ref parametersOffset);
            ResourceType  = (ResourceType)LittleEndianReader.ReadUInt16(SMBParameters, ref parametersOffset);
            NMPipeStatus  = NamedPipeStatus.Read(SMBParameters, ref parametersOffset);
            OpenResults   = OpenResults.Read(SMBParameters, ref parametersOffset);
            Reserved      = ByteReader.ReadBytes(SMBParameters, ref parametersOffset, 6);
        }
Esempio n. 6
0
        public OpenAndXRequest(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
        {
            int parametersOffset = 4;

            Flags          = (OpenFlags)LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            AccessMode     = AccessModeOptions.Read(this.SMBParameters, ref parametersOffset);
            SearchAttrs    = (SMBFileAttributes)LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            FileAttrs      = (SMBFileAttributes)LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            CreationTime   = UTimeHelper.ReadNullableUTime(this.SMBParameters, ref parametersOffset);
            OpenMode       = OpenMode.Read(this.SMBParameters, ref parametersOffset);
            AllocationSize = LittleEndianReader.ReadUInt32(this.SMBParameters, ref parametersOffset);
            Timeout        = LittleEndianReader.ReadUInt32(this.SMBParameters, ref parametersOffset);
            Reserved       = LittleEndianReader.ReadUInt32(this.SMBParameters, ref parametersOffset);

            int dataOffset = 0;

            if (isUnicode)
            {
                dataOffset = 1; // 1 byte padding for 2 byte alignment
            }
            FileName = SMB1Helper.ReadSMBString(this.SMBData, dataOffset, isUnicode);
        }
Esempio n. 7
0
 public CloseRequest(byte[] buffer, int offset) : base(buffer, offset, false)
 {
     FID = LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
     LastTimeModified = UTimeHelper.ReadNullableUTime(this.SMBParameters, 2);
 }