public QueryFileBasicInfo(byte[] buffer, int offset)
 {
     CreationDateTime   = SMBHelper.ReadFileTime(buffer, ref offset);
     LastAccessDateTime = SMBHelper.ReadFileTime(buffer, ref offset);
     LastWriteDateTime  = SMBHelper.ReadFileTime(buffer, ref offset);
     LastChangeTime     = SMBHelper.ReadFileTime(buffer, ref offset);
     ExtFileAttributes  = (ExtendedFileAttributes)LittleEndianReader.ReadUInt32(buffer, ref offset);
     Reserved           = LittleEndianReader.ReadUInt32(buffer, ref offset);
 }
        public QueryFSVolumeInfo(byte[] buffer, int offset)
        {
            VolumeCreationTime = SMBHelper.ReadFileTime(buffer, offset + 0);
            SerialNumber       = LittleEndianConverter.ToUInt32(buffer, offset + 8);
            uint volumeLabelSize = LittleEndianConverter.ToUInt32(buffer, offset + 12);

            Reserved    = LittleEndianConverter.ToUInt16(buffer, offset + 16);
            VolumeLabel = ByteReader.ReadUnicodeString(buffer, offset + 18, (int)volumeLabelSize);
        }
Beispiel #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);
        }
Beispiel #4
0
        public NTCreateAndXResponse(byte[] buffer, int offset) : base(buffer, offset, false)
        {
            int parametersOffset = 4;

            OpLockLevel       = (OpLockLevel)ByteReader.ReadByte(this.SMBParameters, ref parametersOffset);
            FID               = LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            CreateDisposition = (CreateDisposition)LittleEndianReader.ReadUInt32(this.SMBParameters, ref parametersOffset);
            CreateTime        = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            LastAccessTime    = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            LastWriteTime     = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            LastChangeTime    = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            ExtFileAttributes = (ExtendedFileAttributes)LittleEndianReader.ReadUInt32(this.SMBParameters, ref parametersOffset);
            AllocationSize    = LittleEndianReader.ReadUInt64(buffer, ref parametersOffset);
            EndOfFile         = LittleEndianReader.ReadUInt64(buffer, ref parametersOffset);
            ResourceType      = (ResourceType)LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            NMPipeStatus      = NamedPipeStatus.Read(this.SMBParameters, ref parametersOffset);
            Directory         = (ByteReader.ReadByte(this.SMBParameters, ref parametersOffset) > 0);
        }
        public QueryFileAllInfo(byte[] buffer, int offset)
        {
            CreationDateTime   = SMBHelper.ReadFileTime(buffer, ref offset);
            LastAccessDateTime = SMBHelper.ReadFileTime(buffer, ref offset);
            LastWriteDateTime  = SMBHelper.ReadFileTime(buffer, ref offset);
            LastChangeTime     = SMBHelper.ReadFileTime(buffer, ref offset);
            ExtFileAttributes  = (ExtendedFileAttributes)LittleEndianReader.ReadUInt32(buffer, ref offset);
            Reserved1          = LittleEndianReader.ReadUInt32(buffer, ref offset);
            AllocationSize     = LittleEndianReader.ReadUInt64(buffer, ref offset);
            EndOfFile          = LittleEndianReader.ReadUInt64(buffer, ref offset);
            NumberOfLinks      = LittleEndianReader.ReadUInt32(buffer, ref offset);
            DeletePending      = (ByteReader.ReadByte(buffer, ref offset) > 0);
            Directory          = (ByteReader.ReadByte(buffer, ref offset) > 0);
            Reserved2          = LittleEndianReader.ReadUInt16(buffer, ref offset);
            EASize             = LittleEndianReader.ReadUInt32(buffer, ref offset);
            uint fileNameLength = LittleEndianReader.ReadUInt32(buffer, ref offset);

            FileName = ByteReader.ReadUnicodeString(buffer, ref offset, (int)(fileNameLength / 2));
        }
Beispiel #6
0
        public NTCreateAndXResponseExtended(byte[] buffer, int offset) : base(buffer, offset, false)
        {
            int parametersOffset = 4;

            OpLockLevel       = (OpLockLevel)ByteReader.ReadByte(this.SMBParameters, ref parametersOffset);
            FID               = LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            CreateDisposition = (CreateDisposition)LittleEndianReader.ReadUInt32(this.SMBParameters, ref parametersOffset);
            CreateTime        = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            LastAccessTime    = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            LastWriteTime     = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            LastChangeTime    = SMBHelper.ReadFileTime(buffer, ref parametersOffset);
            ExtFileAttributes = (ExtendedFileAttributes)LittleEndianReader.ReadUInt32(this.SMBParameters, ref parametersOffset);
            AllocationSize    = LittleEndianReader.ReadUInt64(buffer, ref parametersOffset);
            EndOfFile         = LittleEndianReader.ReadUInt64(buffer, ref parametersOffset);
            ResourceType      = (ResourceType)LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            NMPipeStatus_or_FileStatusFlags = LittleEndianReader.ReadUInt16(this.SMBParameters, ref parametersOffset);
            Directory                = (ByteReader.ReadByte(this.SMBParameters, ref parametersOffset) > 0);
            VolumeGuid               = LittleEndianReader.ReadGuid(this.SMBParameters, ref parametersOffset);
            FileID                   = LittleEndianReader.ReadUInt64(this.SMBParameters, ref parametersOffset);
            MaximalAccessRights      = new AccessMask(this.SMBParameters, ref parametersOffset);
            GuestMaximalAccessRights = new AccessMask(this.SMBParameters, ref parametersOffset);
        }