Exemplo n.º 1
0
        public byte[] DataWritter()
        {
            byte[] dataStream = new byte[RecordLength];
            Array.Copy(BitConverter.GetBytes((uint)TypeCode), 0, dataStream, 0, 4);
            Array.Copy(BitConverter.GetBytes(RecordLength), 0, dataStream, 4, 2);
            dataStream[6] = (byte)FormCode;
            dataStream[7] = NameLength;

            NtfsHelper.ToWinFileTime(dataStream, 8, CreationTime);
            NtfsHelper.ToWinFileTime(dataStream, 16, ModifiedTime);
            NtfsHelper.ToWinFileTime(dataStream, 24, AccessTime);
            NtfsHelper.ToWinFileTime(dataStream, 32, MFTChangeTime);
            dataStream[40] = (byte)DosPermissions;

            return(dataStream);
        }
Exemplo n.º 2
0
        public byte[] DataWritter()
        {
            byte[] dataStream = new byte[RecordLength];
            Array.Copy(BitConverter.GetBytes((uint)TypeCode), 0, dataStream, 0, 4);
            Array.Copy(BitConverter.GetBytes(RecordLength), 0, dataStream, 4, 2);
            dataStream[6] = (byte)FormCode;

            NtfsHelper.ToWinFileTime(dataStream, 7, CreationTime);
            NtfsHelper.ToWinFileTime(dataStream, 15, ModifiedTime);
            NtfsHelper.ToWinFileTime(dataStream, 23, AccessTime);
            NtfsHelper.ToWinFileTime(dataStream, 31, MFTChangeTime);

            Array.Copy(BitConverter.GetBytes(AllocatedSize), 0, dataStream, 39, 8);
            Array.Copy(BitConverter.GetBytes(RealSize), 0, dataStream, 47, 8);
            dataStream[55] = (byte)FileFlags;
            dataStream[56] = FilenameLength;
            dataStream[57] = (byte)FilenameNamespace;
            Array.Copy(Encoding.ASCII.GetBytes(Filename), 0, dataStream, 58, Filename.Length);

            return(dataStream);
        }