示例#1
0
        public SetInformationRequest(byte[] buffer, int offset, bool isUnicode) : base(buffer, offset, isUnicode)
        {
            FileAttributes = (FileAttributes)LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
            LastWriteTime  = SMBHelper.ReadUTime(this.SMBParameters, 2);
            Reserved       = ByteReader.ReadBytes(this.SMBParameters, 6, 10);

            BufferFormat = ByteReader.ReadByte(this.SMBData, 0);
            if (BufferFormat != SupportedBufferFormat)
            {
                throw new InvalidRequestException("Unsupported Buffer Format");
            }
            FileName = SMBHelper.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 = (FileAttributes)LittleEndianConverter.ToUInt16(parameters, 6);
            CreationTime = SMBHelper.ReadUTime(parameters, 8);
            OpenMode = new OpenMode(parameters, 12);
            AllocationSize = LittleEndianConverter.ToUInt32(parameters, 14);
            Reserved = ByteReader.ReadBytes(parameters, 18, 10);
            FileName = SMBHelper.ReadSMBString(parameters, 28, isUnicode);

            ExtendedAttributeList = new FullExtendedAttributeList(data, 0);
        }
示例#3
0
 public Transaction2Open2Response(byte[] parameters, byte[] data, bool isUnicode) : base()
 {
     FID            = LittleEndianConverter.ToUInt16(parameters, 0);
     FileAttributes = (FileAttributes)LittleEndianConverter.ToUInt16(parameters, 2);
     CreationTime   = SMBHelper.ReadUTime(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);
 }
        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    = (FileAttributes)LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            FileAttrs      = (FileAttributes)LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            CreationTime   = SMBHelper.ReadUTime(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 = SMBHelper.ReadSMBString(this.SMBData, dataOffset, isUnicode);
        }
示例#5
0
 public CloseRequest(byte[] buffer, int offset) : base(buffer, offset, false)
 {
     FID = LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
     LastTimeModified = SMBHelper.ReadUTime(this.SMBParameters, 2);
 }