public NTTransactCreateRequest(byte[] parameters, byte[] data, bool isUnicode)
        {
            int parametersOffset = 0;

            Flags             = (NTCreateFlags)LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            RootDirectoryFID  = LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            DesiredAccess     = (DesiredAccess)LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            AllocationSize    = LittleEndianReader.ReadUInt64(parameters, ref parametersOffset);
            ExtFileAttributes = (ExtendedFileAttributes)LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            ShareAccess       = (ShareAccess)LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            CreateDisposition = (CreateDisposition)LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            CreateOptions     = (CreateOptions)LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            uint securityDescriptiorLength = LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            uint eaLength   = LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            uint nameLength = LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);

            ImpersonationLevel = (ImpersonationLevel)LittleEndianReader.ReadUInt32(parameters, ref parametersOffset);
            SecurityFlags      = (SecurityFlags)ByteReader.ReadByte(parameters, ref parametersOffset);

            if (isUnicode)
            {
                parametersOffset++;
            }
            Name = SMBHelper.ReadFixedLengthString(parameters, ref parametersOffset, isUnicode, (int)nameLength);
            if (securityDescriptiorLength > 0)
            {
                SecurityDescriptor = new SecurityDescriptor(data, 0);
            }
            ExtendedAttributes = new FileFullEAInformationList(data, (int)securityDescriptiorLength);
        }
        public FindFileNamesInfo(byte[] buffer, ref int offset, bool isUnicode) : base(false)
        {
            NextEntryOffset = LittleEndianReader.ReadUInt32(buffer, ref offset);
            FileIndex       = LittleEndianReader.ReadUInt32(buffer, ref offset);
            uint fileNameLength = LittleEndianReader.ReadUInt32(buffer, ref offset);

            FileName = SMBHelper.ReadFixedLengthString(buffer, ref offset, isUnicode, (int)fileNameLength);
        }
Exemple #3
0
        public FindFileDirectoryInfo(byte[] buffer, ref int offset, bool isUnicode) : base(false)
        {
            NextEntryOffset    = LittleEndianReader.ReadUInt32(buffer, ref offset);
            FileIndex          = LittleEndianReader.ReadUInt32(buffer, ref offset);
            CreationTime       = SMBHelper.ReadFileTime(buffer, ref offset);
            LastAccessTime     = SMBHelper.ReadFileTime(buffer, ref offset);
            LastWriteTime      = SMBHelper.ReadFileTime(buffer, ref offset);
            LastAttrChangeTime = SMBHelper.ReadFileTime(buffer, ref offset);
            EndOfFile          = LittleEndianReader.ReadUInt64(buffer, ref offset);
            AllocationSize     = LittleEndianReader.ReadUInt64(buffer, ref offset);
            ExtFileAttributes  = (ExtendedFileAttributes)LittleEndianReader.ReadUInt32(buffer, ref offset);
            uint fileNameLength = LittleEndianReader.ReadUInt32(buffer, ref offset);

            FileName = SMBHelper.ReadFixedLengthString(buffer, ref offset, isUnicode, (int)fileNameLength);
        }
Exemple #4
0
        public FindInfoQueryExtendedAttributesFromList(byte[] buffer, ref int offset, bool isUnicode, bool returnResumeKeys) : base(returnResumeKeys)
        {
            if (returnResumeKeys)
            {
                ResumeKey = LittleEndianReader.ReadUInt32(buffer, ref offset);
            }
            CreationDateTime      = SMBHelper.ReadSMBDateTime(buffer, ref offset);
            LastAccessDateTime    = SMBHelper.ReadSMBDateTime(buffer, ref offset);
            LastWriteDateTime     = SMBHelper.ReadSMBDateTime(buffer, ref offset);
            FileDataSize          = LittleEndianReader.ReadUInt32(buffer, ref offset);
            AllocationSize        = LittleEndianReader.ReadUInt32(buffer, ref offset);
            Attributes            = (FileAttributes)LittleEndianReader.ReadUInt16(buffer, ref offset);
            ExtendedAttributeList = new FullExtendedAttributeList(buffer, offset);
            byte fileNameLength = ByteReader.ReadByte(buffer, ref offset);

            FileName = SMBHelper.ReadFixedLengthString(buffer, ref offset, isUnicode, fileNameLength);
        }