コード例 #1
0
        public HFSPlus(absImageStream fileSet, GPTScheme.entry partition) : base(fileSet, partition)
        {
            this.blockSize = 4096; // default block size

            this.partitionNo = partition.partitionNo;
            this.path        = fileSet.bf.F.Name + "\\" + partition.name;


            byte[] rawHeader = new byte[512];
            ais.Seek(this.volumeStart + 1024, SeekOrigin.Begin);
            ais.Read(rawHeader, 0, 512);
            if (rawHeader[0] == 0x48 && rawHeader[1] == 0x2B)
            {
                volHead = getVolumeHeader(rawHeader);
            }

            long volEnd = this.volumeStart + (partition.partLength * ais.sectorSize) + ais.sectorSize;

            this.totalSize = partition.partLength * ais.sectorSize;
            ais.Seek(volEnd - 1024, SeekOrigin.Begin);
            ais.Read(rawHeader, 0, 512);
            if (rawHeader[0] == 0x48 && rawHeader[1] == 0x2B)
            {
                backupVolHead = getVolumeHeader(rawHeader);
            }
        }
コード例 #2
0
ファイル: absVolume.cs プロジェクト: scherma/hfs-plus-reader
        public absVolume(absImageStream fileSet, GPTScheme.entry partition)
        {
            GPTScheme.entry partEntry = partition;
            ais = fileSet;

            blockSize    = 512;
            volumeStart  = (long)partition.partStartLBA * ais.sectorSize;
            volumeLength = (long)partition.partLength * ais.sectorSize;
        }
コード例 #3
0
        public partitionType findPartitionType(GPTScheme.entry entry)
        {
            partitionType entryType = partitionType.unknown;

            byte[] HFSsigbytes = new byte[2];

            i.Seek(entry.partStartLBA * i.sectorSize + 1024, SeekOrigin.Begin);
            i.Read(HFSsigbytes, 0, 2);

            string HFSsig = System.Text.Encoding.UTF8.GetString(HFSsigbytes);

            if (HFSsig == "H+")
            {
                entryType = partitionType.HFSPlus;
            }
            else if (HFSsig == "HX")
            {
                entryType = partitionType.HFSPlusCS;
            }

            return(entryType);
        }
コード例 #4
0
        private TreeNode getVolumeTree(GPTScheme.entry partition, GPTScheme.partitionType type, HFSPlusCatalogFolder folderID)
        {
            TreeNode tn = new TreeNode();

            try
            {
                if (type == GPTScheme.partitionType.HFSPlus)
                {
                    HFSPlus hfsp = new HFSPlus(this.i, partition);

                    tn = getHFSPTree(hfsp, folderID);
                }
            }
            catch (OutOfMemoryException)
            {
                return(tn);

                throw new OutOfMemoryException("The list view has been truncated as there are too many items to fit in system memory.\r\n\r\n"
                                               + "Try viewing a sub directory instead.");
            }

            return(tn);
        }
コード例 #5
0
        private TreeNode getVolumeTree(GPTScheme.entry partition, GPTScheme.partitionType type)
        {
            TreeNode tn = new TreeNode();

            if (type == GPTScheme.partitionType.HFSPlus)
            {
                HFSPlus      hfsp    = new HFSPlus(i, partition);
                volumeStream hfsp_vs = new volumeStream(hfsp);

                HFSPlusFile rawCatalog    = new HFSPlusFile(hfsp.volHead.catalogFile, forkStream.forkType.data);
                HFSPlusFile rawAttributes = new HFSPlusFile(hfsp.volHead.attributesFile, forkStream.forkType.data);
                HFSPlusFile rawExtents    = new HFSPlusFile(hfsp.volHead.extentsFile, forkStream.forkType.data);

                extentsOverflowFile extentsOverflow = new extentsOverflowFile(rawExtents, hfsp_vs);
                catalogFile         catalog         = new catalogFile(rawCatalog, hfsp_vs);
                attributesFile      attributes      = new attributesFile(rawAttributes, hfsp_vs);

                tn     = hfsp.getRootDirectoryContents(catalog, extentsOverflow, attributes);
                tn.Tag = hfsp.volHead;
            }

            return(tn);
        }