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); } }
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; }
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); }
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); }
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); }