Example #1
0
        private CatalogFileRecord(byte[] bytes, int offset, string volumeName, string fileName)
        {
            VolumeName          = volumeName;
            FileName            = fileName;
            KeyLength           = Helper.SwapEndianness(BitConverter.ToUInt16(bytes, offset));
            ParentCatalogNodeId = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset + 0x02));
            Name = GetHfsString(bytes, offset + 0x06);

            int dataOffset = offset + KeyLength + 0x02;

            RecordType       = (RECORD_TYPE)Helper.SwapEndianness(BitConverter.ToUInt16(bytes, dataOffset));
            Flags            = (FILE_FLAGS)Helper.SwapEndianness(BitConverter.ToUInt16(bytes, dataOffset + 0x02));
            CatalogNodeId    = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, dataOffset + 0x08));
            CreateDate       = Helper.FromOSXTime(Helper.SwapEndianness(BitConverter.ToUInt32(bytes, dataOffset + 0x0C)));
            ContentModDate   = Helper.FromOSXTime(Helper.SwapEndianness(BitConverter.ToUInt32(bytes, dataOffset + 0x10)));
            AttributeModDate = Helper.FromOSXTime(Helper.SwapEndianness(BitConverter.ToUInt32(bytes, dataOffset + 0x14)));
            AccessDate       = Helper.FromOSXTime(Helper.SwapEndianness(BitConverter.ToUInt32(bytes, dataOffset + 0x18)));
            BackupDate       = Helper.FromOSXTime(Helper.SwapEndianness(BitConverter.ToUInt32(bytes, dataOffset + 0x1C)));
            Permissions      = BSDInfo.Get(bytes, dataOffset + 0x20);
            UserInfo         = FileInfo.Get(bytes, dataOffset + 0x30);
            FinderInfo       = ExtendedFileInfo.Get(bytes, dataOffset + 0x40);
            TextEncoding     = (CatalogFile.TEXT_ENCODING)Helper.SwapEndianness(BitConverter.ToUInt32(bytes, dataOffset + 0x50));

            VolumeHeader volHeader = VolumeHeader.Get(volumeName);

            DataFork     = ForkData.Get(bytes, dataOffset + 0x58, volumeName, volHeader.BlockSize);
            ResourceFork = ForkData.Get(bytes, dataOffset + 0xA8, volumeName, volHeader.BlockSize);
        }
Example #2
0
        private ExtentsOverflowRecord(byte[] bytes, int offset, string volumeName, string fileName)
        {
            VolumeHeader volHeader = VolumeHeader.Get(volumeName);

            VolumeName         = volumeName;
            FileName           = fileName;
            KeyLength          = Helper.SwapEndianness(BitConverter.ToUInt16(bytes, offset + 0x00));
            ForkType           = (FORK_TYPE)bytes[offset + 0x02];
            CatalogNodeId      = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset + 0x04));
            RelativeStartBlock = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset + 0x08));
            Extents            = ExtentDescriptor.GetInstances(bytes, offset + 0x0C, volumeName, volHeader.BlockSize);
        }
Example #3
0
 /// <summary>
 /// Returns the contents of the HFS+ Catalog File.
 /// </summary>
 /// <param name="volumeName"></param>
 /// <returns></returns>
 public static byte[] GetContent(string volumeName)
 {
     return(VolumeHeader.Get(volumeName).GetCatalogFileBytes());
 }
Example #4
0
 /// <summary>
 /// Returns the contents of the HFS+ Extents Overflow File.
 /// </summary>
 /// <param name="volumeName"></param>
 /// <returns></returns>
 public static byte[] GetContent(string volumeName)
 {
     return(VolumeHeader.Get(volumeName).GetExtentsOverflowFileBytes());
 }
Example #5
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public byte[] GetContent()
        {
            VolumeHeader header = VolumeHeader.Get(VolumeName);

            return(Helper.readDrive(VolumeName, (long)StartBlock * BlockSize, BlockCount * BlockSize));
        }