Ejemplo n.º 1
0
        public FileNameRecord(byte[] buffer, int offset)
        {
            ParentDirectory     = new MftSegmentReference(buffer, offset + 0x00);
            CreationTime        = StandardInformationRecord.ReadDateTime(buffer, offset + 0x08);
            ModificationTime    = StandardInformationRecord.ReadDateTime(buffer, offset + 0x10);
            MftModificationTime = StandardInformationRecord.ReadDateTime(buffer, offset + 0x18);
            LastAccessTime      = StandardInformationRecord.ReadDateTime(buffer, offset + 0x20);
            AllocatedSize       = LittleEndianConverter.ToUInt64(buffer, offset + 0x28);
            RealSize            = LittleEndianConverter.ToUInt64(buffer, offset + 0x30);
            byte fnLen = ByteReader.ReadByte(buffer, offset + 0x40);

            Namespace = (FilenameNamespace)ByteReader.ReadByte(buffer, offset + 0x41);
            FileName  = Encoding.Unicode.GetString(buffer, offset + 0x42, fnLen * 2);
        }
Ejemplo n.º 2
0
 public FileNameRecord GetFileNameRecord(FilenameNamespace filenameNamespace)
 {
     foreach (AttributeRecord attribute in this.Attributes)
     {
         if (attribute is FileNameAttributeRecord)
         {
             FileNameRecord fileNameAttribute = ((FileNameAttributeRecord)attribute).Record;
             if (fileNameAttribute.Namespace == filenameNamespace)
             {
                 return(fileNameAttribute);
             }
         }
     }
     return(null);
 }