Ejemplo n.º 1
0
 public SetInfoStandard(byte[] buffer, int offset)
 {
     CreationDateTime   = SMBHelper.ReadSMBDateTime(buffer, offset + 0);
     LastAccessDateTime = SMBHelper.ReadSMBDateTime(buffer, offset + 4);
     LastWriteDateTime  = SMBHelper.ReadSMBDateTime(buffer, offset + 8);
     Reserved           = ByteReader.ReadBytes(buffer, offset + 12, 10);
 }
Ejemplo n.º 2
0
 public QueryInformationResponse(byte[] buffer, int offset) : base(buffer, offset, false)
 {
     FileAttributes = (FileAttributes)LittleEndianConverter.ToUInt16(this.SMBParameters, 0);
     LastWriteTime  = SMBHelper.ReadSMBDateTime(this.SMBParameters, 2);
     FileSize       = LittleEndianConverter.ToUInt32(this.SMBParameters, 6);
     Reserved       = ByteReader.ReadBytes(this.SMBParameters, 10, 10);
 }
Ejemplo n.º 3
0
 public QueryInfoStandard(byte[] buffer, int 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);
 }
Ejemplo n.º 4
0
        public static DateTime?ReadSetSMBDateTime(byte[] buffer, int offset)
        {
            uint value = LittleEndianConverter.ToUInt32(buffer, offset);

            if (value > 0)
            {
                return(SMBHelper.ReadSMBDateTime(buffer, offset));
            }
            return(null);
        }
Ejemplo n.º 5
0
        public FindInfoStandard(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);
            byte fileNameLength = ByteReader.ReadByte(buffer, ref offset);

            FileName = SMBHelper.ReadSMBString(buffer, ref offset, isUnicode);
        }
Ejemplo n.º 6
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);
        }