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);
        }
 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);
 }
Пример #3
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);
        }