public byte[] GetBytes()
        {
            byte[] buffer = new byte[Length];

            StandardInformationRecord.WriteDateTime(buffer, 0x00, CreationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x08, ModificationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x10, MftModificationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x18, LastAccessTime);
            LittleEndianWriter.WriteUInt64(buffer, 0x20, AllocatedLength);
            LittleEndianWriter.WriteUInt64(buffer, 0x28, FileSize);
            LittleEndianWriter.WriteUInt32(buffer, 0x30, (uint)FileAttributes);
            LittleEndianWriter.WriteUInt16(buffer, 0x34, PackedEASize);

            return(buffer);
        }
Example #2
0
        public byte[] GetBytes()
        {
            byte[] buffer = new byte[FixedLength + FileName.Length * 2];

            ParentDirectory.WriteBytes(buffer, 0x00);
            StandardInformationRecord.WriteDateTime(buffer, 0x08, CreationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x10, ModificationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x18, MftModificationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x20, LastAccessTime);
            LittleEndianWriter.WriteUInt64(buffer, 0x28, AllocatedSize);
            LittleEndianWriter.WriteUInt64(buffer, 0x30, RealSize);
            ByteWriter.WriteByte(buffer, 0x40, (byte)FileName.Length);
            ByteWriter.WriteByte(buffer, 0x41, (byte)Namespace);
            ByteWriter.WriteBytes(buffer, 0x42, Encoding.Unicode.GetBytes(FileName));

            return(buffer);
        }
Example #3
0
        public byte[] GetBytes()
        {
            byte[] buffer = new byte[this.Length];

            ParentDirectory.WriteBytes(buffer, 0x00);
            StandardInformationRecord.WriteDateTime(buffer, 0x08, CreationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x10, ModificationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x18, MftModificationTime);
            StandardInformationRecord.WriteDateTime(buffer, 0x20, LastAccessTime);
            LittleEndianWriter.WriteUInt64(buffer, 0x28, AllocatedLength);
            LittleEndianWriter.WriteUInt64(buffer, 0x30, FileSize);
            LittleEndianWriter.WriteUInt32(buffer, 0x38, (uint)FileAttributes);
            LittleEndianWriter.WriteUInt16(buffer, 0x3C, PackedEASize);
            ByteWriter.WriteByte(buffer, 0x40, (byte)FileName.Length);
            ByteWriter.WriteByte(buffer, 0x41, (byte)Flags);
            ByteWriter.WriteBytes(buffer, 0x42, Encoding.Unicode.GetBytes(FileName));

            return(buffer);
        }