示例#1
0
 private ForkData(byte[] bytes, int offset, string volumeName, uint blockSize)
 {
     VolumeName  = volumeName;
     LogicalSize = Helper.SwapEndianness(BitConverter.ToUInt64(bytes, offset));
     ClumpSize   = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset + 0x08));
     TotalBlocks = Helper.SwapEndianness(BitConverter.ToUInt32(bytes, offset + 0x0C));
     Extents     = ExtentDescriptor.GetInstances(bytes, offset + 0x10, volumeName, blockSize);
 }
        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);
        }
示例#3
0
        internal static ExtentDescriptor[] GetInstances(byte[] bytes, int offset, string volumeName, uint blockSize)
        {
            List <ExtentDescriptor> extentList = new List <ExtentDescriptor>();

            for (int i = 0; i < 0x08; i++)
            {
                ExtentDescriptor extent = Get(bytes, offset + (i * 0x08), volumeName, blockSize);

                if (extent.BlockCount != 0)
                {
                    extentList.Add(extent);
                }
            }

            return(extentList.ToArray());
        }
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <returns></returns>
        public byte[] GetSlack()
        {
            List <byte> byteList     = new List <byte>();
            uint        extentBlocks = 0;

            foreach (ExtentDescriptor extent in Extents)
            {
                extentBlocks += extent.BlockCount;
                byteList.AddRange(extent.GetContent());
            }

            if (TotalBlocks == extentBlocks)
            {
                ExtentDescriptor extent = Extents[Extents.Length - 1];
                byte[]           bytes  = extent.GetContent();
                return(null); //Helper.GetSubArray(bytes, , );
            }
            else
            {
                // Need to get some stuff from Extent Overflow File
                Console.WriteLine("Portion of extents exist in Extent Overflow file");
                return(null);
            }
        }