mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Refactor and code cleanup.
This commit is contained in:
@@ -33,7 +33,6 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
@@ -58,13 +57,13 @@ namespace DiscImageChef.Filesystems
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
struct ApfsContainerSuperBlock
|
||||
{
|
||||
public UInt64 unknown1; // Varies between copies of the superblock
|
||||
public UInt64 unknown2;
|
||||
public UInt64 unknown3; // Varies by 1 between copies of the superblock
|
||||
public UInt64 unknown4;
|
||||
public UInt32 magic;
|
||||
public UInt32 blockSize;
|
||||
public UInt64 containerBlocks;
|
||||
public ulong unknown1; // Varies between copies of the superblock
|
||||
public ulong unknown2;
|
||||
public ulong unknown3; // Varies by 1 between copies of the superblock
|
||||
public ulong unknown4;
|
||||
public uint magic;
|
||||
public uint blockSize;
|
||||
public ulong containerBlocks;
|
||||
}
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace DiscImageChef.Filesystems
|
||||
bytes *= 0x100000000;
|
||||
bytes += drSb.disc_size;
|
||||
|
||||
if(bytes > (imagePlugin.GetSectors() * (ulong)imagePlugin.GetSectorSize()))
|
||||
if(bytes > (imagePlugin.GetSectors() * imagePlugin.GetSectorSize()))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -193,7 +193,7 @@ namespace DiscImageChef.Filesystems
|
||||
zones *= 0x100000000;
|
||||
zones += drSb.nzones;
|
||||
|
||||
if(bytes > (imagePlugin.GetSectors() * (ulong)imagePlugin.GetSectorSize()))
|
||||
if(bytes > (imagePlugin.GetSectors() * imagePlugin.GetSectorSize()))
|
||||
return;
|
||||
|
||||
string discname = StringHandlers.CToString(drSb.disc_name);
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
|
||||
@@ -61,15 +59,15 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// Offset 0x00, "DOSx" disk type
|
||||
/// </summary>
|
||||
public UInt32 diskType;
|
||||
public uint diskType;
|
||||
/// <summary>
|
||||
/// Offset 0x04, Checksum
|
||||
/// </summary>
|
||||
public UInt32 checksum;
|
||||
public uint checksum;
|
||||
/// <summary>
|
||||
/// Offset 0x08, Pointer to root block, mostly invalid
|
||||
/// </summary>
|
||||
public UInt32 root_ptr;
|
||||
public uint root_ptr;
|
||||
/// <summary>
|
||||
/// Offset 0x0C, Boot code, til completion
|
||||
/// </summary>
|
||||
@@ -81,55 +79,55 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// Offset 0x00, block type, value = T_HEADER (2)
|
||||
/// </summary>
|
||||
public UInt32 type;
|
||||
public uint type;
|
||||
/// <summary>
|
||||
/// Offset 0x04, unused
|
||||
/// </summary>
|
||||
public UInt32 headerKey;
|
||||
public uint headerKey;
|
||||
/// <summary>
|
||||
/// Offset 0x08, unused
|
||||
/// </summary>
|
||||
public UInt32 highSeq;
|
||||
public uint highSeq;
|
||||
/// <summary>
|
||||
/// Offset 0x0C, longs used by hash table
|
||||
/// </summary>
|
||||
public UInt32 hashTableSize;
|
||||
public uint hashTableSize;
|
||||
/// <summary>
|
||||
/// Offset 0x10, unused
|
||||
/// </summary>
|
||||
public UInt32 firstData;
|
||||
public uint firstData;
|
||||
/// <summary>
|
||||
/// Offset 0x14, Rootblock checksum
|
||||
/// </summary>
|
||||
public UInt32 checksum;
|
||||
public uint checksum;
|
||||
/// <summary>
|
||||
/// Offset 0x18, Hashtable, size = (block size / 4) - 56 or size = hashTableSize
|
||||
/// </summary>
|
||||
public UInt32[] hashTable;
|
||||
public uint[] hashTable;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+0, bitmap flag, 0xFFFFFFFF if valid
|
||||
/// </summary>
|
||||
public UInt32 bitmapFlag;
|
||||
public uint bitmapFlag;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+4, bitmap pages, 25 entries
|
||||
/// </summary>
|
||||
public UInt32[] bitmapPages;
|
||||
public uint[] bitmapPages;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+104, pointer to bitmap extension block
|
||||
/// </summary>
|
||||
public UInt32 bitmapExtensionBlock;
|
||||
public uint bitmapExtensionBlock;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+108, last root alteration days since 1978/01/01
|
||||
/// </summary>
|
||||
public UInt32 rDays;
|
||||
public uint rDays;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+112, last root alteration minutes past midnight
|
||||
/// </summary>
|
||||
public UInt32 rMins;
|
||||
public uint rMins;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+116, last root alteration ticks (1/50 secs)
|
||||
/// </summary>
|
||||
public UInt32 rTicks;
|
||||
public uint rTicks;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+120, disk name, pascal string, 32 bytes
|
||||
/// </summary>
|
||||
@@ -137,51 +135,51 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+152, unused
|
||||
/// </summary>
|
||||
public UInt32 reserved1;
|
||||
public uint reserved1;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+156, unused
|
||||
/// </summary>
|
||||
public UInt32 reserved2;
|
||||
public uint reserved2;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+160, last disk alteration days since 1978/01/01
|
||||
/// </summary>
|
||||
public UInt32 vDays;
|
||||
public uint vDays;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+164, last disk alteration minutes past midnight
|
||||
/// </summary>
|
||||
public UInt32 vMins;
|
||||
public uint vMins;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+168, last disk alteration ticks (1/50 secs)
|
||||
/// </summary>
|
||||
public UInt32 vTicks;
|
||||
public uint vTicks;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+172, filesystem creation days since 1978/01/01
|
||||
/// </summary>
|
||||
public UInt32 cDays;
|
||||
public uint cDays;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+176, filesystem creation minutes since 1978/01/01
|
||||
/// </summary>
|
||||
public UInt32 cMins;
|
||||
public uint cMins;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+180, filesystem creation ticks since 1978/01/01
|
||||
/// </summary>
|
||||
public UInt32 cTicks;
|
||||
public uint cTicks;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+184, unused
|
||||
/// </summary>
|
||||
public UInt32 nextHash;
|
||||
public uint nextHash;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+188, unused
|
||||
/// </summary>
|
||||
public UInt32 parentDir;
|
||||
public uint parentDir;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+192, first directory cache block
|
||||
/// </summary>
|
||||
public UInt32 extension;
|
||||
public uint extension;
|
||||
/// <summary>
|
||||
/// Offset 0x18+hashTableSize*4+196, block secondary type = ST_ROOT (1)
|
||||
/// </summary>
|
||||
public UInt32 sec_type;
|
||||
public uint sec_type;
|
||||
}
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
@@ -193,7 +191,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0 + partitionStart);
|
||||
|
||||
UInt32 magic = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
uint magic = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
if((magic & 0x6D754600) != 0x6D754600 &&
|
||||
(magic & 0x444F5300) != 0x444F5300)
|
||||
@@ -211,13 +209,13 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
sector = imagePlugin.ReadSector(root_ptr);
|
||||
|
||||
UInt32 type = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
UInt32 hashTableSize = BigEndianBitConverter.ToUInt32(sector, 0x0C);
|
||||
uint type = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
uint hashTableSize = BigEndianBitConverter.ToUInt32(sector, 0x0C);
|
||||
|
||||
if((0x18 + hashTableSize * 4 + 196) > sector.Length)
|
||||
return false;
|
||||
|
||||
UInt32 sec_type = BigEndianBitConverter.ToUInt32(sector, (int)(0x18 + hashTableSize * 4 + 196));
|
||||
uint sec_type = BigEndianBitConverter.ToUInt32(sector, (int)(0x18 + hashTableSize * 4 + 196));
|
||||
|
||||
return type == 2 && sec_type == 1;
|
||||
}
|
||||
@@ -363,10 +361,10 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.ClusterSize = (int)imagePlugin.GetSectorSize();
|
||||
}
|
||||
|
||||
static UInt32 AmigaChecksum(byte[] data)
|
||||
static uint AmigaChecksum(byte[] data)
|
||||
{
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
UInt32 sum = 0;
|
||||
uint sum = 0;
|
||||
|
||||
for(int i = 0; i < data.Length; i += 4)
|
||||
sum += BigEndianBitConverter.ToUInt32(data, i);
|
||||
|
||||
@@ -33,29 +33,26 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
|
||||
// Information from Inside Macintosh
|
||||
// https://developer.apple.com/legacy/library/documentation/mac/pdf/Files/File_Manager.pdf
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from Inside Macintosh
|
||||
// https://developer.apple.com/legacy/library/documentation/mac/pdf/Files/File_Manager.pdf
|
||||
class AppleHFS : Filesystem
|
||||
{
|
||||
/// <summary>
|
||||
/// "BD", HFS magic
|
||||
/// </summary>
|
||||
const UInt16 HFS_MAGIC = 0x4244;
|
||||
const ushort HFS_MAGIC = 0x4244;
|
||||
/// <summary>
|
||||
/// "H+", HFS+ magic
|
||||
/// </summary>
|
||||
const UInt16 HFSP_MAGIC = 0x482B;
|
||||
const ushort HFSP_MAGIC = 0x482B;
|
||||
/// <summary>
|
||||
/// "LK", HFS bootblock magic
|
||||
/// </summary>
|
||||
const UInt16 HFSBB_MAGIC = 0x4C4B;
|
||||
const ushort HFSBB_MAGIC = 0x4C4B;
|
||||
|
||||
public AppleHFS()
|
||||
{
|
||||
@@ -75,7 +72,7 @@ namespace DiscImageChef.Filesystems
|
||||
return false;
|
||||
|
||||
byte[] mdb_sector;
|
||||
UInt16 drSigWord;
|
||||
ushort drSigWord;
|
||||
|
||||
if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 || imagePlugin.GetSectorSize() == 2048)
|
||||
{
|
||||
@@ -128,7 +125,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] bb_sector;
|
||||
byte[] mdb_sector;
|
||||
UInt16 drSigWord;
|
||||
ushort drSigWord;
|
||||
|
||||
bool APMFromHDDOnCD = false;
|
||||
|
||||
@@ -395,14 +392,14 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.Type = "HFS";
|
||||
xmlFSType.VolumeName = MDB.drVN;
|
||||
if(MDB.drFndrInfo6 != 0 && MDB.drFndrInfo7 != 0)
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X8}{1:x8}", MDB.drFndrInfo6, MDB.drFndrInfo7);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X8}{1:x8}", MDB.drFndrInfo6, MDB.drFndrInfo7);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static byte[] Read2048SectorAs512(ImagePlugins.ImagePlugin imagePlugin, UInt64 LBA)
|
||||
static byte[] Read2048SectorAs512(ImagePlugins.ImagePlugin imagePlugin, ulong LBA)
|
||||
{
|
||||
UInt64 LBA2k = LBA / 4;
|
||||
ulong LBA2k = LBA / 4;
|
||||
int Remainder = (int)(LBA % 4);
|
||||
|
||||
byte[] buffer = imagePlugin.ReadSector(LBA2k);
|
||||
@@ -419,86 +416,86 @@ namespace DiscImageChef.Filesystems
|
||||
struct HFS_MasterDirectoryBlock // Should be sector 2 in volume
|
||||
{
|
||||
/// <summary>0x000, Signature, 0x4244</summary>
|
||||
public UInt16 drSigWord;
|
||||
public ushort drSigWord;
|
||||
/// <summary>0x002, Volume creation date</summary>
|
||||
public UInt32 drCrDate;
|
||||
public uint drCrDate;
|
||||
/// <summary>0x006, Volume last modification date</summary>
|
||||
public UInt32 drLsMod;
|
||||
public uint drLsMod;
|
||||
/// <summary>0x00A, Volume attributes</summary>
|
||||
public UInt16 drAtrb;
|
||||
public ushort drAtrb;
|
||||
/// <summary>0x00C, Files in root directory</summary>
|
||||
public UInt16 drNmFls;
|
||||
public ushort drNmFls;
|
||||
/// <summary>0x00E, Start 512-byte sector of volume bitmap</summary>
|
||||
public UInt16 drVBMSt;
|
||||
public ushort drVBMSt;
|
||||
/// <summary>0x010, Allocation block to begin next allocation</summary>
|
||||
public UInt16 drAllocPtr;
|
||||
public ushort drAllocPtr;
|
||||
/// <summary>0x012, Allocation blocks</summary>
|
||||
public UInt16 drNmAlBlks;
|
||||
public ushort drNmAlBlks;
|
||||
/// <summary>0x014, Bytes per allocation block</summary>
|
||||
public UInt32 drAlBlkSiz;
|
||||
public uint drAlBlkSiz;
|
||||
/// <summary>0x018, Bytes to allocate when extending a file</summary>
|
||||
public UInt32 drClpSiz;
|
||||
public uint drClpSiz;
|
||||
/// <summary>0x01C, Start 512-byte sector of first allocation block</summary>
|
||||
public UInt16 drAlBlSt;
|
||||
public ushort drAlBlSt;
|
||||
/// <summary>0x01E, CNID for next file</summary>
|
||||
public UInt32 drNxtCNID;
|
||||
public uint drNxtCNID;
|
||||
/// <summary>0x022, Free allocation blocks</summary>
|
||||
public UInt16 drFreeBks;
|
||||
public ushort drFreeBks;
|
||||
/// <summary>0x024, Volume name (28 bytes)</summary>
|
||||
public string drVN;
|
||||
/// <summary>0x040, Volume last backup time</summary>
|
||||
public UInt32 drVolBkUp;
|
||||
public uint drVolBkUp;
|
||||
/// <summary>0x044, Volume backup sequence number</summary>
|
||||
public UInt16 drVSeqNum;
|
||||
public ushort drVSeqNum;
|
||||
/// <summary>0x046, Filesystem write count</summary>
|
||||
public UInt32 drWrCnt;
|
||||
public uint drWrCnt;
|
||||
/// <summary>0x04A, Bytes to allocate when extending the extents B-Tree</summary>
|
||||
public UInt32 drXTClpSiz;
|
||||
public uint drXTClpSiz;
|
||||
/// <summary>0x04E, Bytes to allocate when extending the catalog B-Tree</summary>
|
||||
public UInt32 drCTClpSiz;
|
||||
public uint drCTClpSiz;
|
||||
/// <summary>0x052, Number of directories in root directory</summary>
|
||||
public UInt16 drNmRtDirs;
|
||||
public ushort drNmRtDirs;
|
||||
/// <summary>0x054, Number of files in the volume</summary>
|
||||
public UInt32 drFilCnt;
|
||||
public uint drFilCnt;
|
||||
/// <summary>0x058, Number of directories in the volume</summary>
|
||||
public UInt32 drDirCnt;
|
||||
public uint drDirCnt;
|
||||
/// <summary>0x05C, finderInfo[0], CNID for bootable system's directory</summary>
|
||||
public UInt32 drFndrInfo0;
|
||||
public uint drFndrInfo0;
|
||||
/// <summary>0x060, finderInfo[1], CNID of the directory containing the boot application</summary>
|
||||
public UInt32 drFndrInfo1;
|
||||
public uint drFndrInfo1;
|
||||
/// <summary>0x064, finderInfo[2], CNID of the directory that should be opened on boot</summary>
|
||||
public UInt32 drFndrInfo2;
|
||||
public uint drFndrInfo2;
|
||||
/// <summary>0x068, finderInfo[3], CNID for Mac OS 8 or 9 directory</summary>
|
||||
public UInt32 drFndrInfo3;
|
||||
public uint drFndrInfo3;
|
||||
/// <summary>0x06C, finderInfo[4], Reserved</summary>
|
||||
public UInt32 drFndrInfo4;
|
||||
public uint drFndrInfo4;
|
||||
/// <summary>0x070, finderInfo[5], CNID for Mac OS X directory</summary>
|
||||
public UInt32 drFndrInfo5;
|
||||
public uint drFndrInfo5;
|
||||
/// <summary>0x074, finderInfo[6], first part of Mac OS X volume ID</summary>
|
||||
public UInt32 drFndrInfo6;
|
||||
public uint drFndrInfo6;
|
||||
/// <summary>0x078, finderInfo[7], second part of Mac OS X volume ID</summary>
|
||||
public UInt32 drFndrInfo7;
|
||||
public uint drFndrInfo7;
|
||||
// If wrapping HFS+
|
||||
/// <summary>0x07C, Embedded volume signature, "H+" if HFS+ is embedded ignore following two fields if not</summary>
|
||||
public UInt16 drEmbedSigWord;
|
||||
public ushort drEmbedSigWord;
|
||||
/// <summary>0x07E, Starting block number of embedded HFS+ volume</summary>
|
||||
public UInt16 xdrStABNt;
|
||||
public ushort xdrStABNt;
|
||||
/// <summary>0x080, Allocation blocks used by embedded volume</summary>
|
||||
public UInt16 xdrNumABlks;
|
||||
public ushort xdrNumABlks;
|
||||
// If not
|
||||
/// <summary>0x07C, Size in blocks of volume cache</summary>
|
||||
public UInt16 drVCSize;
|
||||
public ushort drVCSize;
|
||||
/// <summary>0x07E, Size in blocks of volume bitmap cache</summary>
|
||||
public UInt16 drVBMCSize;
|
||||
public ushort drVBMCSize;
|
||||
/// <summary>0x080, Size in blocks of volume common cache</summary>
|
||||
public UInt16 drCtlCSize;
|
||||
public ushort drCtlCSize;
|
||||
// End of variable variables :D
|
||||
/// <summary>0x082, Bytes in the extents B-Tree
|
||||
/// 3 HFS extents following, 32 bits each</summary>
|
||||
public UInt32 drXTFlSize;
|
||||
public uint drXTFlSize;
|
||||
/// <summary>0x092, Bytes in the catalog B-Tree
|
||||
/// 3 HFS extents following, 32 bits each</summary>
|
||||
public UInt32 drCTFlSize;
|
||||
public uint drCTFlSize;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -507,15 +504,15 @@ namespace DiscImageChef.Filesystems
|
||||
struct HFS_BootBlock // Should be sectors 0 and 1 in volume
|
||||
{
|
||||
/// <summary>0x000, Signature, 0x4C4B if bootable</summary>
|
||||
public UInt16 signature;
|
||||
public ushort signature;
|
||||
/// <summary>0x002, Branch</summary>
|
||||
public UInt32 branch;
|
||||
public uint branch;
|
||||
/// <summary>0x006, Boot block flags</summary>
|
||||
public byte boot_flags;
|
||||
/// <summary>0x007, Boot block version</summary>
|
||||
public byte boot_version;
|
||||
/// <summary>0x008, Allocate secondary buffers</summary>
|
||||
public Int16 sec_sv_pages;
|
||||
public short sec_sv_pages;
|
||||
/// <summary>0x00A, System file name (16 bytes)</summary>
|
||||
public string system_name;
|
||||
/// <summary>0x01A, Finder file name (16 bytes)</summary>
|
||||
@@ -531,15 +528,15 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x06A, Clipboard file name (16 bytes)</summary>
|
||||
public string clipbrd_name;
|
||||
/// <summary>0x07A, 1/4 of maximum opened at a time files</summary>
|
||||
public UInt16 max_files;
|
||||
public ushort max_files;
|
||||
/// <summary>0x07C, Event queue size</summary>
|
||||
public UInt16 queue_size;
|
||||
public ushort queue_size;
|
||||
/// <summary>0x07E, Heap size on a Mac with 128KiB of RAM</summary>
|
||||
public UInt32 heap_128k;
|
||||
public uint heap_128k;
|
||||
/// <summary>0x082, Heap size on a Mac with 256KiB of RAM</summary>
|
||||
public UInt32 heap_256k;
|
||||
public uint heap_256k;
|
||||
/// <summary>0x086, Heap size on a Mac with 512KiB of RAM or more</summary>
|
||||
public UInt32 heap_512k;
|
||||
public uint heap_512k;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -32,26 +32,25 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from Apple TechNote 1150: https://developer.apple.com/legacy/library/technotes/tn/tn1150.html
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from Apple TechNote 1150: https://developer.apple.com/legacy/library/technotes/tn/tn1150.html
|
||||
class AppleHFSPlus : Filesystem
|
||||
{
|
||||
/// <summary>
|
||||
/// "BD", HFS magic
|
||||
/// </summary>
|
||||
const UInt16 HFS_MAGIC = 0x4244;
|
||||
const ushort HFS_MAGIC = 0x4244;
|
||||
/// <summary>
|
||||
/// "H+", HFS+ magic
|
||||
/// </summary>
|
||||
const UInt16 HFSP_MAGIC = 0x482B;
|
||||
const ushort HFSP_MAGIC = 0x482B;
|
||||
/// <summary>
|
||||
/// "HX", HFSX magic
|
||||
/// </summary>
|
||||
const UInt16 HFSX_MAGIC = 0x4858;
|
||||
const ushort HFSX_MAGIC = 0x4858;
|
||||
|
||||
public AppleHFSPlus()
|
||||
{
|
||||
@@ -70,10 +69,10 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt16 drSigWord;
|
||||
UInt16 xdrStABNt;
|
||||
UInt16 drAlBlSt;
|
||||
UInt32 drAlBlkSiz;
|
||||
ushort drSigWord;
|
||||
ushort xdrStABNt;
|
||||
ushort drAlBlSt;
|
||||
uint drAlBlkSiz;
|
||||
|
||||
byte[] vh_sector;
|
||||
ulong hfsp_offset;
|
||||
@@ -118,10 +117,10 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
information = "";
|
||||
|
||||
UInt16 drSigWord;
|
||||
UInt16 xdrStABNt;
|
||||
UInt16 drAlBlSt;
|
||||
UInt32 drAlBlkSiz;
|
||||
ushort drSigWord;
|
||||
ushort xdrStABNt;
|
||||
ushort drAlBlSt;
|
||||
uint drAlBlkSiz;
|
||||
HFSPlusVolumeHeader HPVH = new HFSPlusVolumeHeader();
|
||||
|
||||
ulong hfsp_offset;
|
||||
@@ -271,8 +270,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.BackupDate = DateHandlers.MacToDateTime(HPVH.backupDate);
|
||||
xmlFSType.BackupDateSpecified = true;
|
||||
}
|
||||
if(HPVH.drFndrInfo0 != 0 || HPVH.drFndrInfo3 != 0 || HPVH.drFndrInfo5 != 0)
|
||||
xmlFSType.Bootable = true;
|
||||
xmlFSType.Bootable |= (HPVH.drFndrInfo0 != 0 || HPVH.drFndrInfo3 != 0 || HPVH.drFndrInfo5 != 0);
|
||||
xmlFSType.Clusters = HPVH.totalBlocks;
|
||||
xmlFSType.ClusterSize = (int)HPVH.blockSize;
|
||||
if(HPVH.createDate > 0)
|
||||
@@ -295,7 +293,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(HPVH.signature == 0x4858)
|
||||
xmlFSType.Type = "HFSX";
|
||||
if(HPVH.drFndrInfo6 != 0 && HPVH.drFndrInfo7 != 0)
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X8}{1:x8}", HPVH.drFndrInfo6, HPVH.drFndrInfo7);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X8}{1:x8}", HPVH.drFndrInfo6, HPVH.drFndrInfo7);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -315,11 +313,11 @@ namespace DiscImageChef.Filesystems
|
||||
struct HFSPlusVolumeHeader
|
||||
{
|
||||
/// <summary>0x000, "H+" for HFS+, "HX" for HFSX</summary>
|
||||
public UInt16 signature;
|
||||
public ushort signature;
|
||||
/// <summary>0x002, 4 for HFS+, 5 for HFSX</summary>
|
||||
public UInt16 version;
|
||||
public ushort version;
|
||||
/// <summary>0x004, Volume attributes</summary>
|
||||
public UInt32 attributes;
|
||||
public uint attributes;
|
||||
/// <summary>0x008, Implementation that last mounted the volume.
|
||||
/// Reserved by Apple:
|
||||
/// "8.10" Mac OS 8.1 to 9.2.2
|
||||
@@ -328,7 +326,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// "fsck" /sbin/fsck</summary>
|
||||
public string lastMountedVersion;
|
||||
/// <summary>0x00C, Allocation block number containing the journal</summary>
|
||||
public UInt32 journalInfoBlock;
|
||||
public uint journalInfoBlock;
|
||||
/// <summary>0x010, Date of volume creation</summary>
|
||||
public ulong createDate;
|
||||
/// <summary>0x018, Date of last volume modification</summary>
|
||||
@@ -338,238 +336,238 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x028, Date of last consistency check</summary>
|
||||
public ulong checkedDate;
|
||||
/// <summary>0x030, File on the volume</summary>
|
||||
public UInt32 fileCount;
|
||||
public uint fileCount;
|
||||
/// <summary>0x034, Folders on the volume</summary>
|
||||
public UInt32 folderCount;
|
||||
public uint folderCount;
|
||||
/// <summary>0x038, Bytes per allocation block</summary>
|
||||
public UInt32 blockSize;
|
||||
public uint blockSize;
|
||||
/// <summary>0x03C, Allocation blocks on the volume</summary>
|
||||
public UInt32 totalBlocks;
|
||||
public uint totalBlocks;
|
||||
/// <summary>0x040, Free allocation blocks</summary>
|
||||
public UInt32 freeBlocks;
|
||||
public uint freeBlocks;
|
||||
/// <summary>0x044, Hint for next allocation block</summary>
|
||||
public UInt32 nextAllocation;
|
||||
public uint nextAllocation;
|
||||
/// <summary>0x048, Resource fork clump size</summary>
|
||||
public UInt32 rsrcClumpSize;
|
||||
public uint rsrcClumpSize;
|
||||
/// <summary>0x04C, Data fork clump size</summary>
|
||||
public UInt32 dataClumpSize;
|
||||
public uint dataClumpSize;
|
||||
/// <summary>0x050, Next unused CNID</summary>
|
||||
public UInt32 nextCatalogID;
|
||||
public uint nextCatalogID;
|
||||
/// <summary>0x054, Times that the volume has been mounted writable</summary>
|
||||
public UInt32 writeCount;
|
||||
public uint writeCount;
|
||||
/// <summary>0x058, Used text encoding hints</summary>
|
||||
public UInt64 encodingsBitmap;
|
||||
public ulong encodingsBitmap;
|
||||
/// <summary>0x060, finderInfo[0], CNID for bootable system's directory</summary>
|
||||
public UInt32 drFndrInfo0;
|
||||
public uint drFndrInfo0;
|
||||
/// <summary>0x064, finderInfo[1], CNID of the directory containing the boot application</summary>
|
||||
public UInt32 drFndrInfo1;
|
||||
public uint drFndrInfo1;
|
||||
/// <summary>0x068, finderInfo[2], CNID of the directory that should be opened on boot</summary>
|
||||
public UInt32 drFndrInfo2;
|
||||
public uint drFndrInfo2;
|
||||
/// <summary>0x06C, finderInfo[3], CNID for Mac OS 8 or 9 directory</summary>
|
||||
public UInt32 drFndrInfo3;
|
||||
public uint drFndrInfo3;
|
||||
/// <summary>0x070, finderInfo[4], Reserved</summary>
|
||||
public UInt32 drFndrInfo4;
|
||||
public uint drFndrInfo4;
|
||||
/// <summary>0x074, finderInfo[5], CNID for Mac OS X directory</summary>
|
||||
public UInt32 drFndrInfo5;
|
||||
public uint drFndrInfo5;
|
||||
/// <summary>0x078, finderInfo[6], first part of Mac OS X volume ID</summary>
|
||||
public UInt32 drFndrInfo6;
|
||||
public uint drFndrInfo6;
|
||||
/// <summary>0x07C, finderInfo[7], second part of Mac OS X volume ID</summary>
|
||||
public UInt32 drFndrInfo7;
|
||||
public uint drFndrInfo7;
|
||||
// HFSPlusForkData allocationFile;
|
||||
/// <summary>0x080</summary>
|
||||
public UInt64 allocationFile_logicalSize;
|
||||
public ulong allocationFile_logicalSize;
|
||||
/// <summary>0x088</summary>
|
||||
public UInt32 allocationFile_clumpSize;
|
||||
public uint allocationFile_clumpSize;
|
||||
/// <summary>0x08C</summary>
|
||||
public UInt32 allocationFile_totalBlocks;
|
||||
public uint allocationFile_totalBlocks;
|
||||
/// <summary>0x090</summary>
|
||||
public UInt32 allocationFile_extents_startBlock0;
|
||||
public uint allocationFile_extents_startBlock0;
|
||||
/// <summary>0x094</summary>
|
||||
public UInt32 allocationFile_extents_blockCount0;
|
||||
public uint allocationFile_extents_blockCount0;
|
||||
/// <summary>0x098</summary>
|
||||
public UInt32 allocationFile_extents_startBlock1;
|
||||
public uint allocationFile_extents_startBlock1;
|
||||
/// <summary>0x09C</summary>
|
||||
public UInt32 allocationFile_extents_blockCount1;
|
||||
public uint allocationFile_extents_blockCount1;
|
||||
/// <summary>0x0A0</summary>
|
||||
public UInt32 allocationFile_extents_startBlock2;
|
||||
public uint allocationFile_extents_startBlock2;
|
||||
/// <summary>0x0A4</summary>
|
||||
public UInt32 allocationFile_extents_blockCount2;
|
||||
public uint allocationFile_extents_blockCount2;
|
||||
/// <summary>0x0A8</summary>
|
||||
public UInt32 allocationFile_extents_startBlock3;
|
||||
public uint allocationFile_extents_startBlock3;
|
||||
/// <summary>0x0AC</summary>
|
||||
public UInt32 allocationFile_extents_blockCount3;
|
||||
public uint allocationFile_extents_blockCount3;
|
||||
/// <summary>0x0B0</summary>
|
||||
public UInt32 allocationFile_extents_startBlock4;
|
||||
public uint allocationFile_extents_startBlock4;
|
||||
/// <summary>0x0B4</summary>
|
||||
public UInt32 allocationFile_extents_blockCount4;
|
||||
public uint allocationFile_extents_blockCount4;
|
||||
/// <summary>0x0B8</summary>
|
||||
public UInt32 allocationFile_extents_startBlock5;
|
||||
public uint allocationFile_extents_startBlock5;
|
||||
/// <summary>0x0BC</summary>
|
||||
public UInt32 allocationFile_extents_blockCount5;
|
||||
public uint allocationFile_extents_blockCount5;
|
||||
/// <summary>0x0C0</summary>
|
||||
public UInt32 allocationFile_extents_startBlock6;
|
||||
public uint allocationFile_extents_startBlock6;
|
||||
/// <summary>0x0C4</summary>
|
||||
public UInt32 allocationFile_extents_blockCount6;
|
||||
public uint allocationFile_extents_blockCount6;
|
||||
/// <summary>0x0C8</summary>
|
||||
public UInt32 allocationFile_extents_startBlock7;
|
||||
public uint allocationFile_extents_startBlock7;
|
||||
/// <summary>0x0CC</summary>
|
||||
public UInt32 allocationFile_extents_blockCount7;
|
||||
public uint allocationFile_extents_blockCount7;
|
||||
// HFSPlusForkData extentsFile;
|
||||
/// <summary>0x0D0</summary>
|
||||
public UInt64 extentsFile_logicalSize;
|
||||
public ulong extentsFile_logicalSize;
|
||||
/// <summary>0x0D8</summary>
|
||||
public UInt32 extentsFile_clumpSize;
|
||||
public uint extentsFile_clumpSize;
|
||||
/// <summary>0x0DC</summary>
|
||||
public UInt32 extentsFile_totalBlocks;
|
||||
public uint extentsFile_totalBlocks;
|
||||
/// <summary>0x0E0</summary>
|
||||
public UInt32 extentsFile_extents_startBlock0;
|
||||
public uint extentsFile_extents_startBlock0;
|
||||
/// <summary>0x0E4</summary>
|
||||
public UInt32 extentsFile_extents_blockCount0;
|
||||
public uint extentsFile_extents_blockCount0;
|
||||
/// <summary>0x0E8</summary>
|
||||
public UInt32 extentsFile_extents_startBlock1;
|
||||
public uint extentsFile_extents_startBlock1;
|
||||
/// <summary>0x0EC</summary>
|
||||
public UInt32 extentsFile_extents_blockCount1;
|
||||
public uint extentsFile_extents_blockCount1;
|
||||
/// <summary>0x0F0</summary>
|
||||
public UInt32 extentsFile_extents_startBlock2;
|
||||
public uint extentsFile_extents_startBlock2;
|
||||
/// <summary>0x0F4</summary>
|
||||
public UInt32 extentsFile_extents_blockCount2;
|
||||
public uint extentsFile_extents_blockCount2;
|
||||
/// <summary>0x0F8</summary>
|
||||
public UInt32 extentsFile_extents_startBlock3;
|
||||
public uint extentsFile_extents_startBlock3;
|
||||
/// <summary>0x0FC</summary>
|
||||
public UInt32 extentsFile_extents_blockCount3;
|
||||
public uint extentsFile_extents_blockCount3;
|
||||
/// <summary>0x100</summary>
|
||||
public UInt32 extentsFile_extents_startBlock4;
|
||||
public uint extentsFile_extents_startBlock4;
|
||||
/// <summary>0x104</summary>
|
||||
public UInt32 extentsFile_extents_blockCount4;
|
||||
public uint extentsFile_extents_blockCount4;
|
||||
/// <summary>0x108</summary>
|
||||
public UInt32 extentsFile_extents_startBlock5;
|
||||
public uint extentsFile_extents_startBlock5;
|
||||
/// <summary>0x10C</summary>
|
||||
public UInt32 extentsFile_extents_blockCount5;
|
||||
public uint extentsFile_extents_blockCount5;
|
||||
/// <summary>0x110</summary>
|
||||
public UInt32 extentsFile_extents_startBlock6;
|
||||
public uint extentsFile_extents_startBlock6;
|
||||
/// <summary>0x114</summary>
|
||||
public UInt32 extentsFile_extents_blockCount6;
|
||||
public uint extentsFile_extents_blockCount6;
|
||||
/// <summary>0x118</summary>
|
||||
public UInt32 extentsFile_extents_startBlock7;
|
||||
public uint extentsFile_extents_startBlock7;
|
||||
/// <summary>0x11C</summary>
|
||||
public UInt32 extentsFile_extents_blockCount7;
|
||||
public uint extentsFile_extents_blockCount7;
|
||||
// HFSPlusForkData catalogFile;
|
||||
/// <summary>0x120</summary>
|
||||
public UInt64 catalogFile_logicalSize;
|
||||
public ulong catalogFile_logicalSize;
|
||||
/// <summary>0x128</summary>
|
||||
public UInt32 catalogFile_clumpSize;
|
||||
public uint catalogFile_clumpSize;
|
||||
/// <summary>0x12C</summary>
|
||||
public UInt32 catalogFile_totalBlocks;
|
||||
public uint catalogFile_totalBlocks;
|
||||
/// <summary>0x130</summary>
|
||||
public UInt32 catalogFile_extents_startBlock0;
|
||||
public uint catalogFile_extents_startBlock0;
|
||||
/// <summary>0x134</summary>
|
||||
public UInt32 catalogFile_extents_blockCount0;
|
||||
public uint catalogFile_extents_blockCount0;
|
||||
/// <summary>0x138</summary>
|
||||
public UInt32 catalogFile_extents_startBlock1;
|
||||
public uint catalogFile_extents_startBlock1;
|
||||
/// <summary>0x13C</summary>
|
||||
public UInt32 catalogFile_extents_blockCount1;
|
||||
public uint catalogFile_extents_blockCount1;
|
||||
/// <summary>0x140</summary>
|
||||
public UInt32 catalogFile_extents_startBlock2;
|
||||
public uint catalogFile_extents_startBlock2;
|
||||
/// <summary>0x144</summary>
|
||||
public UInt32 catalogFile_extents_blockCount2;
|
||||
public uint catalogFile_extents_blockCount2;
|
||||
/// <summary>0x148</summary>
|
||||
public UInt32 catalogFile_extents_startBlock3;
|
||||
public uint catalogFile_extents_startBlock3;
|
||||
/// <summary>0x14C</summary>
|
||||
public UInt32 catalogFile_extents_blockCount3;
|
||||
public uint catalogFile_extents_blockCount3;
|
||||
/// <summary>0x150</summary>
|
||||
public UInt32 catalogFile_extents_startBlock4;
|
||||
public uint catalogFile_extents_startBlock4;
|
||||
/// <summary>0x154</summary>
|
||||
public UInt32 catalogFile_extents_blockCount4;
|
||||
public uint catalogFile_extents_blockCount4;
|
||||
/// <summary>0x158</summary>
|
||||
public UInt32 catalogFile_extents_startBlock5;
|
||||
public uint catalogFile_extents_startBlock5;
|
||||
/// <summary>0x15C</summary>
|
||||
public UInt32 catalogFile_extents_blockCount5;
|
||||
public uint catalogFile_extents_blockCount5;
|
||||
/// <summary>0x160</summary>
|
||||
public UInt32 catalogFile_extents_startBlock6;
|
||||
public uint catalogFile_extents_startBlock6;
|
||||
/// <summary>0x164</summary>
|
||||
public UInt32 catalogFile_extents_blockCount6;
|
||||
public uint catalogFile_extents_blockCount6;
|
||||
/// <summary>0x168</summary>
|
||||
public UInt32 catalogFile_extents_startBlock7;
|
||||
public uint catalogFile_extents_startBlock7;
|
||||
/// <summary>0x16C</summary>
|
||||
public UInt32 catalogFile_extents_blockCount7;
|
||||
public uint catalogFile_extents_blockCount7;
|
||||
// HFSPlusForkData attributesFile;
|
||||
/// <summary>0x170</summary>
|
||||
public UInt64 attributesFile_logicalSize;
|
||||
public ulong attributesFile_logicalSize;
|
||||
/// <summary>0x178</summary>
|
||||
public UInt32 attributesFile_clumpSize;
|
||||
public uint attributesFile_clumpSize;
|
||||
/// <summary>0x17C</summary>
|
||||
public UInt32 attributesFile_totalBlocks;
|
||||
public uint attributesFile_totalBlocks;
|
||||
/// <summary>0x180</summary>
|
||||
public UInt32 attributesFile_extents_startBlock0;
|
||||
public uint attributesFile_extents_startBlock0;
|
||||
/// <summary>0x184</summary>
|
||||
public UInt32 attributesFile_extents_blockCount0;
|
||||
public uint attributesFile_extents_blockCount0;
|
||||
/// <summary>0x188</summary>
|
||||
public UInt32 attributesFile_extents_startBlock1;
|
||||
public uint attributesFile_extents_startBlock1;
|
||||
/// <summary>0x18C</summary>
|
||||
public UInt32 attributesFile_extents_blockCount1;
|
||||
public uint attributesFile_extents_blockCount1;
|
||||
/// <summary>0x190</summary>
|
||||
public UInt32 attributesFile_extents_startBlock2;
|
||||
public uint attributesFile_extents_startBlock2;
|
||||
/// <summary>0x194</summary>
|
||||
public UInt32 attributesFile_extents_blockCount2;
|
||||
public uint attributesFile_extents_blockCount2;
|
||||
/// <summary>0x198</summary>
|
||||
public UInt32 attributesFile_extents_startBlock3;
|
||||
public uint attributesFile_extents_startBlock3;
|
||||
/// <summary>0x19C</summary>
|
||||
public UInt32 attributesFile_extents_blockCount3;
|
||||
public uint attributesFile_extents_blockCount3;
|
||||
/// <summary>0x1A0</summary>
|
||||
public UInt32 attributesFile_extents_startBlock4;
|
||||
public uint attributesFile_extents_startBlock4;
|
||||
/// <summary>0x1A4</summary>
|
||||
public UInt32 attributesFile_extents_blockCount4;
|
||||
public uint attributesFile_extents_blockCount4;
|
||||
/// <summary>0x1A8</summary>
|
||||
public UInt32 attributesFile_extents_startBlock5;
|
||||
public uint attributesFile_extents_startBlock5;
|
||||
/// <summary>0x1AC</summary>
|
||||
public UInt32 attributesFile_extents_blockCount5;
|
||||
public uint attributesFile_extents_blockCount5;
|
||||
/// <summary>0x1B0</summary>
|
||||
public UInt32 attributesFile_extents_startBlock6;
|
||||
public uint attributesFile_extents_startBlock6;
|
||||
/// <summary>0x1B4</summary>
|
||||
public UInt32 attributesFile_extents_blockCount6;
|
||||
public uint attributesFile_extents_blockCount6;
|
||||
/// <summary>0x1B8</summary>
|
||||
public UInt32 attributesFile_extents_startBlock7;
|
||||
public uint attributesFile_extents_startBlock7;
|
||||
/// <summary>0x1BC</summary>
|
||||
public UInt32 attributesFile_extents_blockCount7;
|
||||
public uint attributesFile_extents_blockCount7;
|
||||
// HFSPlusForkData startupFile;
|
||||
/// <summary>0x1C0</summary>
|
||||
public UInt64 startupFile_logicalSize;
|
||||
public ulong startupFile_logicalSize;
|
||||
/// <summary>0x1C8</summary>
|
||||
public UInt32 startupFile_clumpSize;
|
||||
public uint startupFile_clumpSize;
|
||||
/// <summary>0x1CC</summary>
|
||||
public UInt32 startupFile_totalBlocks;
|
||||
public uint startupFile_totalBlocks;
|
||||
/// <summary>0x1D0</summary>
|
||||
public UInt32 startupFile_extents_startBlock0;
|
||||
public uint startupFile_extents_startBlock0;
|
||||
/// <summary>0x1D4</summary>
|
||||
public UInt32 startupFile_extents_blockCount0;
|
||||
public uint startupFile_extents_blockCount0;
|
||||
/// <summary>0x1D8</summary>
|
||||
public UInt32 startupFile_extents_startBlock1;
|
||||
public uint startupFile_extents_startBlock1;
|
||||
/// <summary>0x1E0</summary>
|
||||
public UInt32 startupFile_extents_blockCount1;
|
||||
public uint startupFile_extents_blockCount1;
|
||||
/// <summary>0x1E4</summary>
|
||||
public UInt32 startupFile_extents_startBlock2;
|
||||
public uint startupFile_extents_startBlock2;
|
||||
/// <summary>0x1E8</summary>
|
||||
public UInt32 startupFile_extents_blockCount2;
|
||||
public uint startupFile_extents_blockCount2;
|
||||
/// <summary>0x1EC</summary>
|
||||
public UInt32 startupFile_extents_startBlock3;
|
||||
public uint startupFile_extents_startBlock3;
|
||||
/// <summary>0x1F0</summary>
|
||||
public UInt32 startupFile_extents_blockCount3;
|
||||
public uint startupFile_extents_blockCount3;
|
||||
/// <summary>0x1F4</summary>
|
||||
public UInt32 startupFile_extents_startBlock4;
|
||||
public uint startupFile_extents_startBlock4;
|
||||
/// <summary>0x1F8</summary>
|
||||
public UInt32 startupFile_extents_blockCount4;
|
||||
public uint startupFile_extents_blockCount4;
|
||||
/// <summary>0x1FC</summary>
|
||||
public UInt32 startupFile_extents_startBlock5;
|
||||
public uint startupFile_extents_startBlock5;
|
||||
/// <summary>0x200</summary>
|
||||
public UInt32 startupFile_extents_blockCount5;
|
||||
public uint startupFile_extents_blockCount5;
|
||||
/// <summary>0x204</summary>
|
||||
public UInt32 startupFile_extents_startBlock6;
|
||||
public uint startupFile_extents_startBlock6;
|
||||
/// <summary>0x208</summary>
|
||||
public UInt32 startupFile_extents_blockCount6;
|
||||
public uint startupFile_extents_blockCount6;
|
||||
/// <summary>0x20C</summary>
|
||||
public UInt32 startupFile_extents_startBlock7;
|
||||
public uint startupFile_extents_startBlock7;
|
||||
/// <summary>0x210</summary>
|
||||
public UInt32 startupFile_extents_blockCount7;
|
||||
public uint startupFile_extents_blockCount7;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -32,17 +32,16 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from Inside Macintosh
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from Inside Macintosh
|
||||
class AppleMFS : Filesystem
|
||||
{
|
||||
const UInt16 MFS_MAGIC = 0xD2D7;
|
||||
const ushort MFS_MAGIC = 0xD2D7;
|
||||
// "LK"
|
||||
const UInt16 MFSBB_MAGIC = 0x4C4B;
|
||||
const ushort MFSBB_MAGIC = 0x4C4B;
|
||||
|
||||
public AppleMFS()
|
||||
{
|
||||
@@ -58,7 +57,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
UInt16 drSigWord;
|
||||
ushort drSigWord;
|
||||
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
@@ -227,31 +226,31 @@ namespace DiscImageChef.Filesystems
|
||||
struct MFS_MasterDirectoryBlock
|
||||
{
|
||||
/// <summary>0x000, Signature, 0xD2D7</summary>
|
||||
public UInt16 drSigWord;
|
||||
public ushort drSigWord;
|
||||
/// <summary>0x002, Volume creation date</summary>
|
||||
public UInt32 drCrDate;
|
||||
public uint drCrDate;
|
||||
/// <summary>0x006, Volume last backup date</summary>
|
||||
public UInt32 drLsBkUp;
|
||||
public uint drLsBkUp;
|
||||
/// <summary>0x00A, Volume attributes</summary>
|
||||
public UInt16 drAtrb;
|
||||
public ushort drAtrb;
|
||||
/// <summary>0x00C, Volume number of files</summary>
|
||||
public UInt16 drNmFls;
|
||||
public ushort drNmFls;
|
||||
/// <summary>0x00E, First directory block</summary>
|
||||
public UInt16 drDirSt;
|
||||
public ushort drDirSt;
|
||||
/// <summary>0x010, Length of directory in blocks</summary>
|
||||
public UInt16 drBlLen;
|
||||
public ushort drBlLen;
|
||||
/// <summary>0x012, Volume allocation blocks</summary>
|
||||
public UInt16 drNmAlBlks;
|
||||
public ushort drNmAlBlks;
|
||||
/// <summary>0x014, Size of allocation blocks</summary>
|
||||
public UInt32 drAlBlkSiz;
|
||||
public uint drAlBlkSiz;
|
||||
/// <summary>0x018, Number of bytes to allocate</summary>
|
||||
public UInt32 drClpSiz;
|
||||
public uint drClpSiz;
|
||||
/// <summary>0x01C, First allocation block in block map</summary>
|
||||
public UInt16 drAlBlSt;
|
||||
public ushort drAlBlSt;
|
||||
/// <summary>0x01E. Next unused file number</summary>
|
||||
public UInt32 drNxtFNum;
|
||||
public uint drNxtFNum;
|
||||
/// <summary>0x022, Number of unused allocation blocks</summary>
|
||||
public UInt16 drFreeBks;
|
||||
public ushort drFreeBks;
|
||||
/// <summary>0x024, Length of volume name</summary>
|
||||
public byte drVNSiz;
|
||||
/// <summary>0x025, Characters of volume name</summary>
|
||||
@@ -264,9 +263,9 @@ namespace DiscImageChef.Filesystems
|
||||
struct MFS_BootBlock
|
||||
{
|
||||
/// <summary>0x000, Signature, 0x4C4B if bootable</summary>
|
||||
public UInt16 signature;
|
||||
public ushort signature;
|
||||
/// <summary>0x002, Branch</summary>
|
||||
public UInt32 branch;
|
||||
public uint branch;
|
||||
/// <summary>0x006, Boot block flags</summary>
|
||||
public byte boot_flags;
|
||||
/// <summary>0x007, Boot block version</summary>
|
||||
@@ -288,15 +287,15 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x06A, Clipboard file name (16 bytes)</summary>
|
||||
public string clipbrd_name;
|
||||
/// <summary>0x07A, 1/4 of maximum opened at a time files</summary>
|
||||
public UInt16 max_files;
|
||||
public ushort max_files;
|
||||
/// <summary>0x07C, Event queue size</summary>
|
||||
public UInt16 queue_size;
|
||||
public ushort queue_size;
|
||||
/// <summary>0x07E, Heap size on a Mac with 128KiB of RAM</summary>
|
||||
public UInt32 heap_128k;
|
||||
public uint heap_128k;
|
||||
/// <summary>0x082, Heap size on a Mac with 256KiB of RAM</summary>
|
||||
public UInt32 heap_256k;
|
||||
public uint heap_256k;
|
||||
/// <summary>0x086, Heap size on a Mac with 512KiB of RAM or more</summary>
|
||||
public UInt32 heap_512k;
|
||||
public uint heap_512k;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -32,25 +32,24 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from Practical Filesystem Design, ISBN 1-55860-497-9
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from Practical Filesystem Design, ISBN 1-55860-497-9
|
||||
class BeFS : Filesystem
|
||||
{
|
||||
// Little endian constants (that is, as read by .NET :p)
|
||||
const UInt32 BEFS_MAGIC1 = 0x42465331;
|
||||
const UInt32 BEFS_MAGIC2 = 0xDD121031;
|
||||
const UInt32 BEFS_MAGIC3 = 0x15B6830E;
|
||||
const UInt32 BEFS_ENDIAN = 0x42494745;
|
||||
const uint BEFS_MAGIC1 = 0x42465331;
|
||||
const uint BEFS_MAGIC2 = 0xDD121031;
|
||||
const uint BEFS_MAGIC3 = 0x15B6830E;
|
||||
const uint BEFS_ENDIAN = 0x42494745;
|
||||
// Big endian constants
|
||||
const UInt32 BEFS_CIGAM1 = 0x31534642;
|
||||
const UInt32 BEFS_NAIDNE = 0x45474942;
|
||||
const uint BEFS_CIGAM1 = 0x31534642;
|
||||
const uint BEFS_NAIDNE = 0x45474942;
|
||||
// Common constants
|
||||
const UInt32 BEFS_CLEAN = 0x434C454E;
|
||||
const UInt32 BEFS_DIRTY = 0x44495254;
|
||||
const uint BEFS_CLEAN = 0x434C454E;
|
||||
const uint BEFS_DIRTY = 0x44495254;
|
||||
|
||||
public BeFS()
|
||||
{
|
||||
@@ -69,8 +68,8 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt32 magic;
|
||||
UInt32 magic_be;
|
||||
uint magic;
|
||||
uint magic_be;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionStart);
|
||||
|
||||
@@ -239,53 +238,53 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x000, Volume name, 32 bytes</summary>
|
||||
public string name;
|
||||
/// <summary>0x020, "BFS1", 0x42465331</summary>
|
||||
public UInt32 magic1;
|
||||
public uint magic1;
|
||||
/// <summary>0x024, "BIGE", 0x42494745</summary>
|
||||
public UInt32 fs_byte_order;
|
||||
public uint fs_byte_order;
|
||||
/// <summary>0x028, Bytes per block</summary>
|
||||
public UInt32 block_size;
|
||||
public uint block_size;
|
||||
/// <summary>0x02C, 1 << block_shift == block_size</summary>
|
||||
public UInt32 block_shift;
|
||||
public uint block_shift;
|
||||
/// <summary>0x030, Blocks in volume</summary>
|
||||
public Int64 num_blocks;
|
||||
public long num_blocks;
|
||||
/// <summary>0x038, Used blocks in volume</summary>
|
||||
public Int64 used_blocks;
|
||||
public long used_blocks;
|
||||
/// <summary>0x040, Bytes per inode</summary>
|
||||
public Int32 inode_size;
|
||||
public int inode_size;
|
||||
/// <summary>0x044, 0xDD121031</summary>
|
||||
public UInt32 magic2;
|
||||
public uint magic2;
|
||||
/// <summary>0x048, Blocks per allocation group</summary>
|
||||
public Int32 blocks_per_ag;
|
||||
public int blocks_per_ag;
|
||||
/// <summary>0x04C, 1 << ag_shift == blocks_per_ag</summary>
|
||||
public Int32 ag_shift;
|
||||
public int ag_shift;
|
||||
/// <summary>0x050, Allocation groups in volume</summary>
|
||||
public Int32 num_ags;
|
||||
public int num_ags;
|
||||
/// <summary>0x054, 0x434c454e if clean, 0x44495254 if dirty</summary>
|
||||
public UInt32 flags;
|
||||
public uint flags;
|
||||
/// <summary>0x058, Allocation group of journal</summary>
|
||||
public Int32 log_blocks_ag;
|
||||
public int log_blocks_ag;
|
||||
/// <summary>0x05C, Start block of journal, inside ag</summary>
|
||||
public UInt16 log_blocks_start;
|
||||
public ushort log_blocks_start;
|
||||
/// <summary>0x05E, Length in blocks of journal, inside ag</summary>
|
||||
public UInt16 log_blocks_len;
|
||||
public ushort log_blocks_len;
|
||||
/// <summary>0x060, Start of journal</summary>
|
||||
public Int64 log_start;
|
||||
public long log_start;
|
||||
/// <summary>0x068, End of journal</summary>
|
||||
public Int64 log_end;
|
||||
public long log_end;
|
||||
/// <summary>0x070, 0x15B6830E</summary>
|
||||
public UInt32 magic3;
|
||||
public uint magic3;
|
||||
/// <summary>0x074, Allocation group where root folder's i-node resides</summary>
|
||||
public Int32 root_dir_ag;
|
||||
public int root_dir_ag;
|
||||
/// <summary>0x078, Start in ag of root folder's i-node</summary>
|
||||
public UInt16 root_dir_start;
|
||||
public ushort root_dir_start;
|
||||
/// <summary>0x07A, As this is part of inode_addr, this is 1</summary>
|
||||
public UInt16 root_dir_len;
|
||||
public ushort root_dir_len;
|
||||
/// <summary>0x07C, Allocation group where indices' i-node resides</summary>
|
||||
public Int32 indices_ag;
|
||||
public int indices_ag;
|
||||
/// <summary>0x080, Start in ag of indices' i-node</summary>
|
||||
public UInt16 indices_start;
|
||||
public ushort indices_start;
|
||||
/// <summary>0x082, As this is part of inode_addr, this is 1</summary>
|
||||
public UInt16 indices_len;
|
||||
public ushort indices_len;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// BTRFS magic "_BHRfS_M"
|
||||
/// </summary>
|
||||
const ulong magic = 0x4D5F53665248425F;
|
||||
const ulong btrfsMagic = 0x4D5F53665248425F;
|
||||
|
||||
public BTRFS()
|
||||
{
|
||||
@@ -149,7 +149,7 @@ namespace DiscImageChef.Filesystems
|
||||
DicConsole.DebugWriteLine("BTRFS Plugin", "partitionStart = {0}", partitionStart);
|
||||
DicConsole.DebugWriteLine("BTRFS Plugin", "btrfsSb.magic = 0x{0:X16}", btrfsSb.magic);
|
||||
|
||||
return btrfsSb.magic == magic;
|
||||
return btrfsSb.magic == btrfsMagic;
|
||||
}
|
||||
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
|
||||
|
||||
@@ -1,3 +1,43 @@
|
||||
2016-07-28 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* ODS.cs:
|
||||
* FFS.cs:
|
||||
* BFS.cs:
|
||||
* FAT.cs:
|
||||
* NTFS.cs:
|
||||
* APFS.cs:
|
||||
* HPFS.cs:
|
||||
* SysV.cs:
|
||||
* Opera.cs:
|
||||
* Acorn.cs:
|
||||
* BTRFS.cs:
|
||||
* extFS.cs:
|
||||
* ext2FS.cs:
|
||||
* ProDOS.cs:
|
||||
* MinixFS.cs:
|
||||
* Symbian.cs:
|
||||
* Structs.cs:
|
||||
* SolarFS.cs:
|
||||
* UNIXBFS.cs:
|
||||
* ISO9660.cs:
|
||||
* PCEngine.cs:
|
||||
* Nintendo.cs:
|
||||
* AppleMFS.cs:
|
||||
* AppleHFS.cs:
|
||||
* AmigaDOS.cs:
|
||||
* Dir.cs:
|
||||
* Filesystem.cs:
|
||||
* File.cs:
|
||||
* Info.cs:
|
||||
* Xattr.cs:
|
||||
* Super.cs:
|
||||
* AppleHFSPlus.cs:
|
||||
* LisaFS.cs:
|
||||
* Extent.cs:
|
||||
* Consts.cs:
|
||||
* Structs.cs:
|
||||
* Encoding.cs: Refactor and code cleanup.
|
||||
|
||||
2016-07-28 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Encoding.cs: Solve null reference.
|
||||
|
||||
@@ -32,16 +32,13 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// TODO: Implement detecting DOS bootable disks
|
||||
// TODO: Implement detecting Atari TOS bootable disks and printing corresponding fields
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// TODO: Implement detecting DOS bootable disks
|
||||
// TODO: Implement detecting Atari TOS bootable disks and printing corresponding fields
|
||||
class FAT : Filesystem
|
||||
{
|
||||
public FAT()
|
||||
@@ -64,8 +61,8 @@ namespace DiscImageChef.Filesystems
|
||||
byte media_descriptor; // Not present on DOS <= 3, present on TOS but != of first FAT entry
|
||||
byte fats_no; // Must be 1 or 2. Dunno if it can be 0 in the wild, but it CANNOT BE bigger than 2
|
||||
byte[] fat32_signature = new byte[8]; // "FAT32 "
|
||||
UInt32 first_fat_entry; // No matter FAT size we read 4 bytes for checking
|
||||
UInt16 bps, rsectors;
|
||||
uint first_fat_entry; // No matter FAT size we read 4 bytes for checking
|
||||
ushort bps, rsectors;
|
||||
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionStart);
|
||||
byte[] fat_sector = imagePlugin.ReadSector(1 + partitionStart);
|
||||
@@ -81,7 +78,7 @@ namespace DiscImageChef.Filesystems
|
||||
rsectors = BitConverter.ToUInt16(bpb_sector, 0x00E); // Sectors between BPB and FAT, including the BPB sector => [BPB,FAT)
|
||||
if(rsectors == 0)
|
||||
rsectors = 1;
|
||||
if(imagePlugin.GetSectors() > ((ulong)rsectors + partitionStart))
|
||||
if(imagePlugin.GetSectors() > (rsectors + partitionStart))
|
||||
fat_sector = imagePlugin.ReadSector(rsectors + partitionStart); // First FAT entry
|
||||
else
|
||||
bpb_found = false;
|
||||
@@ -182,10 +179,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] dosString; // Space-padded
|
||||
bool isFAT32 = false;
|
||||
UInt32 first_fat_entry;
|
||||
uint first_fat_entry;
|
||||
byte media_descriptor, fats_no;
|
||||
string fat32_signature;
|
||||
UInt16 bps, rsectors;
|
||||
ushort bps, rsectors;
|
||||
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionStart);
|
||||
byte[] fat_sector = imagePlugin.ReadSector(1 + partitionStart);
|
||||
@@ -203,7 +200,7 @@ namespace DiscImageChef.Filesystems
|
||||
rsectors = BitConverter.ToUInt16(bpb_sector, 0x00E); // Sectors between BPB and FAT, including the BPB sector => [BPB,FAT)
|
||||
if(rsectors == 0)
|
||||
rsectors = 1;
|
||||
if(imagePlugin.GetSectors() > ((ulong)rsectors + partitionStart))
|
||||
if(imagePlugin.GetSectors() > (rsectors + partitionStart))
|
||||
fat_sector = imagePlugin.ReadSector(rsectors + partitionStart); // First FAT entry
|
||||
else
|
||||
bpb_found = false;
|
||||
@@ -326,7 +323,7 @@ namespace DiscImageChef.Filesystems
|
||||
sb.AppendFormat("Sector of backup FAT32 parameter block: {0}", FAT32PB.backup_sector).AppendLine();
|
||||
sb.AppendFormat("Drive number: 0x{0:X2}", FAT32PB.drive_no).AppendLine();
|
||||
sb.AppendFormat("Volume Serial Number: 0x{0:X8}", FAT32PB.serial_no).AppendLine();
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X8}", FAT32PB.serial_no);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X8}", FAT32PB.serial_no);
|
||||
if((FAT32PB.nt_flags & 0x01) == 0x01)
|
||||
{
|
||||
sb.AppendLine("Volume should be checked on next mount.");
|
||||
@@ -344,7 +341,7 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
sb.AppendFormat("Drive number: 0x{0:X2}", EPB.drive_no).AppendLine();
|
||||
sb.AppendFormat("Volume Serial Number: 0x{0:X8}", EPB.serial_no).AppendLine();
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X8}", EPB.serial_no);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X8}", EPB.serial_no);
|
||||
if(EPB.signature == 0x29)
|
||||
{
|
||||
if((EPB.nt_flags & 0x01) == 0x01)
|
||||
@@ -379,29 +376,29 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x03, OEM Name, 8 bytes, space-padded</summary>
|
||||
public string OEMName;
|
||||
/// <summary>0x0B, Bytes per sector</summary>
|
||||
public UInt16 bps;
|
||||
public ushort bps;
|
||||
/// <summary>0x0D, Sectors per cluster</summary>
|
||||
public byte spc;
|
||||
/// <summary>0x0E, Reserved sectors between BPB and FAT</summary>
|
||||
public UInt16 rsectors;
|
||||
public ushort rsectors;
|
||||
/// <summary>0x10, Number of FATs</summary>
|
||||
public byte fats_no;
|
||||
/// <summary>0x11, Number of entries on root directory</summary>
|
||||
public UInt16 root_ent;
|
||||
public ushort root_ent;
|
||||
/// <summary>0x13, Sectors in volume</summary>
|
||||
public UInt16 sectors;
|
||||
public ushort sectors;
|
||||
/// <summary>0x15, Media descriptor</summary>
|
||||
public byte media;
|
||||
/// <summary>0x16, Sectors per FAT</summary>
|
||||
public UInt16 spfat;
|
||||
public ushort spfat;
|
||||
/// <summary>0x18, Sectors per track</summary>
|
||||
public UInt16 sptrk;
|
||||
public ushort sptrk;
|
||||
/// <summary>0x1A, Heads</summary>
|
||||
public UInt16 heads;
|
||||
public ushort heads;
|
||||
/// <summary>0x1C, Hidden sectors before BPB</summary>
|
||||
public UInt32 hsectors;
|
||||
public uint hsectors;
|
||||
/// <summary>0x20, Sectors in volume if > 65535</summary>
|
||||
public UInt32 big_sectors;
|
||||
public uint big_sectors;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -412,27 +409,27 @@ namespace DiscImageChef.Filesystems
|
||||
public struct AtariBootBlock
|
||||
{
|
||||
/// <summary>0x01C, Atari ST use 16 bit for hidden sectors, probably so did old DOS</summary>
|
||||
public UInt16 hsectors;
|
||||
public ushort hsectors;
|
||||
/// <summary>0x01E, indicates if COMMAND.PRG must be executed after OS load</summary>
|
||||
public UInt16 xflag;
|
||||
public ushort xflag;
|
||||
/// <summary>0x020, load mode for, or 0 if fname indicates boot file</summary>
|
||||
public UInt16 ldmode;
|
||||
public ushort ldmode;
|
||||
/// <summary>0x022, sector from which to boot</summary>
|
||||
public UInt16 bsect;
|
||||
public ushort bsect;
|
||||
/// <summary>0x024, how many sectors to boot</summary>
|
||||
public UInt16 bsects_no;
|
||||
public ushort bsects_no;
|
||||
/// <summary>0x026, RAM address where boot should be located</summary>
|
||||
public UInt32 ldaddr;
|
||||
public uint ldaddr;
|
||||
/// <summary>0x02A, RAM address to copy the FAT and root directory</summary>
|
||||
public UInt32 fatbuf;
|
||||
public uint fatbuf;
|
||||
/// <summary>0x02E, 11 bytes, name of boot file</summary>
|
||||
public string fname;
|
||||
/// <summary>0x039, unused</summary>
|
||||
public UInt16 reserved;
|
||||
public ushort reserved;
|
||||
/// <summary>0x03B, 451 bytes boot code</summary>
|
||||
public byte[] boot_code;
|
||||
/// <summary>0x1FE, the sum of all the BPB+ABB must be 0x1234, so this bigendian value works as adjustment</summary>
|
||||
public UInt16 checksum;
|
||||
public ushort checksum;
|
||||
}
|
||||
|
||||
/// <summary>DOS Extended Parameter Block</summary>
|
||||
@@ -445,7 +442,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x26, EPB signature, 0x28 or 0x29<summary>
|
||||
public byte signature;
|
||||
/// <summary>0x27, Volume serial number<summary>
|
||||
public UInt32 serial_no;
|
||||
public uint serial_no;
|
||||
/// <summary>0x2B, Volume label, 11 bytes, space-padded
|
||||
/// Present only if signature == 0x29<summary>
|
||||
public string volume_label;
|
||||
@@ -458,17 +455,17 @@ namespace DiscImageChef.Filesystems
|
||||
public struct FAT32ParameterBlock
|
||||
{
|
||||
/// <summary>0x24, Sectors per FAT</summary>
|
||||
public UInt32 spfat;
|
||||
public uint spfat;
|
||||
/// <summary>0x28, FAT flags</summary>
|
||||
public UInt16 fat_flags;
|
||||
public ushort fat_flags;
|
||||
/// <summary>0x2A, FAT32 version</summary>
|
||||
public UInt16 version;
|
||||
public ushort version;
|
||||
/// <summary>0x2C, Cluster of root directory</summary>
|
||||
public UInt32 root_cluster;
|
||||
public uint root_cluster;
|
||||
/// <summary>0x30, Sector of FSINFO structure</summary>
|
||||
public UInt16 fsinfo_sector;
|
||||
public ushort fsinfo_sector;
|
||||
/// <summary>0x32, Sector of FAT32PB backup</summary>
|
||||
public UInt16 backup_sector;
|
||||
public ushort backup_sector;
|
||||
/// <summary>0x34, 12 reserved bytes</summary>
|
||||
public byte[] reserved;
|
||||
/// <summary>0x40, Drive number</summary>
|
||||
@@ -478,7 +475,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x42, FAT32PB signature, should be 0x29</summary>
|
||||
public byte signature;
|
||||
/// <summary>0x43, Volume serial number</summary>
|
||||
public UInt32 serial_no;
|
||||
public uint serial_no;
|
||||
/// <summary>0x47, Volume label, 11 bytes, space-padded</summary>
|
||||
public string volume_label;
|
||||
/// <summary>0x52, Filesystem type, 8 bytes, space-padded, must be "FAT32 "</summary>
|
||||
|
||||
@@ -32,15 +32,12 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Using information from Linux kernel headers
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Using information from Linux kernel headers
|
||||
public class FFSPlugin : Filesystem
|
||||
{
|
||||
public FFSPlugin()
|
||||
@@ -60,7 +57,7 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt32 magic;
|
||||
uint magic;
|
||||
uint sb_size_in_sectors;
|
||||
byte[] ufs_sb_sectors;
|
||||
|
||||
@@ -122,7 +119,7 @@ namespace DiscImageChef.Filesystems
|
||||
information = "";
|
||||
StringBuilder sbInformation = new StringBuilder();
|
||||
|
||||
UInt32 magic = 0;
|
||||
uint magic = 0;
|
||||
uint sb_size_in_sectors;
|
||||
byte[] ufs_sb_sectors;
|
||||
ulong sb_offset = partitionStart;
|
||||
@@ -330,11 +327,11 @@ namespace DiscImageChef.Filesystems
|
||||
ufs_sb.fs_fsmnt_ufs1 = StringHandlers.CToString(strings_b); /// <summary>0x00D4, 512 bytes, name mounted on
|
||||
ufs_sb.fs_cgrotor_ufs1 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x0000); /// <summary>0x02D4 last cg searched
|
||||
ufs_sb.fs_cs_ufs1 = new byte[124];
|
||||
Array.Copy(ufs_sb_sectors, 0x02D8, ufs_sb.fs_cs_ufs1, 0, 124); /// <summary>0x02D8, 124 bytes, UInt32s, list of fs_cs info buffers
|
||||
Array.Copy(ufs_sb_sectors, 0x02D8, ufs_sb.fs_cs_ufs1, 0, 124); /// <summary>0x02D8, 124 bytes, uints, list of fs_cs info buffers
|
||||
ufs_sb.fs_maxcluster_ufs1 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x0354); /// <summary>0x0354
|
||||
ufs_sb.fs_cpc_ufs1 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x0358); /// <summary>0x0358 cyl per cycle in postbl
|
||||
ufs_sb.fs_opostbl_ufs1 = new byte[256];
|
||||
Array.Copy(ufs_sb_sectors, 0x035C, ufs_sb.fs_opostbl_ufs1, 0, 256); /// <summary>0x035C, 256 bytes, [16][8] matrix of UInt16s, old rotation block list head
|
||||
Array.Copy(ufs_sb_sectors, 0x035C, ufs_sb.fs_opostbl_ufs1, 0, 256); /// <summary>0x035C, 256 bytes, [16][8] matrix of ushorts, old rotation block list head
|
||||
#endregion UFS1
|
||||
#region UFS2
|
||||
strings_b = new byte[468];
|
||||
@@ -347,7 +344,7 @@ namespace DiscImageChef.Filesystems
|
||||
ufs_sb.fs_pad_ufs2 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x02D0); /// <summary>0x02D0 due to alignment of fs_swuid
|
||||
ufs_sb.fs_cgrotor_ufs2 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x02D4); /// <summary>0x02D4 last cg searched
|
||||
ufs_sb.fs_ocsp_ufs2 = new byte[112];
|
||||
Array.Copy(ufs_sb_sectors, 0x02D8, ufs_sb.fs_ocsp_ufs2, 0, 112); /// <summary>0x02D8, 112 bytes, UInt32s, list of fs_cs info buffers
|
||||
Array.Copy(ufs_sb_sectors, 0x02D8, ufs_sb.fs_ocsp_ufs2, 0, 112); /// <summary>0x02D8, 112 bytes, uints, list of fs_cs info buffers
|
||||
ufs_sb.fs_contigdirs_ufs2 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x0348); /// <summary>0x0348 # of contiguously allocated dirs
|
||||
ufs_sb.fs_csp_ufs2 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x034C); /// <summary>0x034C cg summary info buffer for fs_cs
|
||||
ufs_sb.fs_maxcluster_ufs2 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x0350); /// <summary>0x0350
|
||||
@@ -355,7 +352,7 @@ namespace DiscImageChef.Filesystems
|
||||
ufs_sb.fs_old_cpc_ufs2 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x0358); /// <summary>0x0358 cyl per cycle in postbl
|
||||
ufs_sb.fs_maxbsize_ufs2 = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x035C); /// <summary>0x035C maximum blocking factor permitted
|
||||
ufs_sb.fs_sparecon64_ufs2 = new byte[136];
|
||||
Array.Copy(ufs_sb_sectors, 0x0360, ufs_sb.fs_sparecon64_ufs2, 0, 136); /// <summary>0x0360, 136 bytes, UInt64s, old rotation block list head
|
||||
Array.Copy(ufs_sb_sectors, 0x0360, ufs_sb.fs_sparecon64_ufs2, 0, 136); /// <summary>0x0360, 136 bytes, ulongs, old rotation block list head
|
||||
ufs_sb.fs_sblockloc_ufs2 = BigEndianBitConverter.ToUInt64(ufs_sb_sectors, 0x03E8); /// <summary>0x03E8 byte offset of standard superblock
|
||||
//cylinder summary information*/
|
||||
ufs_sb.fs_cstotal_ndir_ufs2 = BigEndianBitConverter.ToUInt64(ufs_sb_sectors, 0x03F0); /// <summary>0x03F0 number of directories
|
||||
@@ -556,7 +553,7 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
else
|
||||
{
|
||||
const UInt32 SunOSEpoch = 0x1A54C580; // We are supposing there cannot be a Sun's fs created before 1/1/1982 00:00:00
|
||||
const uint SunOSEpoch = 0x1A54C580; // We are supposing there cannot be a Sun's fs created before 1/1/1982 00:00:00
|
||||
|
||||
fs_type_43bsd = true; // There is no way of knowing this is the version, but there is of knowing it is not.
|
||||
|
||||
@@ -623,10 +620,10 @@ namespace DiscImageChef.Filesystems
|
||||
sbInformation.AppendFormat("First data block LBA: {0}", ufs_sb.fs_dblkno).AppendLine();
|
||||
sbInformation.AppendFormat("Cylinder group offset in cylinder: {0}", ufs_sb.fs_cgoffset).AppendLine();
|
||||
sbInformation.AppendFormat("Volume last written on {0}", DateHandlers.UNIXUnsignedToDateTime(ufs_sb.fs_time_t)).AppendLine();
|
||||
sbInformation.AppendFormat("{0} blocks in volume ({1} bytes)", ufs_sb.fs_size, (ulong)ufs_sb.fs_size * (ulong)1024).AppendLine();
|
||||
sbInformation.AppendFormat("{0} blocks in volume ({1} bytes)", ufs_sb.fs_size, ufs_sb.fs_size * 1024L).AppendLine();
|
||||
xmlFSType.Clusters = ufs_sb.fs_size;
|
||||
xmlFSType.ClusterSize = (int)ufs_sb.fs_bsize;
|
||||
sbInformation.AppendFormat("{0} data blocks in volume ({1} bytes)", ufs_sb.fs_dsize, (ulong)ufs_sb.fs_dsize * (ulong)1024).AppendLine();
|
||||
sbInformation.AppendFormat("{0} data blocks in volume ({1} bytes)", ufs_sb.fs_dsize, ufs_sb.fs_dsize * 1024L).AppendLine();
|
||||
sbInformation.AppendFormat("{0} cylinder groups in volume", ufs_sb.fs_ncg).AppendLine();
|
||||
sbInformation.AppendFormat("{0} bytes in a basic block", ufs_sb.fs_bsize).AppendLine();
|
||||
sbInformation.AppendFormat("{0} bytes in a frag block", ufs_sb.fs_fsize).AppendLine();
|
||||
@@ -659,7 +656,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(!fs_type_43bsd && ufs_sb.fs_id_1 > 0 && ufs_sb.fs_id_2 > 0)
|
||||
{
|
||||
sbInformation.AppendFormat("Volume ID: 0x{0:X8}{1:X8}", ufs_sb.fs_id_1, ufs_sb.fs_id_2).AppendLine();
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X8}{1:x8}", ufs_sb.fs_id_1, ufs_sb.fs_id_2);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X8}{1:x8}", ufs_sb.fs_id_1, ufs_sb.fs_id_2);
|
||||
}
|
||||
else if(fs_type_43bsd && ufs_sb.fs_headswitch_43bsd > 0 && ufs_sb.fs_trkseek_43bsd > 0)
|
||||
{
|
||||
@@ -703,7 +700,7 @@ namespace DiscImageChef.Filesystems
|
||||
sbInformation.AppendFormat("Volume name: \"{0}\"", ufs_sb.fs_volname_ufs2).AppendLine();
|
||||
xmlFSType.VolumeName = ufs_sb.fs_volname_ufs2;
|
||||
sbInformation.AppendFormat("Volume ID: 0x{0:X16}", ufs_sb.fs_swuid_ufs2).AppendLine();
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X16}", ufs_sb.fs_swuid_ufs2);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X16}", ufs_sb.fs_swuid_ufs2);
|
||||
sbInformation.AppendFormat("Last searched cylinder group: {0}", ufs_sb.fs_cgrotor_ufs2).AppendLine();
|
||||
sbInformation.AppendFormat("{0} contiguously allocated directories", ufs_sb.fs_contigdirs_ufs2).AppendLine();
|
||||
sbInformation.AppendFormat("Standard superblock LBA: {0}", ufs_sb.fs_sblockloc_ufs2).AppendLine();
|
||||
@@ -762,15 +759,15 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
// MAGICs
|
||||
// UFS magic
|
||||
const UInt32 UFS_MAGIC = 0x00011954;
|
||||
const uint UFS_MAGIC = 0x00011954;
|
||||
// BorderWare UFS
|
||||
const UInt32 UFS_MAGIC_BW = 0x0f242697;
|
||||
const uint UFS_MAGIC_BW = 0x0f242697;
|
||||
// UFS2 magic
|
||||
const UInt32 UFS2_MAGIC = 0x19540119;
|
||||
const uint UFS2_MAGIC = 0x19540119;
|
||||
// byteswapped
|
||||
const UInt32 UFS_CIGAM = 0x54190100;
|
||||
const uint UFS_CIGAM = 0x54190100;
|
||||
// Incomplete newfs
|
||||
const UInt32 UFS_BAD_MAGIC = 0x19960408;
|
||||
const uint UFS_BAD_MAGIC = 0x19960408;
|
||||
|
||||
/// <summary>
|
||||
/// On-disk superblock is quite a mixture of all the UFS/FFS variants
|
||||
@@ -784,93 +781,93 @@ namespace DiscImageChef.Filesystems
|
||||
#region 42BSD
|
||||
|
||||
/// <summary>0x0000 linked list of file systems</summary>
|
||||
public UInt32 fs_link_42bsd;
|
||||
public uint fs_link_42bsd;
|
||||
|
||||
#endregion
|
||||
|
||||
#region Sun
|
||||
|
||||
/// <summary>0x0000 file system state flag</summary>
|
||||
public UInt32 fs_state_sun;
|
||||
public uint fs_state_sun;
|
||||
|
||||
#endregion
|
||||
|
||||
#region COMMON
|
||||
|
||||
/// <summary>0x0004 used for incore super blocks</summary>
|
||||
public UInt32 fs_rlink;
|
||||
public uint fs_rlink;
|
||||
/// <summary>0x0008 addr of super-block in filesys</summary>
|
||||
public UInt32 fs_sblkno;
|
||||
public uint fs_sblkno;
|
||||
/// <summary>0x000C offset of cyl-block in filesys</summary>
|
||||
public UInt32 fs_cblkno;
|
||||
public uint fs_cblkno;
|
||||
/// <summary>0x0010 offset of inode-blocks in filesys</summary>
|
||||
public UInt32 fs_iblkno;
|
||||
public uint fs_iblkno;
|
||||
/// <summary>0x0014 offset of first data after cg</summary>
|
||||
public UInt32 fs_dblkno;
|
||||
public uint fs_dblkno;
|
||||
/// <summary>0x0018 cylinder group offset in cylinder</summary>
|
||||
public UInt32 fs_cgoffset;
|
||||
public uint fs_cgoffset;
|
||||
/// <summary>0x001C used to calc mod fs_ntrak</summary>
|
||||
public UInt32 fs_cgmask;
|
||||
public uint fs_cgmask;
|
||||
/// <summary>0x0020 last time written -- time_t</summary>
|
||||
public UInt32 fs_time_t;
|
||||
public uint fs_time_t;
|
||||
/// <summary>0x0024 number of blocks in fs</summary>
|
||||
public UInt32 fs_size;
|
||||
public uint fs_size;
|
||||
/// <summary>0x0028 number of data blocks in fs</summary>
|
||||
public UInt32 fs_dsize;
|
||||
public uint fs_dsize;
|
||||
/// <summary>0x002C number of cylinder groups</summary>
|
||||
public UInt32 fs_ncg;
|
||||
public uint fs_ncg;
|
||||
/// <summary>0x0030 size of basic blocks in fs</summary>
|
||||
public UInt32 fs_bsize;
|
||||
public uint fs_bsize;
|
||||
/// <summary>0x0034 size of frag blocks in fs</summary>
|
||||
public UInt32 fs_fsize;
|
||||
public uint fs_fsize;
|
||||
/// <summary>0x0038 number of frags in a block in fs</summary>
|
||||
public UInt32 fs_frag;
|
||||
public uint fs_frag;
|
||||
|
||||
// these are configuration parameters
|
||||
/// <summary>0x003C minimum percentage of free blocks</summary>
|
||||
public UInt32 fs_minfree;
|
||||
public uint fs_minfree;
|
||||
/// <summary>0x0040 num of ms for optimal next block</summary>
|
||||
public UInt32 fs_rotdelay;
|
||||
public uint fs_rotdelay;
|
||||
/// <summary>0x0044 disk revolutions per second</summary>
|
||||
public UInt32 fs_rps;
|
||||
public uint fs_rps;
|
||||
|
||||
// these fields can be computed from the others
|
||||
/// <summary>0x0048 ``blkoff'' calc of blk offsets</summary>
|
||||
public UInt32 fs_bmask;
|
||||
public uint fs_bmask;
|
||||
/// <summary>0x004C ``fragoff'' calc of frag offsets</summary>
|
||||
public UInt32 fs_fmask;
|
||||
public uint fs_fmask;
|
||||
/// <summary>0x0050 ``lblkno'' calc of logical blkno</summary>
|
||||
public UInt32 fs_bshift;
|
||||
public uint fs_bshift;
|
||||
/// <summary>0x0054 ``numfrags'' calc number of frags</summary>
|
||||
public UInt32 fs_fshift;
|
||||
public uint fs_fshift;
|
||||
|
||||
// these are configuration parameters
|
||||
/// <summary>0x0058 max number of contiguous blks</summary>
|
||||
public UInt32 fs_maxcontig;
|
||||
public uint fs_maxcontig;
|
||||
/// <summary>0x005C max number of blks per cyl group</summary>
|
||||
public UInt32 fs_maxbpg;
|
||||
public uint fs_maxbpg;
|
||||
|
||||
// these fields can be computed from the others
|
||||
/// <summary>0x0060 block to frag shift</summary>
|
||||
public UInt32 fs_fragshift;
|
||||
public uint fs_fragshift;
|
||||
/// <summary>0x0064 fsbtodb and dbtofsb shift constant</summary>
|
||||
public UInt32 fs_fsbtodb;
|
||||
public uint fs_fsbtodb;
|
||||
/// <summary>0x0068 actual size of super block</summary>
|
||||
public UInt32 fs_sbsize;
|
||||
public uint fs_sbsize;
|
||||
/// <summary>0x006C csum block offset</summary>
|
||||
public UInt32 fs_csmask;
|
||||
public uint fs_csmask;
|
||||
/// <summary>0x0070 csum block number</summary>
|
||||
public UInt32 fs_csshift;
|
||||
public uint fs_csshift;
|
||||
/// <summary>0x0074 value of NINDIR</summary>
|
||||
public UInt32 fs_nindir;
|
||||
public uint fs_nindir;
|
||||
/// <summary>0x0078 value of INOPB</summary>
|
||||
public UInt32 fs_inopb;
|
||||
public uint fs_inopb;
|
||||
/// <summary>0x007C value of NSPF</summary>
|
||||
public UInt32 fs_nspf;
|
||||
public uint fs_nspf;
|
||||
|
||||
// yet another configuration parameter
|
||||
/// <summary>0x0080 optimization preference, see below</summary>
|
||||
public UInt32 fs_optim;
|
||||
public uint fs_optim;
|
||||
|
||||
#endregion COMMON
|
||||
|
||||
@@ -879,23 +876,23 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
// these fields are derived from the hardware
|
||||
/// <summary>0x0084 # sectors/track including spares</summary>
|
||||
public UInt32 fs_npsect_sun;
|
||||
public uint fs_npsect_sun;
|
||||
|
||||
#endregion Sun
|
||||
|
||||
#region Sunx86
|
||||
|
||||
/// <summary>0x0084 file system state time stamp</summary>
|
||||
public UInt32 fs_state_t_sun86;
|
||||
public uint fs_state_t_sun86;
|
||||
|
||||
#endregion Sunx86
|
||||
|
||||
#region COMMON
|
||||
|
||||
/// <summary>0x0088 hardware sector interleave</summary>
|
||||
public UInt32 fs_interleave;
|
||||
public uint fs_interleave;
|
||||
/// <summary>0x008C sector 0 skew, per track</summary>
|
||||
public UInt32 fs_trackskew;
|
||||
public uint fs_trackskew;
|
||||
|
||||
#endregion COMMON
|
||||
|
||||
@@ -908,18 +905,18 @@ namespace DiscImageChef.Filesystems
|
||||
// there could be problems if they are.
|
||||
|
||||
/// <summary>0x0090</summary>
|
||||
public UInt32 fs_id_1;
|
||||
public uint fs_id_1;
|
||||
/// <summary>0x0094</summary>
|
||||
public UInt32 fs_id_2;
|
||||
public uint fs_id_2;
|
||||
|
||||
#endregion COMMON
|
||||
|
||||
#region 43BSD
|
||||
|
||||
/// <summary>0x0090 head switch time, usec</summary>
|
||||
public UInt32 fs_headswitch_43bsd;
|
||||
public uint fs_headswitch_43bsd;
|
||||
/// <summary>0x0094 track-to-track seek, usec</summary>
|
||||
public UInt32 fs_trkseek_43bsd;
|
||||
public uint fs_trkseek_43bsd;
|
||||
|
||||
#endregion 43BSD
|
||||
|
||||
@@ -927,42 +924,42 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
// sizes determined by number of cylinder groups and their sizes
|
||||
/// <summary>0x0098 blk addr of cyl grp summary area</summary>
|
||||
public UInt32 fs_csaddr;
|
||||
public uint fs_csaddr;
|
||||
/// <summary>0x009C size of cyl grp summary area</summary>
|
||||
public UInt32 fs_cssize;
|
||||
public uint fs_cssize;
|
||||
/// <summary>0x00A0 cylinder group size</summary>
|
||||
public UInt32 fs_cgsize;
|
||||
public uint fs_cgsize;
|
||||
|
||||
// these fields are derived from the hardware
|
||||
/// <summary>0x00A4 tracks per cylinder</summary>
|
||||
public UInt32 fs_ntrak;
|
||||
public uint fs_ntrak;
|
||||
/// <summary>0x00A8 sectors per track</summary>
|
||||
public UInt32 fs_nsect;
|
||||
public uint fs_nsect;
|
||||
/// <summary>0x00AC sectors per cylinder</summary>
|
||||
public UInt32 fs_spc;
|
||||
public uint fs_spc;
|
||||
|
||||
// this comes from the disk driver partitioning
|
||||
/// <summary>0x00B0 cylinders in file system</summary>
|
||||
public UInt32 fs_ncyl;
|
||||
public uint fs_ncyl;
|
||||
|
||||
// these fields can be computed from the others
|
||||
/// <summary>0x00B4 cylinders per group</summary>
|
||||
public UInt32 fs_cpg;
|
||||
public uint fs_cpg;
|
||||
/// <summary>0x00B8 inodes per cylinder group</summary>
|
||||
public UInt32 fs_ipg;
|
||||
public uint fs_ipg;
|
||||
/// <summary>0x00BC blocks per group * fs_frag</summary>
|
||||
public UInt32 fs_fpg;
|
||||
public uint fs_fpg;
|
||||
|
||||
// this data must be re-computed after crashes
|
||||
// struct ufs_csum fs_cstotal; // cylinder summary information
|
||||
/// <summary>0x00C0 number of directories</summary>
|
||||
public UInt32 fs_cstotal_ndir;
|
||||
public uint fs_cstotal_ndir;
|
||||
/// <summary>0x00C4 number of free blocks</summary>
|
||||
public UInt32 fs_cstotal_nbfree;
|
||||
public uint fs_cstotal_nbfree;
|
||||
/// <summary>0x00C8 number of free inodes</summary>
|
||||
public UInt32 fs_cstotal_nifree;
|
||||
public uint fs_cstotal_nifree;
|
||||
/// <summary>0x00CC number of free frags</summary>
|
||||
public UInt32 fs_cstotal_nffree;
|
||||
public uint fs_cstotal_nffree;
|
||||
|
||||
// these fields are cleared at mount time
|
||||
/// <summary>0x00D0 super block modified flag</summary>
|
||||
@@ -981,14 +978,14 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x00D4, 512 bytes, name mounted on</summary>
|
||||
public string fs_fsmnt_ufs1;
|
||||
/// <summary>0x02D4 last cg searched</summary>
|
||||
public UInt32 fs_cgrotor_ufs1;
|
||||
/// <summary>0x02D8, 124 bytes, UInt32s, list of fs_cs info buffers</summary>
|
||||
public uint fs_cgrotor_ufs1;
|
||||
/// <summary>0x02D8, 124 bytes, uints, list of fs_cs info buffers</summary>
|
||||
public byte[] fs_cs_ufs1;
|
||||
/// <summary>0x0354</summary>
|
||||
public UInt32 fs_maxcluster_ufs1;
|
||||
public uint fs_maxcluster_ufs1;
|
||||
/// <summary>0x0358 cyl per cycle in postbl</summary>
|
||||
public UInt32 fs_cpc_ufs1;
|
||||
/// <summary>0x035C, 256 bytes, [16][8] matrix of UInt16s, old rotation block list head</summary>
|
||||
public uint fs_cpc_ufs1;
|
||||
/// <summary>0x035C, 256 bytes, [16][8] matrix of ushorts, old rotation block list head</summary>
|
||||
public byte[] fs_opostbl_ufs1;
|
||||
|
||||
#endregion UFS1
|
||||
@@ -1000,60 +997,60 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x02A8, 32 bytes, volume name</summary>
|
||||
public string fs_volname_ufs2;
|
||||
/// <summary>0x02C8 system-wide uid</summary>
|
||||
public UInt64 fs_swuid_ufs2;
|
||||
public ulong fs_swuid_ufs2;
|
||||
/// <summary>0x02D0 due to alignment of fs_swuid</summary>
|
||||
public UInt32 fs_pad_ufs2;
|
||||
public uint fs_pad_ufs2;
|
||||
/// <summary>0x02D4 last cg searched</summary>
|
||||
public UInt32 fs_cgrotor_ufs2;
|
||||
/// <summary>0x02D8, 112 bytes, UInt32s, list of fs_cs info buffers</summary>
|
||||
public uint fs_cgrotor_ufs2;
|
||||
/// <summary>0x02D8, 112 bytes, uints, list of fs_cs info buffers</summary>
|
||||
public byte[] fs_ocsp_ufs2;
|
||||
/// <summary>0x0348 # of contiguously allocated dirs</summary>
|
||||
public UInt32 fs_contigdirs_ufs2;
|
||||
public uint fs_contigdirs_ufs2;
|
||||
/// <summary>0x034C cg summary info buffer for fs_cs</summary>
|
||||
public UInt32 fs_csp_ufs2;
|
||||
public uint fs_csp_ufs2;
|
||||
/// <summary>0x0350</summary>
|
||||
public UInt32 fs_maxcluster_ufs2;
|
||||
public uint fs_maxcluster_ufs2;
|
||||
/// <summary>0x0354 used by snapshots to track fs</summary>
|
||||
public UInt32 fs_active_ufs2;
|
||||
public uint fs_active_ufs2;
|
||||
/// <summary>0x0358 cyl per cycle in postbl</summary>
|
||||
public UInt32 fs_old_cpc_ufs2;
|
||||
public uint fs_old_cpc_ufs2;
|
||||
/// <summary>0x035C maximum blocking factor permitted</summary>
|
||||
public UInt32 fs_maxbsize_ufs2;
|
||||
/// <summary>0x0360, 136 bytes, UInt64s, old rotation block list head</summary>
|
||||
public uint fs_maxbsize_ufs2;
|
||||
/// <summary>0x0360, 136 bytes, ulongs, old rotation block list head</summary>
|
||||
public byte[] fs_sparecon64_ufs2;
|
||||
/// <summary>0x03E8 byte offset of standard superblock</summary>
|
||||
public UInt64 fs_sblockloc_ufs2;
|
||||
public ulong fs_sblockloc_ufs2;
|
||||
|
||||
/// <summary>0x03F0 number of directories</summary>
|
||||
public UInt64 fs_cstotal_ndir_ufs2;
|
||||
public ulong fs_cstotal_ndir_ufs2;
|
||||
/// <summary>0x03F8 number of free blocks</summary>
|
||||
public UInt64 fs_cstotal_nbfree_ufs2;
|
||||
public ulong fs_cstotal_nbfree_ufs2;
|
||||
/// <summary>0x0400 number of free inodes</summary>
|
||||
public UInt64 fs_cstotal_nifree_ufs2;
|
||||
public ulong fs_cstotal_nifree_ufs2;
|
||||
/// <summary>0x0408 number of free frags</summary>
|
||||
public UInt64 fs_cstotal_nffree_ufs2;
|
||||
public ulong fs_cstotal_nffree_ufs2;
|
||||
/// <summary>0x0410 number of free clusters</summary>
|
||||
public UInt64 fs_cstotal_numclusters_ufs2;
|
||||
public ulong fs_cstotal_numclusters_ufs2;
|
||||
/// <summary>0x0418 future expansion</summary>
|
||||
public UInt64 fs_cstotal_spare0_ufs2;
|
||||
public ulong fs_cstotal_spare0_ufs2;
|
||||
/// <summary>0x0420 future expansion</summary>
|
||||
public UInt64 fs_cstotal_spare1_ufs2;
|
||||
public ulong fs_cstotal_spare1_ufs2;
|
||||
/// <summary>0x0428 future expansion</summary>
|
||||
public UInt64 fs_cstotal_spare2_ufs2;
|
||||
public ulong fs_cstotal_spare2_ufs2;
|
||||
/// <summary>0x0430 last time written</summary>
|
||||
public UInt32 fs_time_sec_ufs2;
|
||||
public uint fs_time_sec_ufs2;
|
||||
/// <summary>0x0434 last time written</summary>
|
||||
public UInt32 fs_time_usec_ufs2;
|
||||
public uint fs_time_usec_ufs2;
|
||||
/// <summary>0x0438 number of blocks in fs</summary>
|
||||
public UInt64 fs_size_ufs2;
|
||||
public ulong fs_size_ufs2;
|
||||
/// <summary>0x0440 number of data blocks in fs</summary>
|
||||
public UInt64 fs_dsize_ufs2;
|
||||
public ulong fs_dsize_ufs2;
|
||||
/// <summary>0x0448 blk addr of cyl grp summary area</summary>
|
||||
public UInt64 fs_csaddr_ufs2;
|
||||
public ulong fs_csaddr_ufs2;
|
||||
/// <summary>0x0450 blocks in process of being freed</summary>
|
||||
public UInt64 fs_pendingblocks_ufs2;
|
||||
public ulong fs_pendingblocks_ufs2;
|
||||
/// <summary>0x0458 inodes in process of being freed</summary>
|
||||
public UInt32 fs_pendinginodes_ufs2;
|
||||
public uint fs_pendinginodes_ufs2;
|
||||
|
||||
#endregion UFS2
|
||||
|
||||
@@ -1062,19 +1059,19 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x045C, 212 bytes, reserved for future constants</summary>
|
||||
public byte[] fs_sparecon_sun;
|
||||
/// <summary>0x0530</summary>
|
||||
public UInt32 fs_reclaim_sun;
|
||||
public uint fs_reclaim_sun;
|
||||
/// <summary>0x0534</summary>
|
||||
public UInt32 fs_sparecon2_sun;
|
||||
public uint fs_sparecon2_sun;
|
||||
/// <summary>0x0538 file system state time stamp</summary>
|
||||
public UInt32 fs_state_t_sun;
|
||||
public uint fs_state_t_sun;
|
||||
/// <summary>0x053C ~usb_bmask</summary>
|
||||
public UInt32 fs_qbmask0_sun;
|
||||
public uint fs_qbmask0_sun;
|
||||
/// <summary>0x0540 ~usb_bmask</summary>
|
||||
public UInt32 fs_qbmask1_sun;
|
||||
public uint fs_qbmask1_sun;
|
||||
/// <summary>0x0544 ~usb_fmask</summary>
|
||||
public UInt32 fs_qfmask0_sun;
|
||||
public uint fs_qfmask0_sun;
|
||||
/// <summary>0x0548 ~usb_fmask</summary>
|
||||
public UInt32 fs_qfmask1_sun;
|
||||
public uint fs_qfmask1_sun;
|
||||
|
||||
#endregion Sun
|
||||
|
||||
@@ -1083,19 +1080,19 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x045C, 212 bytes, reserved for future constants</summary>
|
||||
public byte[] fs_sparecon_sun86;
|
||||
/// <summary>0x0530</summary>
|
||||
public UInt32 fs_reclaim_sun86;
|
||||
public uint fs_reclaim_sun86;
|
||||
/// <summary>0x0534</summary>
|
||||
public UInt32 fs_sparecon2_sun86;
|
||||
public uint fs_sparecon2_sun86;
|
||||
/// <summary>0x0538 # sectors/track including spares</summary>
|
||||
public UInt32 fs_npsect_sun86;
|
||||
public uint fs_npsect_sun86;
|
||||
/// <summary>0x053C ~usb_bmask</summary>
|
||||
public UInt32 fs_qbmask0_sun86;
|
||||
public uint fs_qbmask0_sun86;
|
||||
/// <summary>0x0540 ~usb_bmask</summary>
|
||||
public UInt32 fs_qbmask1_sun86;
|
||||
public uint fs_qbmask1_sun86;
|
||||
/// <summary>0x0544 ~usb_fmask</summary>
|
||||
public UInt32 fs_qfmask0_sun86;
|
||||
public uint fs_qfmask0_sun86;
|
||||
/// <summary>0x0548 ~usb_fmask</summary>
|
||||
public UInt32 fs_qfmask1_sun86;
|
||||
public uint fs_qfmask1_sun86;
|
||||
|
||||
#endregion Sunx86
|
||||
|
||||
@@ -1104,38 +1101,38 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x045C, 200 bytes</summary>
|
||||
public byte[] fs_sparecon_44bsd;
|
||||
/// <summary>0x0524 size of cluster summary array</summary>
|
||||
public UInt32 fs_contigsumsize_44bsd;
|
||||
public uint fs_contigsumsize_44bsd;
|
||||
/// <summary>0x0528 max length of an internal symlink</summary>
|
||||
public UInt32 fs_maxsymlinklen_44bsd;
|
||||
public uint fs_maxsymlinklen_44bsd;
|
||||
/// <summary>0x052C format of on-disk inodes</summary>
|
||||
public UInt32 fs_inodefmt_44bsd;
|
||||
public uint fs_inodefmt_44bsd;
|
||||
/// <summary>0x0530 max representable file size</summary>
|
||||
public UInt32 fs_maxfilesize0_44bsd;
|
||||
public uint fs_maxfilesize0_44bsd;
|
||||
/// <summary>0x0534 max representable file size</summary>
|
||||
public UInt32 fs_maxfilesize1_44bsd;
|
||||
public uint fs_maxfilesize1_44bsd;
|
||||
/// <summary>0x0538 ~usb_bmask</summary>
|
||||
public UInt32 fs_qbmask0_44bsd;
|
||||
public uint fs_qbmask0_44bsd;
|
||||
/// <summary>0x053C ~usb_bmask</summary>
|
||||
public UInt32 fs_qbmask1_44bsd;
|
||||
public uint fs_qbmask1_44bsd;
|
||||
/// <summary>0x0540 ~usb_fmask</summary>
|
||||
public UInt32 fs_qfmask0_44bsd;
|
||||
public uint fs_qfmask0_44bsd;
|
||||
/// <summary>0x0544 ~usb_fmask</summary>
|
||||
public UInt32 fs_qfmask1_44bsd;
|
||||
public uint fs_qfmask1_44bsd;
|
||||
/// <summary>0x0548 file system state time stamp</summary>
|
||||
public UInt32 fs_state_t_44bsd;
|
||||
public uint fs_state_t_44bsd;
|
||||
|
||||
#endregion 44BSD
|
||||
|
||||
/// <summary>0x054C format of positional layout tables</summary>
|
||||
public UInt32 fs_postblformat;
|
||||
public uint fs_postblformat;
|
||||
/// <summary>0x0550 number of rotational positions</summary>
|
||||
public UInt32 fs_nrpos;
|
||||
public uint fs_nrpos;
|
||||
/// <summary>0x0554 (__s16) rotation block list head</summary>
|
||||
public UInt32 fs_postbloff;
|
||||
public uint fs_postbloff;
|
||||
/// <summary>0x0558 (__u8) blocks for each rotation</summary>
|
||||
public UInt32 fs_rotbloff;
|
||||
public uint fs_rotbloff;
|
||||
/// <summary>0x055C magic number</summary>
|
||||
public UInt32 fs_magic;
|
||||
public uint fs_magic;
|
||||
/// <summary>0x0560 list of blocks for each rotation</summary>
|
||||
public byte fs_space;
|
||||
// 0x0561
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace DiscImageChef.Filesystems
|
||||
public abstract Errno Mount(bool debug);
|
||||
|
||||
/// <summary>
|
||||
/// Frees all internal structures created by <see cref="Mount"/>
|
||||
/// Frees all internal structures created by <see cref="Mount()"/>
|
||||
/// </summary>
|
||||
public abstract Errno Unmount();
|
||||
|
||||
|
||||
@@ -32,12 +32,11 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from an old unnamed document
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from an old unnamed document
|
||||
class HPFS : Filesystem
|
||||
{
|
||||
public HPFS()
|
||||
@@ -57,7 +56,7 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt32 magic1, magic2;
|
||||
uint magic1, magic2;
|
||||
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partitionStart); // Seek to superblock, on logical sector 16
|
||||
magic1 = BitConverter.ToUInt32(hpfs_sb_sector, 0x000);
|
||||
@@ -254,7 +253,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.ClusterSize = hpfs_bpb.bps * hpfs_bpb.spc;
|
||||
xmlFSType.Type = "HPFS";
|
||||
xmlFSType.VolumeName = hpfs_bpb.volume_label;
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X8}", hpfs_bpb.serial_no);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X8}", hpfs_bpb.serial_no);
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
@@ -267,33 +266,33 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x000, Jump to boot code</summary>
|
||||
public byte jmp1;
|
||||
/// <summary>0x001, ...;</summary>
|
||||
public UInt16 jmp2;
|
||||
public ushort jmp2;
|
||||
/// <summary>0x003, OEM Name, 8 bytes, space-padded</summary>
|
||||
public string OEMName;
|
||||
/// <summary>0x00B, Bytes per sector</summary>
|
||||
public UInt16 bps;
|
||||
public ushort bps;
|
||||
/// <summary>0x00D, Sectors per cluster</summary>
|
||||
public byte spc;
|
||||
/// <summary>0x00E, Reserved sectors between BPB and... does it have sense in HPFS?</summary>
|
||||
public UInt16 rsectors;
|
||||
public ushort rsectors;
|
||||
/// <summary>0x010, Number of FATs... seriously?</summary>
|
||||
public byte fats_no;
|
||||
/// <summary>0x011, Number of entries on root directory... ok</summary>
|
||||
public UInt16 root_ent;
|
||||
public ushort root_ent;
|
||||
/// <summary>0x013, Sectors in volume... doubt it</summary>
|
||||
public UInt16 sectors;
|
||||
public ushort sectors;
|
||||
/// <summary>0x015, Media descriptor</summary>
|
||||
public byte media;
|
||||
/// <summary>0x016, Sectors per FAT... again</summary>
|
||||
public UInt16 spfat;
|
||||
public ushort spfat;
|
||||
/// <summary>0x018, Sectors per track... you're kidding</summary>
|
||||
public UInt16 sptrk;
|
||||
public ushort sptrk;
|
||||
/// <summary>0x01A, Heads... stop!</summary>
|
||||
public UInt16 heads;
|
||||
public ushort heads;
|
||||
/// <summary>0x01C, Hidden sectors before BPB</summary>
|
||||
public UInt32 hsectors;
|
||||
public uint hsectors;
|
||||
/// <summary>0x024, Sectors in volume if > 65535...</summary>
|
||||
public UInt32 big_sectors;
|
||||
public uint big_sectors;
|
||||
/// <summary>0x028, Drive number</summary>
|
||||
public byte drive_no;
|
||||
/// <summary>0x029, Volume flags?</summary>
|
||||
@@ -301,7 +300,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x02A, EPB signature, 0x29</summary>
|
||||
public byte signature;
|
||||
/// <summary>0x02B, Volume serial number</summary>
|
||||
public UInt32 serial_no;
|
||||
public uint serial_no;
|
||||
/// <summary>0x02F, Volume label, 11 bytes, space-padded</summary>
|
||||
public string volume_label;
|
||||
/// <summary>0x03A, Filesystem type, 8 bytes, space-padded ("HPFS ")</summary>
|
||||
@@ -314,51 +313,51 @@ namespace DiscImageChef.Filesystems
|
||||
struct HPFS_SuperBlock
|
||||
{
|
||||
/// <summary>0x000, 0xF995E849</summary>
|
||||
public UInt32 magic1;
|
||||
public uint magic1;
|
||||
/// <summary>0x004, 0xFA53E9C5</summary>
|
||||
public UInt32 magic2;
|
||||
public uint magic2;
|
||||
/// <summary>0x008, HPFS version</summary>
|
||||
public byte version;
|
||||
/// <summary>0x009, 2 if <= 4 GiB, 3 if > 4 GiB</summary>
|
||||
public byte func_version;
|
||||
/// <summary>0x00A, Alignment</summary>
|
||||
public UInt16 dummy;
|
||||
public ushort dummy;
|
||||
/// <summary>0x00C, LSN pointer to root fnode</summary>
|
||||
public UInt32 root_fnode;
|
||||
public uint root_fnode;
|
||||
/// <summary>0x010, Sectors on volume</summary>
|
||||
public UInt32 sectors;
|
||||
public uint sectors;
|
||||
/// <summary>0x014, Bad blocks on volume</summary>
|
||||
public UInt32 badblocks;
|
||||
public uint badblocks;
|
||||
/// <summary>0x018, LSN pointer to volume bitmap</summary>
|
||||
public UInt32 bitmap_lsn;
|
||||
public uint bitmap_lsn;
|
||||
/// <summary>0x01C, 0</summary>
|
||||
public UInt32 zero1;
|
||||
public uint zero1;
|
||||
/// <summary>0x020, LSN pointer to badblock directory</summary>
|
||||
public UInt32 badblock_lsn;
|
||||
public uint badblock_lsn;
|
||||
/// <summary>0x024, 0</summary>
|
||||
public UInt32 zero2;
|
||||
public uint zero2;
|
||||
/// <summary>0x028, Time of last CHKDSK</summary>
|
||||
public Int32 last_chkdsk;
|
||||
public int last_chkdsk;
|
||||
/// <summary>0x02C, Time of last optimization</summary>
|
||||
public Int32 last_optim;
|
||||
public int last_optim;
|
||||
/// <summary>0x030, Sectors of dir band</summary>
|
||||
public UInt32 dband_sectors;
|
||||
public uint dband_sectors;
|
||||
/// <summary>0x034, Start sector of dir band</summary>
|
||||
public UInt32 dband_start;
|
||||
public uint dband_start;
|
||||
/// <summary>0x038, Last sector of dir band</summary>
|
||||
public UInt32 dband_last;
|
||||
public uint dband_last;
|
||||
/// <summary>0x03C, LSN of free space bitmap</summary>
|
||||
public UInt32 dband_bitmap;
|
||||
public uint dband_bitmap;
|
||||
/// <summary>0x040, Can be used for volume name (32 bytes)</summary>
|
||||
public UInt64 zero3;
|
||||
public ulong zero3;
|
||||
/// <summary>0x048, ...</summary>
|
||||
public UInt64 zero4;
|
||||
public ulong zero4;
|
||||
/// <summary>0x04C, ...</summary>
|
||||
public UInt64 zero5;
|
||||
public ulong zero5;
|
||||
/// <summary>0x050, ...;</summary>
|
||||
public UInt64 zero6;
|
||||
public ulong zero6;
|
||||
/// <summary>0x058, LSN pointer to ACLs (only HPFS386)</summary>
|
||||
public UInt32 acl_start;
|
||||
public uint acl_start;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -367,33 +366,33 @@ namespace DiscImageChef.Filesystems
|
||||
struct HPFS_SpareBlock
|
||||
{
|
||||
/// <summary>0x000, 0xF9911849</summary>
|
||||
public UInt32 magic1;
|
||||
public uint magic1;
|
||||
/// <summary>0x004, 0xFA5229C5</summary>
|
||||
public UInt32 magic2;
|
||||
public uint magic2;
|
||||
/// <summary>0x008, HPFS flags</summary>
|
||||
public byte flags1;
|
||||
/// <summary>0x009, HPFS386 flags</summary>
|
||||
public byte flags2;
|
||||
/// <summary>0x00A, Alignment</summary>
|
||||
public UInt16 dummy;
|
||||
public ushort dummy;
|
||||
/// <summary>0x00C, LSN of hotfix directory</summary>
|
||||
public UInt32 hotfix_start;
|
||||
public uint hotfix_start;
|
||||
/// <summary>0x010, Used hotfixes</summary>
|
||||
public UInt32 hotfix_used;
|
||||
public uint hotfix_used;
|
||||
/// <summary>0x014, Total hotfixes available</summary>
|
||||
public UInt32 hotfix_entries;
|
||||
public uint hotfix_entries;
|
||||
/// <summary>0x018, Unused spare dnodes</summary>
|
||||
public UInt32 spare_dnodes_free;
|
||||
public uint spare_dnodes_free;
|
||||
/// <summary>0x01C, Length of spare dnodes list</summary>
|
||||
public UInt32 spare_dnodes;
|
||||
public uint spare_dnodes;
|
||||
/// <summary>0x020, LSN of codepage directory</summary>
|
||||
public UInt32 codepage_lsn;
|
||||
public uint codepage_lsn;
|
||||
/// <summary>0x024, Number of codepages used</summary>
|
||||
public UInt32 codepages;
|
||||
public uint codepages;
|
||||
/// <summary>0x028, SuperBlock CRC32 (only HPFS386)</summary>
|
||||
public UInt32 sb_crc32;
|
||||
public uint sb_crc32;
|
||||
/// <summary>0x02C, SpareBlock CRC32 (only HPFS386)</summary>
|
||||
public UInt32 sp_crc32;
|
||||
public uint sp_crc32;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -33,18 +33,16 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// This is coded following ECMA-119.
|
||||
// TODO: Differentiate ISO Level 1, 2, 3 and ISO 9660:1999
|
||||
// TODO: Apple extensiones, requires XA or advance RR interpretation.
|
||||
// TODO: Needs a major rewrite
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// This is coded following ECMA-119.
|
||||
// TODO: Differentiate ISO Level 1, 2, 3 and ISO 9660:1999
|
||||
// TODO: Apple extensiones, requires XA or advance RR interpretation.
|
||||
// TODO: Needs a major rewrite
|
||||
class ISO9660Plugin : Filesystem
|
||||
{
|
||||
//static bool alreadyLaunched;
|
||||
@@ -440,7 +438,9 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
ipbindate = DateTime.ParseExact(Encoding.ASCII.GetString(release_date2), "yyyy.MMM", provider);
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
catch { }
|
||||
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -30,8 +30,6 @@
|
||||
// Copyright © 2011-2016 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
|
||||
namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
partial class LisaFS : Filesystem
|
||||
@@ -41,18 +39,18 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
const byte LisaFSv3 = 0x11;
|
||||
/// <summary>Maximum string size in LisaFS</summary>
|
||||
const uint E_NAME = 32;
|
||||
const UInt16 FILEID_FREE = 0x0000;
|
||||
const UInt16 FILEID_BOOT = 0xAAAA;
|
||||
const UInt16 FILEID_LOADER = 0xBBBB;
|
||||
const UInt16 FILEID_MDDF = 0x0001;
|
||||
const UInt16 FILEID_BITMAP = 0x0002;
|
||||
const UInt16 FILEID_SRECORD = 0x0003;
|
||||
const ushort FILEID_FREE = 0x0000;
|
||||
const ushort FILEID_BOOT = 0xAAAA;
|
||||
const ushort FILEID_LOADER = 0xBBBB;
|
||||
const ushort FILEID_MDDF = 0x0001;
|
||||
const ushort FILEID_BITMAP = 0x0002;
|
||||
const ushort FILEID_SRECORD = 0x0003;
|
||||
/// <summary>"Catalog file"</summary>
|
||||
const UInt16 FILEID_DIRECTORY = 0x0004;
|
||||
const Int16 FILEID_BOOT_SIGNED = -21846;
|
||||
const Int16 FILEID_LOADER_SIGNED = -17477;
|
||||
const UInt16 FILEID_ERASED = 0x7FFF;
|
||||
const UInt16 FILEID_MAX = FILEID_ERASED;
|
||||
const ushort FILEID_DIRECTORY = 0x0004;
|
||||
const short FILEID_BOOT_SIGNED = -21846;
|
||||
const short FILEID_LOADER_SIGNED = -17477;
|
||||
const ushort FILEID_ERASED = 0x7FFF;
|
||||
const ushort FILEID_MAX = FILEID_ERASED;
|
||||
|
||||
enum FileType : byte
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
public override Errno ReadDir(string path, ref List<string> contents)
|
||||
{
|
||||
Int16 fileId;
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
Errno ReadCatalog(Int16 fileId, out List<CatalogEntry> catalog)
|
||||
Errno ReadCatalog(short fileId, out List<CatalogEntry> catalog)
|
||||
{
|
||||
catalog = null;
|
||||
|
||||
|
||||
@@ -30,7 +30,6 @@
|
||||
// Copyright © 2011-2016 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
partial class LisaFS : Filesystem
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <returns>Error.</returns>
|
||||
/// <param name="fileId">File identifier.</param>
|
||||
/// <param name="file">Extents file.</param>
|
||||
Errno ReadExtentsFile(Int16 fileId, out ExtentFile file)
|
||||
Errno ReadExtentsFile(short fileId, out ExtentFile file)
|
||||
{
|
||||
file = new ExtentFile();
|
||||
|
||||
|
||||
@@ -31,12 +31,9 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using System.IO;
|
||||
|
||||
namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
@@ -44,7 +41,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
public override Errno GetAttributes(string path, ref FileAttributes attributes)
|
||||
{
|
||||
Int16 fileId;
|
||||
short fileId;
|
||||
Errno error = LookupFileId(path, out fileId);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
@@ -62,8 +59,8 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
if(offset < 0)
|
||||
return Errno.InvalidArgument;
|
||||
|
||||
Int16 fileId;
|
||||
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
@@ -106,7 +103,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
public override Errno Stat(string path, ref FileEntryInfo stat)
|
||||
{
|
||||
Int16 fileId;
|
||||
short fileId;
|
||||
Errno error = LookupFileId(path, out fileId);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
@@ -114,7 +111,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Stat(fileId, out stat);
|
||||
}
|
||||
|
||||
Errno GetAttributes(Int16 fileId, ref FileAttributes attributes)
|
||||
Errno GetAttributes(short fileId, ref FileAttributes attributes)
|
||||
{
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
@@ -177,12 +174,12 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
Errno ReadSystemFile(Int16 fileId, out byte[] buf)
|
||||
Errno ReadSystemFile(short fileId, out byte[] buf)
|
||||
{
|
||||
return ReadSystemFile(fileId, out buf, false);
|
||||
}
|
||||
|
||||
Errno ReadSystemFile(Int16 fileId, out byte[] buf, bool tags)
|
||||
Errno ReadSystemFile(short fileId, out byte[] buf, bool tags)
|
||||
{
|
||||
buf = null;
|
||||
if(!mounted || !debug)
|
||||
@@ -261,7 +258,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
Errno Stat(Int16 fileId, out FileEntryInfo stat)
|
||||
Errno Stat(short fileId, out FileEntryInfo stat)
|
||||
{
|
||||
stat = null;
|
||||
|
||||
@@ -372,12 +369,12 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
Errno ReadFile(Int16 fileId, out byte[] buf)
|
||||
Errno ReadFile(short fileId, out byte[] buf)
|
||||
{
|
||||
return ReadFile(fileId, out buf, false);
|
||||
}
|
||||
|
||||
Errno ReadFile(Int16 fileId, out byte[] buf, bool tags)
|
||||
Errno ReadFile(short fileId, out byte[] buf, bool tags)
|
||||
{
|
||||
buf = null;
|
||||
if(!mounted)
|
||||
@@ -438,13 +435,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
Errno LookupFileId(string path, out Int16 fileId)
|
||||
Errno LookupFileId(string path, out short fileId)
|
||||
{
|
||||
bool temp;
|
||||
return LookupFileId(path, out fileId, out temp);
|
||||
}
|
||||
|
||||
Errno LookupFileId(string path, out Int16 fileId, out bool isDir)
|
||||
Errno LookupFileId(string path, out short fileId, out bool isDir)
|
||||
{
|
||||
fileId = 0;
|
||||
isDir = false;
|
||||
@@ -467,37 +464,37 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
if(debug)
|
||||
{
|
||||
if(String.Compare(pathElements[0], "$MDDF", StringComparison.InvariantCulture) == 0)
|
||||
if(string.Compare(pathElements[0], "$MDDF", StringComparison.InvariantCulture) == 0)
|
||||
{
|
||||
fileId = (short)FILEID_MDDF;
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
if(String.Compare(pathElements[0], "$Boot", StringComparison.InvariantCulture) == 0)
|
||||
if(string.Compare(pathElements[0], "$Boot", StringComparison.InvariantCulture) == 0)
|
||||
{
|
||||
fileId = FILEID_BOOT_SIGNED;
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
if(String.Compare(pathElements[0], "$Loader", StringComparison.InvariantCulture) == 0)
|
||||
if(string.Compare(pathElements[0], "$Loader", StringComparison.InvariantCulture) == 0)
|
||||
{
|
||||
fileId = FILEID_LOADER_SIGNED;
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
if(String.Compare(pathElements[0], "$Bitmap", StringComparison.InvariantCulture) == 0)
|
||||
if(string.Compare(pathElements[0], "$Bitmap", StringComparison.InvariantCulture) == 0)
|
||||
{
|
||||
fileId = (short)FILEID_BITMAP;
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
if(String.Compare(pathElements[0], "$S-Record", StringComparison.InvariantCulture) == 0)
|
||||
if(string.Compare(pathElements[0], "$S-Record", StringComparison.InvariantCulture) == 0)
|
||||
{
|
||||
fileId = (short)FILEID_SRECORD;
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
if(String.Compare(pathElements[0], "$", StringComparison.InvariantCulture) == 0)
|
||||
if(string.Compare(pathElements[0], "$", StringComparison.InvariantCulture) == 0)
|
||||
{
|
||||
fileId = (short)FILEID_DIRECTORY;
|
||||
isDir = true;
|
||||
@@ -517,7 +514,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
string filename = GetString(entry.filename);
|
||||
// Should they be case sensitive?
|
||||
if(String.Compare(wantedFilename, filename, StringComparison.InvariantCultureIgnoreCase) == 0)
|
||||
if(string.Compare(wantedFilename, filename, StringComparison.InvariantCultureIgnoreCase) == 0)
|
||||
{
|
||||
fileId = entry.fileID;
|
||||
isDir |= entry.fileType != 0x03;
|
||||
|
||||
@@ -30,48 +30,10 @@
|
||||
// Copyright © 2011-2016 Natalia Portillo
|
||||
// ****************************************************************************/
|
||||
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : Info.cs
|
||||
// Version : 1.0
|
||||
// Author(s) : Natalia Portillo
|
||||
//
|
||||
// Component : Component
|
||||
//
|
||||
// Revision : $Revision$
|
||||
// Last change by : $Author$
|
||||
// Date : $Date$
|
||||
//
|
||||
// --[ Description ] ----------------------------------------------------------
|
||||
//
|
||||
// Description
|
||||
//
|
||||
// --[ License ] --------------------------------------------------------------
|
||||
//
|
||||
// This library is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU Lesser General Public License as
|
||||
// published by the Free Software Foundation; either version 2.1 of the
|
||||
// License, or(at your option) any later version.
|
||||
//
|
||||
// This library is distributed in the hope that it will be useful, but
|
||||
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the GNU
|
||||
// Lesser General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public
|
||||
// License along with this library; if not, see<http://www.gnu.org/licenses/>.
|
||||
//
|
||||
// ----------------------------------------------------------------------------
|
||||
// Copyright (C) 2011-2015 Claunia.com
|
||||
// ****************************************************************************/
|
||||
// //$Id$
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
@@ -110,44 +72,44 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
if(searchTag.fileID == FILEID_MDDF)
|
||||
{
|
||||
byte[] sector = imagePlugin.ReadSector((ulong)i);
|
||||
MDDF mddf = new MDDF();
|
||||
MDDF info_mddf = new MDDF();
|
||||
|
||||
mddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
|
||||
mddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
|
||||
mddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
|
||||
mddf.vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78);
|
||||
mddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
|
||||
mddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
|
||||
info_mddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
|
||||
info_mddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
|
||||
info_mddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
|
||||
info_mddf.vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78);
|
||||
info_mddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
|
||||
info_mddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
|
||||
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Current sector = {0}", i);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", mddf.mddf_block);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", info_mddf.mddf_block);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Disk size = {0} sectors", imagePlugin.GetSectors());
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", mddf.vol_size);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}", mddf.volsize_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - mddf.mddf_block -1 = {0}", mddf.volsize_minus_mddf_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", info_mddf.vol_size);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}", info_mddf.volsize_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - mddf.mddf_block -1 = {0}", info_mddf.volsize_minus_mddf_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Disk sector = {0} bytes", imagePlugin.GetSectorSize());
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.blocksize = {0} bytes", mddf.blocksize);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.datasize = {0} bytes", mddf.datasize);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.blocksize = {0} bytes", info_mddf.blocksize);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.datasize = {0} bytes", info_mddf.datasize);
|
||||
|
||||
if(mddf.mddf_block != i - before_mddf)
|
||||
if(info_mddf.mddf_block != i - before_mddf)
|
||||
return false;
|
||||
|
||||
if(mddf.vol_size > imagePlugin.GetSectors())
|
||||
if(info_mddf.vol_size > imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
if(mddf.vol_size - 1 != mddf.volsize_minus_one)
|
||||
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one)
|
||||
return false;
|
||||
|
||||
if(mddf.vol_size - i - 1 != mddf.volsize_minus_mddf_minus_one - before_mddf)
|
||||
if(info_mddf.vol_size - i - 1 != info_mddf.volsize_minus_mddf_minus_one - before_mddf)
|
||||
return false;
|
||||
|
||||
if(mddf.datasize > mddf.blocksize)
|
||||
if(info_mddf.datasize > info_mddf.blocksize)
|
||||
return false;
|
||||
|
||||
if(mddf.blocksize < imagePlugin.GetSectorSize())
|
||||
if(info_mddf.blocksize < imagePlugin.GetSectorSize())
|
||||
return false;
|
||||
|
||||
if(mddf.datasize != imagePlugin.GetSectorSize())
|
||||
if(info_mddf.datasize != imagePlugin.GetSectorSize())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
@@ -199,153 +161,153 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
if(searchTag.fileID == FILEID_MDDF)
|
||||
{
|
||||
byte[] sector = imagePlugin.ReadSector((ulong)i);
|
||||
MDDF mddf = new MDDF();
|
||||
MDDF info_mddf = new MDDF();
|
||||
byte[] pString = new byte[33];
|
||||
UInt32 lisa_time;
|
||||
uint lisa_time;
|
||||
|
||||
mddf.fsversion = BigEndianBitConverter.ToUInt16(sector, 0x00);
|
||||
mddf.volid = BigEndianBitConverter.ToUInt64(sector, 0x02);
|
||||
mddf.volnum = BigEndianBitConverter.ToUInt16(sector, 0x0A);
|
||||
info_mddf.fsversion = BigEndianBitConverter.ToUInt16(sector, 0x00);
|
||||
info_mddf.volid = BigEndianBitConverter.ToUInt64(sector, 0x02);
|
||||
info_mddf.volnum = BigEndianBitConverter.ToUInt16(sector, 0x0A);
|
||||
Array.Copy(sector, 0x0C, pString, 0, 33);
|
||||
mddf.volname = GetStringFromPascal(pString);
|
||||
mddf.unknown1 = sector[0x2D];
|
||||
info_mddf.volname = GetStringFromPascal(pString);
|
||||
info_mddf.unknown1 = sector[0x2D];
|
||||
Array.Copy(sector, 0x2E, pString, 0, 33);
|
||||
// Prevent garbage
|
||||
if(pString[0] <= 32)
|
||||
mddf.password = GetStringFromPascal(pString);
|
||||
info_mddf.password = GetStringFromPascal(pString);
|
||||
else
|
||||
mddf.password = "";
|
||||
mddf.unknown2 = sector[0x4F];
|
||||
mddf.machine_id = BigEndianBitConverter.ToUInt32(sector, 0x50);
|
||||
mddf.master_copy_id = BigEndianBitConverter.ToUInt32(sector, 0x54);
|
||||
info_mddf.password = "";
|
||||
info_mddf.unknown2 = sector[0x4F];
|
||||
info_mddf.machine_id = BigEndianBitConverter.ToUInt32(sector, 0x50);
|
||||
info_mddf.master_copy_id = BigEndianBitConverter.ToUInt32(sector, 0x54);
|
||||
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x58);
|
||||
mddf.dtvc = DateHandlers.LisaToDateTime(lisa_time);
|
||||
info_mddf.dtvc = DateHandlers.LisaToDateTime(lisa_time);
|
||||
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x5C);
|
||||
mddf.dtcc = DateHandlers.LisaToDateTime(lisa_time);
|
||||
info_mddf.dtcc = DateHandlers.LisaToDateTime(lisa_time);
|
||||
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x60);
|
||||
mddf.dtvb = DateHandlers.LisaToDateTime(lisa_time);
|
||||
info_mddf.dtvb = DateHandlers.LisaToDateTime(lisa_time);
|
||||
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x64);
|
||||
mddf.dtvs = DateHandlers.LisaToDateTime(lisa_time);
|
||||
mddf.unknown3 = BigEndianBitConverter.ToUInt32(sector, 0x68);
|
||||
mddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
|
||||
mddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
|
||||
mddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
|
||||
mddf.vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78);
|
||||
mddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
|
||||
mddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
|
||||
mddf.unknown4 = BigEndianBitConverter.ToUInt16(sector, 0x80);
|
||||
mddf.unknown5 = BigEndianBitConverter.ToUInt32(sector, 0x82);
|
||||
mddf.unknown6 = BigEndianBitConverter.ToUInt32(sector, 0x86);
|
||||
mddf.clustersize = BigEndianBitConverter.ToUInt16(sector, 0x8A);
|
||||
mddf.fs_size = BigEndianBitConverter.ToUInt32(sector, 0x8C);
|
||||
mddf.unknown7 = BigEndianBitConverter.ToUInt32(sector, 0x90);
|
||||
mddf.srec_ptr = BigEndianBitConverter.ToUInt32(sector, 0x94);
|
||||
mddf.unknown9 = BigEndianBitConverter.ToUInt16(sector, 0x98);
|
||||
mddf.srec_len = BigEndianBitConverter.ToUInt16(sector, 0x9A);
|
||||
mddf.unknown10 = BigEndianBitConverter.ToUInt32(sector, 0x9C);
|
||||
mddf.unknown11 = BigEndianBitConverter.ToUInt32(sector, 0xA0);
|
||||
mddf.unknown12 = BigEndianBitConverter.ToUInt32(sector, 0xA4);
|
||||
mddf.unknown13 = BigEndianBitConverter.ToUInt32(sector, 0xA8);
|
||||
mddf.unknown14 = BigEndianBitConverter.ToUInt32(sector, 0xAC);
|
||||
mddf.filecount = BigEndianBitConverter.ToUInt16(sector, 0xB0);
|
||||
mddf.unknown15 = BigEndianBitConverter.ToUInt32(sector, 0xB2);
|
||||
mddf.unknown16 = BigEndianBitConverter.ToUInt32(sector, 0xB6);
|
||||
mddf.freecount = BigEndianBitConverter.ToUInt32(sector, 0xBA);
|
||||
mddf.unknown17 = BigEndianBitConverter.ToUInt16(sector, 0xBE);
|
||||
mddf.unknown18 = BigEndianBitConverter.ToUInt32(sector, 0xC0);
|
||||
mddf.overmount_stamp = BigEndianBitConverter.ToUInt64(sector, 0xC4);
|
||||
mddf.serialization = BigEndianBitConverter.ToUInt32(sector, 0xCC);
|
||||
mddf.unknown19 = BigEndianBitConverter.ToUInt32(sector, 0xD0);
|
||||
mddf.unknown_timestamp = BigEndianBitConverter.ToUInt32(sector, 0xD4);
|
||||
mddf.unknown20 = BigEndianBitConverter.ToUInt32(sector, 0xD8);
|
||||
mddf.unknown21 = BigEndianBitConverter.ToUInt32(sector, 0xDC);
|
||||
mddf.unknown22 = BigEndianBitConverter.ToUInt32(sector, 0xE0);
|
||||
mddf.unknown23 = BigEndianBitConverter.ToUInt32(sector, 0xE4);
|
||||
mddf.unknown24 = BigEndianBitConverter.ToUInt32(sector, 0xE8);
|
||||
mddf.unknown25 = BigEndianBitConverter.ToUInt32(sector, 0xEC);
|
||||
mddf.unknown26 = BigEndianBitConverter.ToUInt32(sector, 0xF0);
|
||||
mddf.unknown27 = BigEndianBitConverter.ToUInt32(sector, 0xF4);
|
||||
mddf.unknown28 = BigEndianBitConverter.ToUInt32(sector, 0xF8);
|
||||
mddf.unknown29 = BigEndianBitConverter.ToUInt32(sector, 0xFC);
|
||||
mddf.unknown30 = BigEndianBitConverter.ToUInt32(sector, 0x100);
|
||||
mddf.unknown31 = BigEndianBitConverter.ToUInt32(sector, 0x104);
|
||||
mddf.unknown32 = BigEndianBitConverter.ToUInt32(sector, 0x108);
|
||||
mddf.unknown33 = BigEndianBitConverter.ToUInt32(sector, 0x10C);
|
||||
mddf.unknown34 = BigEndianBitConverter.ToUInt32(sector, 0x110);
|
||||
mddf.unknown35 = BigEndianBitConverter.ToUInt32(sector, 0x114);
|
||||
mddf.backup_volid = BigEndianBitConverter.ToUInt64(sector, 0x118);
|
||||
mddf.label_size = BigEndianBitConverter.ToUInt16(sector, 0x120);
|
||||
mddf.fs_overhead = BigEndianBitConverter.ToUInt16(sector, 0x122);
|
||||
mddf.result_scavenge = BigEndianBitConverter.ToUInt16(sector, 0x124);
|
||||
mddf.boot_code = BigEndianBitConverter.ToUInt16(sector, 0x126);
|
||||
mddf.boot_environ = BigEndianBitConverter.ToUInt16(sector, 0x6C);
|
||||
mddf.unknown36 = BigEndianBitConverter.ToUInt32(sector, 0x12A);
|
||||
mddf.unknown37 = BigEndianBitConverter.ToUInt32(sector, 0x12E);
|
||||
mddf.unknown38 = BigEndianBitConverter.ToUInt32(sector, 0x132);
|
||||
mddf.vol_sequence = BigEndianBitConverter.ToUInt16(sector, 0x136);
|
||||
mddf.vol_left_mounted = sector[0x138];
|
||||
info_mddf.dtvs = DateHandlers.LisaToDateTime(lisa_time);
|
||||
info_mddf.unknown3 = BigEndianBitConverter.ToUInt32(sector, 0x68);
|
||||
info_mddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
|
||||
info_mddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
|
||||
info_mddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
|
||||
info_mddf.vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78);
|
||||
info_mddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
|
||||
info_mddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
|
||||
info_mddf.unknown4 = BigEndianBitConverter.ToUInt16(sector, 0x80);
|
||||
info_mddf.unknown5 = BigEndianBitConverter.ToUInt32(sector, 0x82);
|
||||
info_mddf.unknown6 = BigEndianBitConverter.ToUInt32(sector, 0x86);
|
||||
info_mddf.clustersize = BigEndianBitConverter.ToUInt16(sector, 0x8A);
|
||||
info_mddf.fs_size = BigEndianBitConverter.ToUInt32(sector, 0x8C);
|
||||
info_mddf.unknown7 = BigEndianBitConverter.ToUInt32(sector, 0x90);
|
||||
info_mddf.srec_ptr = BigEndianBitConverter.ToUInt32(sector, 0x94);
|
||||
info_mddf.unknown9 = BigEndianBitConverter.ToUInt16(sector, 0x98);
|
||||
info_mddf.srec_len = BigEndianBitConverter.ToUInt16(sector, 0x9A);
|
||||
info_mddf.unknown10 = BigEndianBitConverter.ToUInt32(sector, 0x9C);
|
||||
info_mddf.unknown11 = BigEndianBitConverter.ToUInt32(sector, 0xA0);
|
||||
info_mddf.unknown12 = BigEndianBitConverter.ToUInt32(sector, 0xA4);
|
||||
info_mddf.unknown13 = BigEndianBitConverter.ToUInt32(sector, 0xA8);
|
||||
info_mddf.unknown14 = BigEndianBitConverter.ToUInt32(sector, 0xAC);
|
||||
info_mddf.filecount = BigEndianBitConverter.ToUInt16(sector, 0xB0);
|
||||
info_mddf.unknown15 = BigEndianBitConverter.ToUInt32(sector, 0xB2);
|
||||
info_mddf.unknown16 = BigEndianBitConverter.ToUInt32(sector, 0xB6);
|
||||
info_mddf.freecount = BigEndianBitConverter.ToUInt32(sector, 0xBA);
|
||||
info_mddf.unknown17 = BigEndianBitConverter.ToUInt16(sector, 0xBE);
|
||||
info_mddf.unknown18 = BigEndianBitConverter.ToUInt32(sector, 0xC0);
|
||||
info_mddf.overmount_stamp = BigEndianBitConverter.ToUInt64(sector, 0xC4);
|
||||
info_mddf.serialization = BigEndianBitConverter.ToUInt32(sector, 0xCC);
|
||||
info_mddf.unknown19 = BigEndianBitConverter.ToUInt32(sector, 0xD0);
|
||||
info_mddf.unknown_timestamp = BigEndianBitConverter.ToUInt32(sector, 0xD4);
|
||||
info_mddf.unknown20 = BigEndianBitConverter.ToUInt32(sector, 0xD8);
|
||||
info_mddf.unknown21 = BigEndianBitConverter.ToUInt32(sector, 0xDC);
|
||||
info_mddf.unknown22 = BigEndianBitConverter.ToUInt32(sector, 0xE0);
|
||||
info_mddf.unknown23 = BigEndianBitConverter.ToUInt32(sector, 0xE4);
|
||||
info_mddf.unknown24 = BigEndianBitConverter.ToUInt32(sector, 0xE8);
|
||||
info_mddf.unknown25 = BigEndianBitConverter.ToUInt32(sector, 0xEC);
|
||||
info_mddf.unknown26 = BigEndianBitConverter.ToUInt32(sector, 0xF0);
|
||||
info_mddf.unknown27 = BigEndianBitConverter.ToUInt32(sector, 0xF4);
|
||||
info_mddf.unknown28 = BigEndianBitConverter.ToUInt32(sector, 0xF8);
|
||||
info_mddf.unknown29 = BigEndianBitConverter.ToUInt32(sector, 0xFC);
|
||||
info_mddf.unknown30 = BigEndianBitConverter.ToUInt32(sector, 0x100);
|
||||
info_mddf.unknown31 = BigEndianBitConverter.ToUInt32(sector, 0x104);
|
||||
info_mddf.unknown32 = BigEndianBitConverter.ToUInt32(sector, 0x108);
|
||||
info_mddf.unknown33 = BigEndianBitConverter.ToUInt32(sector, 0x10C);
|
||||
info_mddf.unknown34 = BigEndianBitConverter.ToUInt32(sector, 0x110);
|
||||
info_mddf.unknown35 = BigEndianBitConverter.ToUInt32(sector, 0x114);
|
||||
info_mddf.backup_volid = BigEndianBitConverter.ToUInt64(sector, 0x118);
|
||||
info_mddf.label_size = BigEndianBitConverter.ToUInt16(sector, 0x120);
|
||||
info_mddf.fs_overhead = BigEndianBitConverter.ToUInt16(sector, 0x122);
|
||||
info_mddf.result_scavenge = BigEndianBitConverter.ToUInt16(sector, 0x124);
|
||||
info_mddf.boot_code = BigEndianBitConverter.ToUInt16(sector, 0x126);
|
||||
info_mddf.boot_environ = BigEndianBitConverter.ToUInt16(sector, 0x6C);
|
||||
info_mddf.unknown36 = BigEndianBitConverter.ToUInt32(sector, 0x12A);
|
||||
info_mddf.unknown37 = BigEndianBitConverter.ToUInt32(sector, 0x12E);
|
||||
info_mddf.unknown38 = BigEndianBitConverter.ToUInt32(sector, 0x132);
|
||||
info_mddf.vol_sequence = BigEndianBitConverter.ToUInt16(sector, 0x136);
|
||||
info_mddf.vol_left_mounted = sector[0x138];
|
||||
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown1 = 0x{0:X2} ({0})", mddf.unknown1);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown2 = 0x{0:X2} ({0})", mddf.unknown2);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown3 = 0x{0:X8} ({0})", mddf.unknown3);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown4 = 0x{0:X4} ({0})", mddf.unknown4);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown5 = 0x{0:X8} ({0})", mddf.unknown5);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown6 = 0x{0:X8} ({0})", mddf.unknown6);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown7 = 0x{0:X8} ({0})", mddf.unknown7);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown9 = 0x{0:X4} ({0})", mddf.unknown9);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown10 = 0x{0:X8} ({0})", mddf.unknown10);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown11 = 0x{0:X8} ({0})", mddf.unknown11);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown12 = 0x{0:X8} ({0})", mddf.unknown12);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown13 = 0x{0:X8} ({0})", mddf.unknown13);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown14 = 0x{0:X8} ({0})", mddf.unknown14);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown15 = 0x{0:X8} ({0})", mddf.unknown15);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown16 = 0x{0:X8} ({0})", mddf.unknown16);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown17 = 0x{0:X4} ({0})", mddf.unknown17);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown18 = 0x{0:X8} ({0})", mddf.unknown18);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown19 = 0x{0:X8} ({0})", mddf.unknown19);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown20 = 0x{0:X8} ({0})", mddf.unknown20);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown21 = 0x{0:X8} ({0})", mddf.unknown21);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown22 = 0x{0:X8} ({0})", mddf.unknown22);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown23 = 0x{0:X8} ({0})", mddf.unknown23);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown24 = 0x{0:X8} ({0})", mddf.unknown24);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown25 = 0x{0:X8} ({0})", mddf.unknown25);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown26 = 0x{0:X8} ({0})", mddf.unknown26);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown27 = 0x{0:X8} ({0})", mddf.unknown27);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown28 = 0x{0:X8} ({0})", mddf.unknown28);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown29 = 0x{0:X8} ({0})", mddf.unknown29);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown30 = 0x{0:X8} ({0})", mddf.unknown30);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown31 = 0x{0:X8} ({0})", mddf.unknown31);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown32 = 0x{0:X8} ({0})", mddf.unknown32);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown33 = 0x{0:X8} ({0})", mddf.unknown33);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown34 = 0x{0:X8} ({0})", mddf.unknown34);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown35 = 0x{0:X8} ({0})", mddf.unknown35);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown36 = 0x{0:X8} ({0})", mddf.unknown36);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown37 = 0x{0:X8} ({0})", mddf.unknown37);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown38 = 0x{0:X8} ({0})", mddf.unknown38);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown_timestamp = 0x{0:X8} ({0}, {1})", mddf.unknown_timestamp, DateHandlers.LisaToDateTime(mddf.unknown_timestamp));
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown1 = 0x{0:X2} ({0})", info_mddf.unknown1);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown2 = 0x{0:X2} ({0})", info_mddf.unknown2);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown3 = 0x{0:X8} ({0})", info_mddf.unknown3);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown4 = 0x{0:X4} ({0})", info_mddf.unknown4);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown5 = 0x{0:X8} ({0})", info_mddf.unknown5);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown6 = 0x{0:X8} ({0})", info_mddf.unknown6);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown7 = 0x{0:X8} ({0})", info_mddf.unknown7);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown9 = 0x{0:X4} ({0})", info_mddf.unknown9);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown10 = 0x{0:X8} ({0})", info_mddf.unknown10);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown11 = 0x{0:X8} ({0})", info_mddf.unknown11);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown12 = 0x{0:X8} ({0})", info_mddf.unknown12);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown13 = 0x{0:X8} ({0})", info_mddf.unknown13);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown14 = 0x{0:X8} ({0})", info_mddf.unknown14);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown15 = 0x{0:X8} ({0})", info_mddf.unknown15);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown16 = 0x{0:X8} ({0})", info_mddf.unknown16);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown17 = 0x{0:X4} ({0})", info_mddf.unknown17);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown18 = 0x{0:X8} ({0})", info_mddf.unknown18);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown19 = 0x{0:X8} ({0})", info_mddf.unknown19);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown20 = 0x{0:X8} ({0})", info_mddf.unknown20);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown21 = 0x{0:X8} ({0})", info_mddf.unknown21);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown22 = 0x{0:X8} ({0})", info_mddf.unknown22);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown23 = 0x{0:X8} ({0})", info_mddf.unknown23);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown24 = 0x{0:X8} ({0})", info_mddf.unknown24);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown25 = 0x{0:X8} ({0})", info_mddf.unknown25);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown26 = 0x{0:X8} ({0})", info_mddf.unknown26);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown27 = 0x{0:X8} ({0})", info_mddf.unknown27);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown28 = 0x{0:X8} ({0})", info_mddf.unknown28);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown29 = 0x{0:X8} ({0})", info_mddf.unknown29);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown30 = 0x{0:X8} ({0})", info_mddf.unknown30);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown31 = 0x{0:X8} ({0})", info_mddf.unknown31);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown32 = 0x{0:X8} ({0})", info_mddf.unknown32);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown33 = 0x{0:X8} ({0})", info_mddf.unknown33);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown34 = 0x{0:X8} ({0})", info_mddf.unknown34);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown35 = 0x{0:X8} ({0})", info_mddf.unknown35);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown36 = 0x{0:X8} ({0})", info_mddf.unknown36);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown37 = 0x{0:X8} ({0})", info_mddf.unknown37);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown38 = 0x{0:X8} ({0})", info_mddf.unknown38);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown_timestamp = 0x{0:X8} ({0}, {1})", info_mddf.unknown_timestamp, DateHandlers.LisaToDateTime(info_mddf.unknown_timestamp));
|
||||
|
||||
if(mddf.mddf_block != i - before_mddf)
|
||||
if(info_mddf.mddf_block != i - before_mddf)
|
||||
return;
|
||||
|
||||
if(mddf.vol_size > imagePlugin.GetSectors())
|
||||
if(info_mddf.vol_size > imagePlugin.GetSectors())
|
||||
return;
|
||||
|
||||
if(mddf.vol_size - 1 != mddf.volsize_minus_one)
|
||||
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one)
|
||||
return;
|
||||
|
||||
if(mddf.vol_size - i - 1 != mddf.volsize_minus_mddf_minus_one - before_mddf)
|
||||
if(info_mddf.vol_size - i - 1 != info_mddf.volsize_minus_mddf_minus_one - before_mddf)
|
||||
return;
|
||||
|
||||
if(mddf.datasize > mddf.blocksize)
|
||||
if(info_mddf.datasize > info_mddf.blocksize)
|
||||
return;
|
||||
|
||||
if(mddf.blocksize < imagePlugin.GetSectorSize())
|
||||
if(info_mddf.blocksize < imagePlugin.GetSectorSize())
|
||||
return;
|
||||
|
||||
if(mddf.datasize != imagePlugin.GetSectorSize())
|
||||
if(info_mddf.datasize != imagePlugin.GetSectorSize())
|
||||
return;
|
||||
|
||||
switch(mddf.fsversion)
|
||||
switch(info_mddf.fsversion)
|
||||
{
|
||||
case LisaFSv1:
|
||||
sb.AppendLine("LisaFS v1");
|
||||
@@ -357,46 +319,46 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
sb.AppendLine("LisaFS v3");
|
||||
break;
|
||||
default:
|
||||
sb.AppendFormat("Uknown LisaFS version {0}", mddf.fsversion).AppendLine();
|
||||
sb.AppendFormat("Uknown LisaFS version {0}", info_mddf.fsversion).AppendLine();
|
||||
break;
|
||||
}
|
||||
|
||||
sb.AppendFormat("Volume name: \"{0}\"", mddf.volname).AppendLine();
|
||||
sb.AppendFormat("Volume password: \"{0}\"", mddf.password).AppendLine();
|
||||
sb.AppendFormat("Volume ID: 0x{0:X16}", mddf.volid).AppendLine();
|
||||
sb.AppendFormat("Backup volume ID: 0x{0:X16}", mddf.backup_volid).AppendLine();
|
||||
sb.AppendFormat("Volume name: \"{0}\"", info_mddf.volname).AppendLine();
|
||||
sb.AppendFormat("Volume password: \"{0}\"", info_mddf.password).AppendLine();
|
||||
sb.AppendFormat("Volume ID: 0x{0:X16}", info_mddf.volid).AppendLine();
|
||||
sb.AppendFormat("Backup volume ID: 0x{0:X16}", info_mddf.backup_volid).AppendLine();
|
||||
|
||||
sb.AppendFormat("Master copy ID: 0x{0:X8}", mddf.master_copy_id).AppendLine();
|
||||
sb.AppendFormat("Master copy ID: 0x{0:X8}", info_mddf.master_copy_id).AppendLine();
|
||||
|
||||
sb.AppendFormat("Volume is number {0} of {1}", mddf.volnum, mddf.vol_sequence).AppendLine();
|
||||
sb.AppendFormat("Volume is number {0} of {1}", info_mddf.volnum, info_mddf.vol_sequence).AppendLine();
|
||||
|
||||
sb.AppendFormat("Serial number of Lisa computer that created this volume: {0}", mddf.machine_id).AppendLine();
|
||||
sb.AppendFormat("Serial number of Lisa computer that can use this volume's software {0}", mddf.serialization).AppendLine();
|
||||
sb.AppendFormat("Serial number of Lisa computer that created this volume: {0}", info_mddf.machine_id).AppendLine();
|
||||
sb.AppendFormat("Serial number of Lisa computer that can use this volume's software {0}", info_mddf.serialization).AppendLine();
|
||||
|
||||
sb.AppendFormat("Volume created on {0}", mddf.dtvc).AppendLine();
|
||||
sb.AppendFormat("Some timestamp, says {0}", mddf.dtcc).AppendLine();
|
||||
sb.AppendFormat("Volume backed up on {0}", mddf.dtvb).AppendLine();
|
||||
sb.AppendFormat("Volume scavenged on {0}", mddf.dtvs).AppendLine();
|
||||
sb.AppendFormat("MDDF is in block {0}", mddf.mddf_block + before_mddf).AppendLine();
|
||||
sb.AppendFormat("Volume created on {0}", info_mddf.dtvc).AppendLine();
|
||||
sb.AppendFormat("Some timestamp, says {0}", info_mddf.dtcc).AppendLine();
|
||||
sb.AppendFormat("Volume backed up on {0}", info_mddf.dtvb).AppendLine();
|
||||
sb.AppendFormat("Volume scavenged on {0}", info_mddf.dtvs).AppendLine();
|
||||
sb.AppendFormat("MDDF is in block {0}", info_mddf.mddf_block + before_mddf).AppendLine();
|
||||
sb.AppendFormat("There are {0} reserved blocks before volume", before_mddf).AppendLine();
|
||||
sb.AppendFormat("{0} blocks minus one", mddf.volsize_minus_one).AppendLine();
|
||||
sb.AppendFormat("{0} blocks minus one minus MDDF offset", mddf.volsize_minus_mddf_minus_one).AppendLine();
|
||||
sb.AppendFormat("{0} blocks in volume", mddf.vol_size).AppendLine();
|
||||
sb.AppendFormat("{0} bytes per sector (uncooked)", mddf.blocksize).AppendLine();
|
||||
sb.AppendFormat("{0} bytes per sector", mddf.datasize).AppendLine();
|
||||
sb.AppendFormat("{0} blocks per cluster", mddf.clustersize).AppendLine();
|
||||
sb.AppendFormat("{0} blocks in filesystem", mddf.fs_size).AppendLine();
|
||||
sb.AppendFormat("{0} files in volume", mddf.filecount).AppendLine();
|
||||
sb.AppendFormat("{0} blocks free", mddf.freecount).AppendLine();
|
||||
sb.AppendFormat("{0} bytes in LisaInfo", mddf.label_size).AppendLine();
|
||||
sb.AppendFormat("Filesystem overhead: {0}", mddf.fs_overhead).AppendLine();
|
||||
sb.AppendFormat("Scanvenger result code: 0x{0:X8}", mddf.result_scavenge).AppendLine();
|
||||
sb.AppendFormat("Boot code: 0x{0:X8}", mddf.boot_code).AppendLine();
|
||||
sb.AppendFormat("Boot environment: 0x{0:X8}", mddf.boot_environ).AppendLine();
|
||||
sb.AppendFormat("Overmount stamp: 0x{0:X16}", mddf.overmount_stamp).AppendLine();
|
||||
sb.AppendFormat("S-Records start at {0} and spans for {1} blocks", mddf.srec_ptr + mddf.mddf_block + before_mddf, mddf.srec_len).AppendLine();
|
||||
sb.AppendFormat("{0} blocks minus one", info_mddf.volsize_minus_one).AppendLine();
|
||||
sb.AppendFormat("{0} blocks minus one minus MDDF offset", info_mddf.volsize_minus_mddf_minus_one).AppendLine();
|
||||
sb.AppendFormat("{0} blocks in volume", info_mddf.vol_size).AppendLine();
|
||||
sb.AppendFormat("{0} bytes per sector (uncooked)", info_mddf.blocksize).AppendLine();
|
||||
sb.AppendFormat("{0} bytes per sector", info_mddf.datasize).AppendLine();
|
||||
sb.AppendFormat("{0} blocks per cluster", info_mddf.clustersize).AppendLine();
|
||||
sb.AppendFormat("{0} blocks in filesystem", info_mddf.fs_size).AppendLine();
|
||||
sb.AppendFormat("{0} files in volume", info_mddf.filecount).AppendLine();
|
||||
sb.AppendFormat("{0} blocks free", info_mddf.freecount).AppendLine();
|
||||
sb.AppendFormat("{0} bytes in LisaInfo", info_mddf.label_size).AppendLine();
|
||||
sb.AppendFormat("Filesystem overhead: {0}", info_mddf.fs_overhead).AppendLine();
|
||||
sb.AppendFormat("Scanvenger result code: 0x{0:X8}", info_mddf.result_scavenge).AppendLine();
|
||||
sb.AppendFormat("Boot code: 0x{0:X8}", info_mddf.boot_code).AppendLine();
|
||||
sb.AppendFormat("Boot environment: 0x{0:X8}", info_mddf.boot_environ).AppendLine();
|
||||
sb.AppendFormat("Overmount stamp: 0x{0:X16}", info_mddf.overmount_stamp).AppendLine();
|
||||
sb.AppendFormat("S-Records start at {0} and spans for {1} blocks", info_mddf.srec_ptr + info_mddf.mddf_block + before_mddf, info_mddf.srec_len).AppendLine();
|
||||
|
||||
if(mddf.vol_left_mounted == 0)
|
||||
if(info_mddf.vol_left_mounted == 0)
|
||||
sb.AppendLine("Volume is clean");
|
||||
else
|
||||
sb.AppendLine("Volume is dirty");
|
||||
@@ -404,26 +366,26 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
information = sb.ToString();
|
||||
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
if(DateTime.Compare(mddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
|
||||
if(DateTime.Compare(info_mddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
|
||||
{
|
||||
xmlFSType.BackupDate = mddf.dtvb;
|
||||
xmlFSType.BackupDate = info_mddf.dtvb;
|
||||
xmlFSType.BackupDateSpecified = true;
|
||||
}
|
||||
xmlFSType.Clusters = mddf.vol_size;
|
||||
xmlFSType.ClusterSize = mddf.clustersize * mddf.datasize;
|
||||
if(DateTime.Compare(mddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
|
||||
xmlFSType.Clusters = info_mddf.vol_size;
|
||||
xmlFSType.ClusterSize = info_mddf.clustersize * info_mddf.datasize;
|
||||
if(DateTime.Compare(info_mddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
|
||||
{
|
||||
xmlFSType.CreationDate = mddf.dtvc;
|
||||
xmlFSType.CreationDate = info_mddf.dtvc;
|
||||
xmlFSType.CreationDateSpecified = true;
|
||||
}
|
||||
xmlFSType.Dirty = mddf.vol_left_mounted != 0;
|
||||
xmlFSType.Files = mddf.filecount;
|
||||
xmlFSType.Dirty = info_mddf.vol_left_mounted != 0;
|
||||
xmlFSType.Files = info_mddf.filecount;
|
||||
xmlFSType.FilesSpecified = true;
|
||||
xmlFSType.FreeClusters = mddf.freecount;
|
||||
xmlFSType.FreeClusters = info_mddf.freecount;
|
||||
xmlFSType.FreeClustersSpecified = true;
|
||||
xmlFSType.Type = "LisaFS";
|
||||
xmlFSType.VolumeName = mddf.volname;
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X16}", mddf.volid);
|
||||
xmlFSType.VolumeName = info_mddf.volname;
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X16}", info_mddf.volid);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,13 +32,13 @@
|
||||
|
||||
using System;
|
||||
|
||||
// All information by Natalia Portillo
|
||||
// Variable names from Lisa API
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
|
||||
namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
// All information by Natalia Portillo
|
||||
// Variable names from Lisa API
|
||||
partial class LisaFS : Filesystem
|
||||
{
|
||||
bool mounted;
|
||||
@@ -51,12 +51,12 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
SRecord[] srecords;
|
||||
|
||||
#region Caches
|
||||
Dictionary<Int16, ExtentFile> extentCache;
|
||||
Dictionary<Int16, byte[]> systemFileCache;
|
||||
Dictionary<Int16, byte[]> fileCache;
|
||||
Dictionary<Int16, List<CatalogEntry>> catalogCache;
|
||||
Dictionary<Int16, Int32> fileSizeCache;
|
||||
List<Int16> printedExtents;
|
||||
Dictionary<short, ExtentFile> extentCache;
|
||||
Dictionary<short, byte[]> systemFileCache;
|
||||
Dictionary<short, byte[]> fileCache;
|
||||
Dictionary<short, List<CatalogEntry>> catalogCache;
|
||||
Dictionary<short, int> fileSizeCache;
|
||||
List<short> printedExtents;
|
||||
#endregion Caches
|
||||
|
||||
public LisaFS()
|
||||
@@ -65,7 +65,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
|
||||
}
|
||||
|
||||
public LisaFS(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
public LisaFS(ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
device = imagePlugin;
|
||||
Name = "Apple Lisa File System";
|
||||
|
||||
@@ -38,11 +38,11 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
struct MDDF
|
||||
{
|
||||
/// <summary>0x00, Filesystem version</summary>
|
||||
public UInt16 fsversion;
|
||||
public ushort fsversion;
|
||||
/// <summary>0x02, Volume ID</summary>
|
||||
public UInt64 volid;
|
||||
public ulong volid;
|
||||
/// <summary>0x0A, Volume sequence number</summary>
|
||||
public UInt16 volnum;
|
||||
public ushort volnum;
|
||||
/// <summary>0x0C, Pascal string, 32+1 bytes, volume name</summary>
|
||||
public string volname;
|
||||
/// <summary>0x2D, unknown, possible padding</summary>
|
||||
@@ -52,9 +52,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x4F, unknown, possible padding</summary>
|
||||
public byte unknown2;
|
||||
/// <summary>0x50, Lisa serial number that init'ed this disk</summary>
|
||||
public UInt32 machine_id;
|
||||
public uint machine_id;
|
||||
/// <summary>0x54, ID of the master copy ? no idea really</summary>
|
||||
public UInt32 master_copy_id;
|
||||
public uint master_copy_id;
|
||||
/// <summary>0x58, Date of volume creation</summary>
|
||||
public DateTime dtvc;
|
||||
/// <summary>0x5C, Date...</summary>
|
||||
@@ -64,127 +64,127 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x64, Date of volume scavenging</summary>
|
||||
public DateTime dtvs;
|
||||
/// <summary>0x68, unknown</summary>
|
||||
public UInt32 unknown3;
|
||||
public uint unknown3;
|
||||
/// <summary>0x6C, block the MDDF is residing on</summary>
|
||||
public UInt32 mddf_block;
|
||||
public uint mddf_block;
|
||||
/// <summary>0x70, volsize-1</summary>
|
||||
public UInt32 volsize_minus_one;
|
||||
public uint volsize_minus_one;
|
||||
/// <summary>0x74, volsize-1-mddf_block</summary>
|
||||
public UInt32 volsize_minus_mddf_minus_one;
|
||||
public uint volsize_minus_mddf_minus_one;
|
||||
/// <summary>0x78, Volume size in blocks</summary>
|
||||
public UInt32 vol_size;
|
||||
public uint vol_size;
|
||||
/// <summary>0x7C, Blocks size of underlying drive (data+tags)</summary>
|
||||
public UInt16 blocksize;
|
||||
public ushort blocksize;
|
||||
/// <summary>0x7E, Data only block size</summary>
|
||||
public UInt16 datasize;
|
||||
public ushort datasize;
|
||||
/// <summary>0x80, unknown</summary>
|
||||
public UInt16 unknown4;
|
||||
public ushort unknown4;
|
||||
/// <summary>0x82, unknown</summary>
|
||||
public UInt32 unknown5;
|
||||
public uint unknown5;
|
||||
/// <summary>0x86, unknown</summary>
|
||||
public UInt32 unknown6;
|
||||
public uint unknown6;
|
||||
/// <summary>0x8A, Size in sectors of filesystem clusters</summary>
|
||||
public UInt16 clustersize;
|
||||
public ushort clustersize;
|
||||
/// <summary>0x8C, Filesystem size in blocks</summary>
|
||||
public UInt32 fs_size;
|
||||
public uint fs_size;
|
||||
/// <summary>0x90, unknown</summary>
|
||||
public UInt32 unknown7;
|
||||
public uint unknown7;
|
||||
/// <summary>0x94, Pointer to S-Records</summary>
|
||||
public UInt32 srec_ptr;
|
||||
public uint srec_ptr;
|
||||
/// <summary>0x98, unknown</summary>
|
||||
public UInt16 unknown9;
|
||||
public ushort unknown9;
|
||||
/// <summary>0x9A, S-Records length</summary>
|
||||
public UInt16 srec_len;
|
||||
public ushort srec_len;
|
||||
/// <summary>0x9C, unknown</summary>
|
||||
public UInt32 unknown10;
|
||||
public uint unknown10;
|
||||
/// <summary>0xA0, unknown</summary>
|
||||
public UInt32 unknown11;
|
||||
public uint unknown11;
|
||||
/// <summary>0xA4, unknown</summary>
|
||||
public UInt32 unknown12;
|
||||
public uint unknown12;
|
||||
/// <summary>0xA8, unknown</summary>
|
||||
public UInt32 unknown13;
|
||||
public uint unknown13;
|
||||
/// <summary>0xAC, unknown</summary>
|
||||
public UInt32 unknown14;
|
||||
public uint unknown14;
|
||||
/// <summary>0xB0, Files in volume</summary>
|
||||
public UInt16 filecount;
|
||||
public ushort filecount;
|
||||
/// <summary>0xB2, unknown</summary>
|
||||
public UInt32 unknown15;
|
||||
public uint unknown15;
|
||||
/// <summary>0xB6, unknown</summary>
|
||||
public UInt32 unknown16;
|
||||
public uint unknown16;
|
||||
/// <summary>0xBA, Free blocks</summary>
|
||||
public UInt32 freecount;
|
||||
public uint freecount;
|
||||
/// <summary>0xBE, unknown</summary>
|
||||
public UInt16 unknown17;
|
||||
public ushort unknown17;
|
||||
/// <summary>0xC0, unknown</summary>
|
||||
public UInt32 unknown18;
|
||||
public uint unknown18;
|
||||
/// <summary>0xC4, no idea</summary>
|
||||
public UInt64 overmount_stamp;
|
||||
public ulong overmount_stamp;
|
||||
/// <summary>0xCC, serialization, lisa serial number authorized to use blocked software on this volume</summary>
|
||||
public UInt32 serialization;
|
||||
public uint serialization;
|
||||
/// <summary>0xD0, unknown</summary>
|
||||
public UInt32 unknown19;
|
||||
public uint unknown19;
|
||||
/// <summary>0xD4, unknown, possible timestamp</summary>
|
||||
public UInt32 unknown_timestamp;
|
||||
public uint unknown_timestamp;
|
||||
/// <summary>0xD8, unknown</summary>
|
||||
public UInt32 unknown20;
|
||||
public uint unknown20;
|
||||
/// <summary>0xDC, unknown</summary>
|
||||
public UInt32 unknown21;
|
||||
public uint unknown21;
|
||||
/// <summary>0xE0, unknown</summary>
|
||||
public UInt32 unknown22;
|
||||
public uint unknown22;
|
||||
/// <summary>0xE4, unknown</summary>
|
||||
public UInt32 unknown23;
|
||||
public uint unknown23;
|
||||
/// <summary>0xE8, unknown</summary>
|
||||
public UInt32 unknown24;
|
||||
public uint unknown24;
|
||||
/// <summary>0xEC, unknown</summary>
|
||||
public UInt32 unknown25;
|
||||
public uint unknown25;
|
||||
/// <summary>0xF0, unknown</summary>
|
||||
public UInt32 unknown26;
|
||||
public uint unknown26;
|
||||
/// <summary>0xF4, unknown</summary>
|
||||
public UInt32 unknown27;
|
||||
public uint unknown27;
|
||||
/// <summary>0xF8, unknown</summary>
|
||||
public UInt32 unknown28;
|
||||
public uint unknown28;
|
||||
/// <summary>0xFC, unknown</summary>
|
||||
public UInt32 unknown29;
|
||||
public uint unknown29;
|
||||
/// <summary>0x100, unknown</summary>
|
||||
public UInt32 unknown30;
|
||||
public uint unknown30;
|
||||
/// <summary>0x104, unknown</summary>
|
||||
public UInt32 unknown31;
|
||||
public uint unknown31;
|
||||
/// <summary>0x108, unknown</summary>
|
||||
public UInt32 unknown32;
|
||||
public uint unknown32;
|
||||
/// <summary>0x10C, unknown</summary>
|
||||
public UInt32 unknown33;
|
||||
public uint unknown33;
|
||||
/// <summary>0x110, unknown</summary>
|
||||
public UInt32 unknown34;
|
||||
public uint unknown34;
|
||||
/// <summary>0x114, unknown</summary>
|
||||
public UInt32 unknown35;
|
||||
public uint unknown35;
|
||||
/// <summary>0x118, ID of volume where this volume was backed up</summary>
|
||||
public UInt64 backup_volid;
|
||||
public ulong backup_volid;
|
||||
/// <summary>0x120, Size of LisaInfo label</summary>
|
||||
public UInt16 label_size;
|
||||
public ushort label_size;
|
||||
/// <summary>0x122, not clear</summary>
|
||||
public UInt16 fs_overhead;
|
||||
public ushort fs_overhead;
|
||||
/// <summary>0x124, Return code of Scavenger</summary>
|
||||
public UInt16 result_scavenge;
|
||||
public ushort result_scavenge;
|
||||
/// <summary>0x126, No idea</summary>
|
||||
public UInt16 boot_code;
|
||||
public ushort boot_code;
|
||||
/// <summary>0x128, No idea</summary>
|
||||
public UInt16 boot_environ;
|
||||
public ushort boot_environ;
|
||||
/// <summary>0x12A, unknown</summary>
|
||||
public UInt32 unknown36;
|
||||
public uint unknown36;
|
||||
/// <summary>0x12E, unknown</summary>
|
||||
public UInt32 unknown37;
|
||||
public uint unknown37;
|
||||
/// <summary>0x132, unknown</summary>
|
||||
public UInt32 unknown38;
|
||||
public uint unknown38;
|
||||
/// <summary>0x136, Total volumes in sequence</summary>
|
||||
public UInt16 vol_sequence;
|
||||
public ushort vol_sequence;
|
||||
/// <summary>0x138, Volume is dirty?</summary>
|
||||
public byte vol_left_mounted;
|
||||
/// <summary>Is password present? (On-disk position unknown)</summary>
|
||||
public byte passwd_present;
|
||||
/// <summary>Opened files (memory-only?) (On-disk position unknown)</summary>
|
||||
public UInt32 opencount;
|
||||
public uint opencount;
|
||||
/// <summary>No idea (On-disk position unknown)</summary>
|
||||
public UInt32 copy_thread;
|
||||
public uint copy_thread;
|
||||
// Flags are boolean, but Pascal seems to use them as full unsigned 8 bit values
|
||||
/// <summary>No idea (On-disk position unknown)</summary>
|
||||
public byte privileged;
|
||||
@@ -203,31 +203,31 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
struct Tag
|
||||
{
|
||||
/// <summary>0x00 version</summary>
|
||||
public UInt16 version;
|
||||
public ushort version;
|
||||
/// <summary>0x02 unknown</summary>
|
||||
public UInt16 unknown;
|
||||
public ushort unknown;
|
||||
/// <summary>0x04 File ID. Negative numbers are extents for the file with same absolute value number</summary>
|
||||
public Int16 fileID;
|
||||
public short fileID;
|
||||
/// <summary>Only in 20 bytes tag at 0x06, mask 0x8000 if valid tag</summary>
|
||||
public UInt16 usedBytes;
|
||||
public ushort usedBytes;
|
||||
/// <summary>Only in 20 bytes tag at 0x08, 3 bytes</summary>
|
||||
public UInt32 absoluteBlock;
|
||||
public uint absoluteBlock;
|
||||
/// <summary>Only in 20 bytes tag at 0x0B, checksum byte</summary>
|
||||
public byte checksum;
|
||||
/// <summary>0x06 in 12 bytes tag, 0x0C in 20 bytes tag, relative block</summary>
|
||||
public UInt16 relBlock;
|
||||
public ushort relBlock;
|
||||
/// <summary>
|
||||
/// Next block for this file.
|
||||
/// In 12 bytes tag at 0x08, 2 bytes, 0x8000 bit seems always set, 0x07FF means this is last block.
|
||||
/// In 20 bytes tag at 0x0E, 3 bytes, 0xFFFFFF means this is last block.
|
||||
/// </summary>
|
||||
public UInt32 nextBlock;
|
||||
public uint nextBlock;
|
||||
/// <summary>
|
||||
/// Previous block for this file.
|
||||
/// In 12 bytes tag at 0x0A, 2 bytes, 0x07FF means this is first block.
|
||||
/// In 20 bytes tag at 0x11, 3 bytes, 0xFFFFFF means this is first block.
|
||||
/// </summary>
|
||||
public UInt32 prevBlock;
|
||||
public uint prevBlock;
|
||||
|
||||
/// <summary>On-memory value for easy first block search.</summary>
|
||||
public bool isFirst;
|
||||
@@ -256,23 +256,23 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x25, lot of values found here, unknown</summary>
|
||||
public byte unknown;
|
||||
/// <summary>0x26, file ID, must be positive and bigger than 4</summary>
|
||||
public Int16 fileID;
|
||||
public short fileID;
|
||||
/// <summary>0x28, creation date</summary>
|
||||
public UInt32 dtc;
|
||||
public uint dtc;
|
||||
/// <summary>0x2C, last modification date</summary>
|
||||
public UInt32 dtm;
|
||||
public uint dtm;
|
||||
/// <summary>0x30, file length in bytes</summary>
|
||||
public Int32 length;
|
||||
public int length;
|
||||
/// <summary>0x34, file length in bytes, including wasted block space</summary>
|
||||
public Int32 wasted;
|
||||
public int wasted;
|
||||
/// <summary>0x38, unknown</summary>
|
||||
public byte[] tail;
|
||||
}
|
||||
|
||||
struct Extent
|
||||
{
|
||||
public Int32 start;
|
||||
public Int16 length;
|
||||
public int start;
|
||||
public short length;
|
||||
}
|
||||
|
||||
struct ExtentFile
|
||||
@@ -284,7 +284,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x20, unknown</summary>
|
||||
public ushort unknown1;
|
||||
/// <summary>0x22, 8 bytes</summary>
|
||||
public UInt64 file_uid;
|
||||
public ulong file_uid;
|
||||
/// <summary>0x2A, unknown</summary>
|
||||
public byte unknown2;
|
||||
/// <summary>0x2B, entry type? gets modified</summary>
|
||||
@@ -294,17 +294,17 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x2D, unknown</summary>
|
||||
public byte unknown3;
|
||||
/// <summary>0x2E, creation time</summary>
|
||||
public UInt32 dtc;
|
||||
public uint dtc;
|
||||
/// <summary>0x32, last access time</summary>
|
||||
public UInt32 dta;
|
||||
public uint dta;
|
||||
/// <summary>0x36, modification time</summary>
|
||||
public UInt32 dtm;
|
||||
public uint dtm;
|
||||
/// <summary>0x3A, backup time</summary>
|
||||
public UInt32 dtb;
|
||||
public uint dtb;
|
||||
/// <summary>0x3E, scavenge time</summary>
|
||||
public UInt32 dts;
|
||||
public uint dts;
|
||||
/// <summary>0x42, machine serial number</summary>
|
||||
public UInt32 serial;
|
||||
public uint serial;
|
||||
/// <summary>0x46, unknown</summary>
|
||||
public byte unknown4;
|
||||
/// <summary>0x47, locked file</summary>
|
||||
@@ -322,13 +322,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x4D, 11 bytes, unknown</summary>
|
||||
public byte[] unknown5;
|
||||
/// <summary>0x58, Release number</summary>
|
||||
public UInt16 release;
|
||||
public ushort release;
|
||||
/// <summary>0x5A, Build number</summary>
|
||||
public UInt16 build;
|
||||
public ushort build;
|
||||
/// <summary>0x5C, Compatibility level</summary>
|
||||
public UInt16 compatibility;
|
||||
public ushort compatibility;
|
||||
/// <summary>0x5E, Revision level</summary>
|
||||
public UInt16 revision;
|
||||
public ushort revision;
|
||||
/// <summary>0x60, unknown</summary>
|
||||
public ushort unknown6;
|
||||
/// <summary>0x62, 0x08 set if password is valid</summary>
|
||||
@@ -342,9 +342,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x70, 16 bytes, unknown</summary>
|
||||
public byte[] unknown8;
|
||||
/// <summary>0x80, 0x200 in v1, file length in blocks</summary>
|
||||
public Int32 length;
|
||||
public int length;
|
||||
/// <summary>0x84, 0x204 in v1, unknown</summary>
|
||||
public Int32 unknown9;
|
||||
public int unknown9;
|
||||
/// <summary>0x88, 0x208 in v1, extents, can contain up to 41 extents (85 in v1), dunno LisaOS maximum (never seen more than 3)</summary>
|
||||
public Extent[] extents;
|
||||
/// <summary>0x17E, unknown, empty, padding?</summary>
|
||||
@@ -356,13 +356,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
struct SRecord
|
||||
{
|
||||
/// <summary>0x00, block where ExtentsFile for this entry resides</summary>
|
||||
public UInt32 extent_ptr;
|
||||
public uint extent_ptr;
|
||||
/// <summary>0x04, unknown</summary>
|
||||
public UInt32 unknown;
|
||||
public uint unknown;
|
||||
/// <summary>0x08, filesize in bytes</summary>
|
||||
public UInt32 filesize;
|
||||
public uint filesize;
|
||||
/// <summary>0x0C, some kind of flags, meaning unknown</summary>
|
||||
public UInt16 flags;
|
||||
public ushort flags;
|
||||
}
|
||||
|
||||
struct CatalogEntryV2
|
||||
@@ -378,7 +378,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <summary>0x23, unknown</summary>
|
||||
public byte unknown2;
|
||||
/// <summary>0x24, unknown</summary>
|
||||
public Int16 fileID;
|
||||
public short fileID;
|
||||
/// <summary>0x26, 16 bytes, unknown</summary>
|
||||
public byte[] unknown3;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using System.CodeDom.Compiler;
|
||||
|
||||
namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
@@ -84,10 +83,10 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
devTagSize = device.ReadSectorTag(i, SectorTagType.AppleSectorTag).Length;
|
||||
|
||||
byte[] sector = device.ReadSector((ulong)i);
|
||||
byte[] sector = device.ReadSector(i);
|
||||
mddf = new MDDF();
|
||||
byte[] pString = new byte[33];
|
||||
UInt32 lisa_time;
|
||||
uint lisa_time;
|
||||
|
||||
mddf.fsversion = BigEndianBitConverter.ToUInt16(sector, 0x00);
|
||||
mddf.volid = BigEndianBitConverter.ToUInt64(sector, 0x02);
|
||||
@@ -297,7 +296,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
xmlFSType.FreeClustersSpecified = true;
|
||||
xmlFSType.Type = "LisaFS";
|
||||
xmlFSType.VolumeName = mddf.volname;
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X16}", mddf.volid);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X16}", mddf.volid);
|
||||
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using System.Configuration;
|
||||
using System.CodeDom.Compiler;
|
||||
|
||||
namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
@@ -43,7 +41,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
public override Errno ListXAttr(string path, ref List<string> xattrs)
|
||||
{
|
||||
Int16 fileId;
|
||||
short fileId;
|
||||
Errno error = LookupFileId(path, out fileId);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
@@ -53,7 +51,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
public override Errno GetXattr(string path, string xattr, ref byte[] buf)
|
||||
{
|
||||
Int16 fileId;
|
||||
short fileId;
|
||||
Errno error = LookupFileId(path, out fileId);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
@@ -61,7 +59,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return GetXattr(fileId, xattr, out buf);
|
||||
}
|
||||
|
||||
Errno ListXAttr(Int16 fileId, ref List<string> xattrs)
|
||||
Errno ListXAttr(short fileId, ref List<string> xattrs)
|
||||
{
|
||||
xattrs = null;
|
||||
|
||||
@@ -111,7 +109,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
Errno GetXattr(Int16 fileId, string xattr, out byte[] buf)
|
||||
Errno GetXattr(short fileId, string xattr, out byte[] buf)
|
||||
{
|
||||
buf = null;
|
||||
|
||||
|
||||
@@ -32,34 +32,33 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from the Linux kernel
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from the Linux kernel
|
||||
class MinixFS : Filesystem
|
||||
{
|
||||
const UInt16 MINIX_MAGIC = 0x137F;
|
||||
const ushort MINIX_MAGIC = 0x137F;
|
||||
// Minix v1, 14 char filenames
|
||||
const UInt16 MINIX_MAGIC2 = 0x138F;
|
||||
const ushort MINIX_MAGIC2 = 0x138F;
|
||||
// Minix v1, 30 char filenames
|
||||
const UInt16 MINIX2_MAGIC = 0x2468;
|
||||
const ushort MINIX2_MAGIC = 0x2468;
|
||||
// Minix v2, 14 char filenames
|
||||
const UInt16 MINIX2_MAGIC2 = 0x2478;
|
||||
const ushort MINIX2_MAGIC2 = 0x2478;
|
||||
// Minix v2, 30 char filenames
|
||||
const UInt16 MINIX3_MAGIC = 0x4D5A;
|
||||
const ushort MINIX3_MAGIC = 0x4D5A;
|
||||
// Minix v3, 60 char filenames
|
||||
// Byteswapped
|
||||
const UInt16 MINIX_CIGAM = 0x7F13;
|
||||
const ushort MINIX_CIGAM = 0x7F13;
|
||||
// Minix v1, 14 char filenames
|
||||
const UInt16 MINIX_CIGAM2 = 0x8F13;
|
||||
const ushort MINIX_CIGAM2 = 0x8F13;
|
||||
// Minix v1, 30 char filenames
|
||||
const UInt16 MINIX2_CIGAM = 0x6824;
|
||||
const ushort MINIX2_CIGAM = 0x6824;
|
||||
// Minix v2, 14 char filenames
|
||||
const UInt16 MINIX2_CIGAM2 = 0x7824;
|
||||
const ushort MINIX2_CIGAM2 = 0x7824;
|
||||
// Minix v2, 30 char filenames
|
||||
const UInt16 MINIX3_CIGAM = 0x5A4D;
|
||||
const ushort MINIX3_CIGAM = 0x5A4D;
|
||||
// Minix v3, 60 char filenames
|
||||
|
||||
public MinixFS()
|
||||
@@ -79,7 +78,7 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt16 magic;
|
||||
ushort magic;
|
||||
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partitionStart);
|
||||
|
||||
magic = BitConverter.ToUInt16(minix_sb_sector, 0x010); // Here should reside magic number on Minix V1 & V2
|
||||
@@ -103,7 +102,7 @@ namespace DiscImageChef.Filesystems
|
||||
bool minix3 = false;
|
||||
int filenamesize;
|
||||
string minixVersion;
|
||||
UInt16 magic;
|
||||
ushort magic;
|
||||
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partitionStart);
|
||||
|
||||
magic = BigEndianBitConverter.ToUInt16(minix_sb_sector, 0x018);
|
||||
@@ -252,25 +251,25 @@ namespace DiscImageChef.Filesystems
|
||||
public struct MinixSuperBlock
|
||||
{
|
||||
/// <summary>0x00, inodes on volume</summary>
|
||||
public UInt16 s_ninodes;
|
||||
public ushort s_ninodes;
|
||||
/// <summary>0x02, zones on volume</summary>
|
||||
public UInt16 s_nzones;
|
||||
public ushort s_nzones;
|
||||
/// <summary>0x04, blocks on inode map</summary>
|
||||
public UInt16 s_imap_blocks;
|
||||
public ushort s_imap_blocks;
|
||||
/// <summary>0x06, blocks on zone map</summary>
|
||||
public UInt16 s_zmap_blocks;
|
||||
public ushort s_zmap_blocks;
|
||||
/// <summary>0x08, first data zone</summary>
|
||||
public UInt16 s_firstdatazone;
|
||||
public ushort s_firstdatazone;
|
||||
/// <summary>0x0A, log2 of blocks/zone</summary>
|
||||
public UInt16 s_log_zone_size;
|
||||
public ushort s_log_zone_size;
|
||||
/// <summary>0x0C, max file size</summary>
|
||||
public UInt32 s_max_size;
|
||||
public uint s_max_size;
|
||||
/// <summary>0x10, magic</summary>
|
||||
public UInt16 s_magic;
|
||||
public ushort s_magic;
|
||||
/// <summary>0x12, filesystem state</summary>
|
||||
public UInt16 s_state;
|
||||
public ushort s_state;
|
||||
/// <summary>0x14, number of zones</summary>
|
||||
public UInt32 s_zones;
|
||||
public uint s_zones;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -279,29 +278,29 @@ namespace DiscImageChef.Filesystems
|
||||
public struct Minix3SuperBlock
|
||||
{
|
||||
/// <summary>0x00, inodes on volume</summary>
|
||||
public UInt32 s_ninodes;
|
||||
public uint s_ninodes;
|
||||
/// <summary>0x04, padding</summary>
|
||||
public UInt16 s_pad0;
|
||||
public ushort s_pad0;
|
||||
/// <summary>0x06, blocks on inode map</summary>
|
||||
public UInt16 s_imap_blocks;
|
||||
public ushort s_imap_blocks;
|
||||
/// <summary>0x08, blocks on zone map</summary>
|
||||
public UInt16 s_zmap_blocks;
|
||||
public ushort s_zmap_blocks;
|
||||
/// <summary>0x0A, first data zone</summary>
|
||||
public UInt16 s_firstdatazone;
|
||||
public ushort s_firstdatazone;
|
||||
/// <summary>0x0C, log2 of blocks/zone</summary>
|
||||
public UInt16 s_log_zone_size;
|
||||
public ushort s_log_zone_size;
|
||||
/// <summary>0x0E, padding</summary>
|
||||
public UInt16 s_pad1;
|
||||
public ushort s_pad1;
|
||||
/// <summary>0x10, max file size</summary>
|
||||
public UInt32 s_max_size;
|
||||
public uint s_max_size;
|
||||
/// <summary>0x14, number of zones</summary>
|
||||
public UInt32 s_zones;
|
||||
public uint s_zones;
|
||||
/// <summary>0x18, magic</summary>
|
||||
public UInt16 s_magic;
|
||||
public ushort s_magic;
|
||||
/// <summary>0x1A, padding</summary>
|
||||
public UInt16 s_pad2;
|
||||
public ushort s_pad2;
|
||||
/// <summary>0x1C, bytes in a block</summary>
|
||||
public UInt16 s_blocksize;
|
||||
public ushort s_blocksize;
|
||||
/// <summary>0x1E, on-disk structures version</summary>
|
||||
public byte s_disk_version;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] eigth_bytes = new byte[8];
|
||||
byte fats_no;
|
||||
UInt16 spfat, signature;
|
||||
ushort spfat, signature;
|
||||
string oem_name;
|
||||
|
||||
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partitionStart);
|
||||
@@ -165,7 +165,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
xmlFSType.ClusterSize = ntfs_bb.spc * ntfs_bb.bps;
|
||||
xmlFSType.Clusters = ntfs_bb.sectors / ntfs_bb.spc;
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X16}", ntfs_bb.serial_no);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X16}", ntfs_bb.serial_no);
|
||||
xmlFSType.Type = "NTFS";
|
||||
|
||||
information = sb.ToString();
|
||||
@@ -180,33 +180,33 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x000, Jump to boot code</summary>
|
||||
public byte jmp1;
|
||||
/// <summary>0x001, ...;</summary>
|
||||
public UInt16 jmp2;
|
||||
public ushort jmp2;
|
||||
/// <summary>0x003, OEM Name, 8 bytes, space-padded, must be "NTFS "</summary>
|
||||
public string OEMName;
|
||||
/// <summary>0x00B, Bytes per sector</summary>
|
||||
public UInt16 bps;
|
||||
public ushort bps;
|
||||
/// <summary>0x00D, Sectors per cluster</summary>
|
||||
public byte spc;
|
||||
/// <summary>0x00E, Reserved sectors, seems 0</summary>
|
||||
public UInt16 rsectors;
|
||||
public ushort rsectors;
|
||||
/// <summary>0x010, Number of FATs... obviously, 0</summary>
|
||||
public byte fats_no;
|
||||
/// <summary>0x011, Number of entries on root directory... 0</summary>
|
||||
public UInt16 root_ent;
|
||||
public ushort root_ent;
|
||||
/// <summary>0x013, Sectors in volume... 0</summary>
|
||||
public UInt16 sml_sectors;
|
||||
public ushort sml_sectors;
|
||||
/// <summary>0x015, Media descriptor</summary>
|
||||
public byte media;
|
||||
/// <summary>0x016, Sectors per FAT... 0</summary>
|
||||
public UInt16 spfat;
|
||||
public ushort spfat;
|
||||
/// <summary>0x018, Sectors per track, required to boot</summary>
|
||||
public UInt16 sptrk;
|
||||
public ushort sptrk;
|
||||
/// <summary>0x01A, Heads... required to boot</summary>
|
||||
public UInt16 heads;
|
||||
public ushort heads;
|
||||
/// <summary>0x01C, Hidden sectors before BPB</summary>
|
||||
public UInt32 hsectors;
|
||||
public uint hsectors;
|
||||
/// <summary>0x020, Sectors in volume if > 65535... 0</summary>
|
||||
public UInt32 big_sectors;
|
||||
public uint big_sectors;
|
||||
/// <summary>0x024, Drive number</summary>
|
||||
public byte drive_no;
|
||||
/// <summary>0x025, 0</summary>
|
||||
@@ -229,19 +229,19 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x041, Alignment</summary>
|
||||
public byte dummy2;
|
||||
/// <summary>0x042, Alignment</summary>
|
||||
public UInt16 dummy3;
|
||||
public ushort dummy3;
|
||||
/// <summary>0x044, Clusters per index block</summary>
|
||||
public sbyte index_blk_cts;
|
||||
/// <summary>0x045, Alignment</summary>
|
||||
public byte dummy4;
|
||||
/// <summary>0x046, Alignment</summary>
|
||||
public UInt16 dummy5;
|
||||
public ushort dummy5;
|
||||
/// <summary>0x048, Volume serial number</summary>
|
||||
public UInt64 serial_no;
|
||||
public ulong serial_no;
|
||||
// End of NTFS superblock, followed by 430 bytes of boot code
|
||||
|
||||
/// <summary>0x1FE, 0xAA55</summary>
|
||||
public UInt16 signature2;
|
||||
public ushort signature2;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -32,12 +32,8 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using System.Runtime.Remoting.Messaging;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
@@ -67,8 +63,8 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] header = imagePlugin.ReadSectors(0, (0x50000 / imagePlugin.GetSectorSize()));
|
||||
|
||||
UInt32 magicGC = BigEndianBitConverter.ToUInt32(header, 0x1C);
|
||||
UInt32 magicWii = BigEndianBitConverter.ToUInt32(header, 0x18);
|
||||
uint magicGC = BigEndianBitConverter.ToUInt32(header, 0x1C);
|
||||
uint magicWii = BigEndianBitConverter.ToUInt32(header, 0x18);
|
||||
|
||||
if(magicGC == 0xC2339F3D || magicWii == 0x5D1C9EA3)
|
||||
return true;
|
||||
@@ -89,8 +85,8 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
bool wii = false;
|
||||
|
||||
UInt32 magicGC = BigEndianBitConverter.ToUInt32(header, 0x1C);
|
||||
UInt32 magicWii = BigEndianBitConverter.ToUInt32(header, 0x18);
|
||||
uint magicGC = BigEndianBitConverter.ToUInt32(header, 0x1C);
|
||||
uint magicWii = BigEndianBitConverter.ToUInt32(header, 0x18);
|
||||
|
||||
if(magicGC == 0xC2339F3D)
|
||||
wii = false;
|
||||
|
||||
@@ -32,20 +32,19 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from VMS File System Internals by Kirby McCoy
|
||||
// ISBN: 1-55558-056-4
|
||||
// With some hints from http://www.decuslib.com/DECUS/vmslt97b/gnusoftware/gccaxp/7_1/vms/hm2def.h
|
||||
// Expects the home block to be always in sector #1 (does not check deltas)
|
||||
// Assumes a sector size of 512 bytes (VMS does on HDDs and optical drives, dunno about M.O.)
|
||||
// Book only describes ODS-2. Need to test ODS-1 and ODS-5
|
||||
// There is an ODS with signature "DECFILES11A", yet to be seen
|
||||
// Time is a 64 bit unsigned integer, tenths of microseconds since 1858/11/17 00:00:00.
|
||||
// TODO: Implement checksum
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from VMS File System Internals by Kirby McCoy
|
||||
// ISBN: 1-55558-056-4
|
||||
// With some hints from http://www.decuslib.com/DECUS/vmslt97b/gnusoftware/gccaxp/7_1/vms/hm2def.h
|
||||
// Expects the home block to be always in sector #1 (does not check deltas)
|
||||
// Assumes a sector size of 512 bytes (VMS does on HDDs and optical drives, dunno about M.O.)
|
||||
// Book only describes ODS-2. Need to test ODS-1 and ODS-5
|
||||
// There is an ODS with signature "DECFILES11A", yet to be seen
|
||||
// Time is a 64 bit unsigned integer, tenths of microseconds since 1858/11/17 00:00:00.
|
||||
// TODO: Implement checksum
|
||||
class ODS : Filesystem
|
||||
{
|
||||
public ODS()
|
||||
@@ -264,7 +263,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.ClusterSize = homeblock.cluster * 512;
|
||||
xmlFSType.Clusters = homeblock.cluster;
|
||||
xmlFSType.VolumeName = homeblock.volname;
|
||||
xmlFSType.VolumeSerial = String.Format("{0:X8}", homeblock.serialnum);
|
||||
xmlFSType.VolumeSerial = string.Format("{0:X8}", homeblock.serialnum);
|
||||
if(homeblock.credate > 0)
|
||||
{
|
||||
xmlFSType.CreationDate = DateHandlers.VMSToDateTime(homeblock.credate);
|
||||
@@ -282,85 +281,85 @@ namespace DiscImageChef.Filesystems
|
||||
struct ODSHomeBlock
|
||||
{
|
||||
/// <summary>0x000, LBN of THIS home block</summary>
|
||||
public UInt32 homelbn;
|
||||
public uint homelbn;
|
||||
/// <summary>0x004, LBN of the secondary home block</summary>
|
||||
public UInt32 alhomelbn;
|
||||
public uint alhomelbn;
|
||||
/// <summary>0x008, LBN of backup INDEXF.SYS;1</summary>
|
||||
public UInt32 altidxlbn;
|
||||
public uint altidxlbn;
|
||||
/// <summary>0x00C, High byte contains filesystem version (1, 2 or 5), low byte contains revision (1)</summary>
|
||||
public UInt16 struclev;
|
||||
public ushort struclev;
|
||||
/// <summary>0x00E, Number of blocks each bit of the volume bitmap represents</summary>
|
||||
public UInt16 cluster;
|
||||
public ushort cluster;
|
||||
/// <summary>0x010, VBN of THIS home block</summary>
|
||||
public UInt16 homevbn;
|
||||
public ushort homevbn;
|
||||
/// <summary>0x012, VBN of the secondary home block</summary>
|
||||
public UInt16 alhomevbn;
|
||||
public ushort alhomevbn;
|
||||
/// <summary>0x014, VBN of backup INDEXF.SYS;1</summary>
|
||||
public UInt16 altidxvbn;
|
||||
public ushort altidxvbn;
|
||||
/// <summary>0x016, VBN of the bitmap</summary>
|
||||
public UInt16 ibmapvbn;
|
||||
public ushort ibmapvbn;
|
||||
/// <summary>0x018, LBN of the bitmap</summary>
|
||||
public UInt32 ibmaplbn;
|
||||
public uint ibmaplbn;
|
||||
/// <summary>0x01C, Max files on volume</summary>
|
||||
public UInt32 maxfiles;
|
||||
public uint maxfiles;
|
||||
/// <summary>0x020, Bitmap size in sectors</summary>
|
||||
public UInt16 ibmapsize;
|
||||
public ushort ibmapsize;
|
||||
/// <summary>0x022, Reserved files, 5 at minimum</summary>
|
||||
public UInt16 resfiles;
|
||||
public ushort resfiles;
|
||||
/// <summary>0x024, Device type, ODS-2 defines it as always 0</summary>
|
||||
public UInt16 devtype;
|
||||
public ushort devtype;
|
||||
/// <summary>0x026, Relative volume number (number of the volume in a set)</summary>
|
||||
public UInt16 rvn;
|
||||
public ushort rvn;
|
||||
/// <summary>0x028, Total number of volumes in the set this volume is</summary>
|
||||
public UInt16 setcount;
|
||||
public ushort setcount;
|
||||
/// <summary>0x02A, Flags</summary>
|
||||
public UInt16 volchar;
|
||||
public ushort volchar;
|
||||
/// <summary>0x02C, User ID of the volume owner</summary>
|
||||
public UInt32 volowner;
|
||||
public uint volowner;
|
||||
/// <summary>0x030, Security mask (??)</summary>
|
||||
public UInt32 sec_mask;
|
||||
public uint sec_mask;
|
||||
/// <summary>0x034, Volume permissions (system, owner, group and other)</summary>
|
||||
public UInt16 protect;
|
||||
public ushort protect;
|
||||
/// <summary>0x036, Default file protection, unsupported in ODS-2</summary>
|
||||
public UInt16 fileprot;
|
||||
public ushort fileprot;
|
||||
/// <summary>0x038, Default file record protection</summary>
|
||||
public UInt16 recprot;
|
||||
public ushort recprot;
|
||||
/// <summary>0x03A, Checksum of all preceding entries</summary>
|
||||
public UInt16 checksum1;
|
||||
public ushort checksum1;
|
||||
/// <summary>0x03C, Creation date</summary>
|
||||
public UInt64 credate;
|
||||
public ulong credate;
|
||||
/// <summary>0x044, Window size (pointers for the window)</summary>
|
||||
public byte window;
|
||||
/// <summary>0x045, Directories to be stored in cache</summary>
|
||||
public byte lru_lim;
|
||||
/// <summary>0x046, Default allocation size in blocks</summary>
|
||||
public UInt16 extend;
|
||||
public ushort extend;
|
||||
/// <summary>0x048, Minimum file retention period</summary>
|
||||
public UInt64 retainmin;
|
||||
public ulong retainmin;
|
||||
/// <summary>0x050, Maximum file retention period</summary>
|
||||
public UInt64 retainmax;
|
||||
public ulong retainmax;
|
||||
/// <summary>0x058, Last modification date</summary>
|
||||
public UInt64 revdate;
|
||||
public ulong revdate;
|
||||
/// <summary>0x060, Minimum security class, 20 bytes</summary>
|
||||
public byte[] min_class;
|
||||
/// <summary>0x074, Maximum security class, 20 bytes</summary>
|
||||
public byte[] max_class;
|
||||
/// <summary>0x088, File lookup table FID</summary>
|
||||
public UInt16 filetab_fid1;
|
||||
public ushort filetab_fid1;
|
||||
/// <summary>0x08A, File lookup table FID</summary>
|
||||
public UInt16 filetab_fid2;
|
||||
public ushort filetab_fid2;
|
||||
/// <summary>0x08C, File lookup table FID</summary>
|
||||
public UInt16 filetab_fid3;
|
||||
public ushort filetab_fid3;
|
||||
/// <summary>0x08E, Lowest structure level on the volume</summary>
|
||||
public UInt16 lowstruclev;
|
||||
public ushort lowstruclev;
|
||||
/// <summary>0x090, Highest structure level on the volume</summary>
|
||||
public UInt16 highstruclev;
|
||||
public ushort highstruclev;
|
||||
/// <summary>0x092, Volume copy date (??)</summary>
|
||||
public UInt64 copydate;
|
||||
public ulong copydate;
|
||||
/// <summary>0x09A, 302 bytes</summary>
|
||||
public byte[] reserved1;
|
||||
/// <summary>0x1C8, Physical drive serial number</summary>
|
||||
public UInt32 serialnum;
|
||||
public uint serialnum;
|
||||
/// <summary>0x1CC, Name of the volume set, 12 bytes</summary>
|
||||
public string strucname;
|
||||
/// <summary>0x1D8, Volume label, 12 bytes</summary>
|
||||
@@ -370,9 +369,9 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x1F0, ODS-2 defines it as "DECFILE11B", 12 bytes</summary>
|
||||
public string format;
|
||||
/// <summary>0x1FC, Reserved</summary>
|
||||
public UInt16 reserved2;
|
||||
public ushort reserved2;
|
||||
/// <summary>0x1FE, Checksum of preceding 255 words (16 bit units)</summary>
|
||||
public UInt16 checksum2;
|
||||
public ushort checksum2;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
@@ -154,19 +153,19 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x028, 32 bytes, volume label</summary>
|
||||
public string volume_label;
|
||||
/// <summary>0x048, Volume ID</summary>
|
||||
public Int32 volume_id;
|
||||
public int volume_id;
|
||||
/// <summary>0x04C, Block size in bytes</summary>
|
||||
public Int32 block_size;
|
||||
public int block_size;
|
||||
/// <summary>0x050, Blocks in volume</summary>
|
||||
public Int32 block_count;
|
||||
public int block_count;
|
||||
/// <summary>0x054, Root directory ID</summary>
|
||||
public Int32 root_dirid;
|
||||
public int root_dirid;
|
||||
/// <summary>0x058, Root directory blocks</summary>
|
||||
public Int32 rootdir_blocks;
|
||||
public int rootdir_blocks;
|
||||
/// <summary>0x05C, Root directory block size</summary>
|
||||
public Int32 rootdir_bsize;
|
||||
public int rootdir_bsize;
|
||||
/// <summary>0x060, Last root directory copy</summary>
|
||||
public Int32 last_root_copy;
|
||||
public int last_root_copy;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -32,7 +32,6 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
|
||||
@@ -32,15 +32,12 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from Apple ProDOS 8 Technical Reference
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from Apple ProDOS 8 Technical Reference
|
||||
public class ProDOSPlugin : Filesystem
|
||||
{
|
||||
const byte EmptyStorageType = 0x00;
|
||||
@@ -63,11 +60,11 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
const byte ProDOSVersion1 = 0x00;
|
||||
|
||||
const UInt32 ProDOSYearMask = 0xFE000000;
|
||||
const UInt32 ProDOSMonthMask = 0x1E00000;
|
||||
const UInt32 ProDOSDayMask = 0x1F0000;
|
||||
const UInt32 ProDOSHourMask = 0x1F00;
|
||||
const UInt32 ProDOSMinuteMask = 0x3F;
|
||||
const uint ProDOSYearMask = 0xFE000000;
|
||||
const uint ProDOSMonthMask = 0x1E00000;
|
||||
const uint ProDOSDayMask = 0x1F0000;
|
||||
const uint ProDOSHourMask = 0x1F00;
|
||||
const uint ProDOSMinuteMask = 0x3F;
|
||||
|
||||
const byte ProDOSDestroyAttribute = 0x80;
|
||||
const byte ProDOSRenameAttribute = 0x40;
|
||||
@@ -101,7 +98,7 @@ namespace DiscImageChef.Filesystems
|
||||
// Blocks 0 and 1 are boot code
|
||||
byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partitionStart);
|
||||
|
||||
UInt16 prePointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0);
|
||||
ushort prePointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0);
|
||||
if(prePointer != 0)
|
||||
return false;
|
||||
|
||||
@@ -117,11 +114,11 @@ namespace DiscImageChef.Filesystems
|
||||
if(entries_per_block != ProDOSEntriesPerBlock)
|
||||
return false;
|
||||
|
||||
UInt16 bit_map_pointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x27);
|
||||
ushort bit_map_pointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x27);
|
||||
if(bit_map_pointer > imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt16 total_blocks = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x29);
|
||||
ushort total_blocks = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x29);
|
||||
return total_blocks <= imagePlugin.GetSectors();
|
||||
}
|
||||
|
||||
@@ -137,8 +134,8 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] temporal;
|
||||
int year, month, day, hour, minute;
|
||||
UInt16 temp_timestamp_left, temp_timestamp_right;
|
||||
UInt32 temp_timestamp;
|
||||
ushort temp_timestamp_left, temp_timestamp_right;
|
||||
uint temp_timestamp;
|
||||
|
||||
rootDirectoryKeyBlock.zero = BitConverter.ToUInt16(rootDirectoryKeyBlockBytes, 0x00);
|
||||
rootDirectoryKeyBlock.next_pointer = BitConverter.ToUInt16(rootDirectoryKeyBlockBytes, 0x02);
|
||||
@@ -325,17 +322,17 @@ namespace DiscImageChef.Filesystems
|
||||
/// Block address of block for seedling files.
|
||||
/// Offset 0x11, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 key_pointer;
|
||||
public ushort key_pointer;
|
||||
/// <summary>
|
||||
/// Blocks used by file or directory, including index blocks.
|
||||
/// Offset 0x13, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 blocks_used;
|
||||
public ushort blocks_used;
|
||||
/// <summary>
|
||||
/// Size of file in bytes
|
||||
/// Offset 0x15, 3 bytes
|
||||
/// </summary>
|
||||
public UInt32 EOF;
|
||||
public uint EOF;
|
||||
/// <summary>
|
||||
/// File creation datetime
|
||||
/// Offset 0x18, 4 bytes
|
||||
@@ -360,7 +357,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// General purpose field to store additional information about file format
|
||||
/// Offset 0x1F, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 aux_type;
|
||||
public ushort aux_type;
|
||||
/// <summary>
|
||||
/// File last modification date time
|
||||
/// Offset 0x21, 4 bytes
|
||||
@@ -370,7 +367,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// Block address pointer to key block of the directory containing this entry
|
||||
/// Offset 0x25, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 header_pointer;
|
||||
public ushort header_pointer;
|
||||
}
|
||||
|
||||
struct ProDOSRootDirectoryHeader
|
||||
@@ -394,7 +391,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// Reserved for future expansion
|
||||
/// Offset 0x14, 8 bytes
|
||||
/// </summary>
|
||||
public UInt64 reserved;
|
||||
public ulong reserved;
|
||||
/// <summary>
|
||||
/// Creation time of the volume
|
||||
/// Offset 0x1C, 4 bytes
|
||||
@@ -431,18 +428,18 @@ namespace DiscImageChef.Filesystems
|
||||
/// Number of active files in this directory
|
||||
/// Offset 0x25, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 file_count;
|
||||
public ushort file_count;
|
||||
/// <summary>
|
||||
/// Block address of the first block of the volume's bitmap,
|
||||
/// one for every 4096 blocks or fraction
|
||||
/// Offset 0x27, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 bit_map_pointer;
|
||||
public ushort bit_map_pointer;
|
||||
/// <summary>
|
||||
/// Total number of blocks in the volume
|
||||
/// Offset 0x29, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 total_blocks;
|
||||
public ushort total_blocks;
|
||||
}
|
||||
|
||||
struct ProDOSDirectoryHeader
|
||||
@@ -466,7 +463,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// Reserved for future expansion
|
||||
/// Offset 0x14, 8 bytes
|
||||
/// </summary>
|
||||
public UInt64 reserved;
|
||||
public ulong reserved;
|
||||
/// <summary>
|
||||
/// Creation time of the volume
|
||||
/// Offset 0x1C, 4 bytes
|
||||
@@ -503,12 +500,12 @@ namespace DiscImageChef.Filesystems
|
||||
/// Number of active files in this directory
|
||||
/// Offset 0x25, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 file_count;
|
||||
public ushort file_count;
|
||||
/// <summary>
|
||||
/// Block address of parent directory block that contains this entry
|
||||
/// Offset 0x27, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 parent_pointer;
|
||||
public ushort parent_pointer;
|
||||
/// <summary>
|
||||
/// Entry number within the block indicated in parent_pointer
|
||||
/// Offset 0x29, 1 byte
|
||||
@@ -528,12 +525,12 @@ namespace DiscImageChef.Filesystems
|
||||
/// Always 0
|
||||
/// Offset 0x00, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 zero;
|
||||
public ushort zero;
|
||||
/// <summary>
|
||||
/// Pointer to next directory block, 0 if last
|
||||
/// Offset 0x02, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 next_pointer;
|
||||
public ushort next_pointer;
|
||||
/// <summary>
|
||||
/// Directory header
|
||||
/// Offset 0x04, 39 bytes
|
||||
@@ -552,12 +549,12 @@ namespace DiscImageChef.Filesystems
|
||||
/// Always 0
|
||||
/// Offset 0x00, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 zero;
|
||||
public ushort zero;
|
||||
/// <summary>
|
||||
/// Pointer to next directory block, 0 if last
|
||||
/// Offset 0x02, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 next_pointer;
|
||||
public ushort next_pointer;
|
||||
/// <summary>
|
||||
/// Directory header
|
||||
/// Offset 0x04, 39 bytes
|
||||
@@ -576,12 +573,12 @@ namespace DiscImageChef.Filesystems
|
||||
/// Pointer to previous directory block
|
||||
/// Offset 0x00, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 zero;
|
||||
public ushort zero;
|
||||
/// <summary>
|
||||
/// Pointer to next directory block, 0 if last
|
||||
/// Offset 0x02, 2 bytes
|
||||
/// </summary>
|
||||
public UInt16 next_pointer;
|
||||
public ushort next_pointer;
|
||||
/// <summary>
|
||||
/// Directory entries
|
||||
/// Offset 0x2F, 39 bytes each, 13 entries
|
||||
@@ -594,7 +591,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// Up to 256 pointers to blocks, 0 to indicate the block is sparsed (non-allocated)
|
||||
/// </summary>
|
||||
public UInt16[] block_pointer;
|
||||
public ushort[] block_pointer;
|
||||
}
|
||||
|
||||
struct ProDOSMasterIndexBlock
|
||||
@@ -602,7 +599,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// Up to 128 pointers to index blocks
|
||||
/// </summary>
|
||||
public UInt16[] index_block_pointer;
|
||||
public ushort[] index_block_pointer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,15 +32,12 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Based on FAT's BPB, cannot find a FAT or directory
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Based on FAT's BPB, cannot find a FAT or directory
|
||||
class SolarFS : Filesystem
|
||||
{
|
||||
public SolarFS()
|
||||
@@ -166,29 +163,29 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x03, 8 bytes, "SOLAR_OS"</summary>
|
||||
public string OEMName;
|
||||
/// <summary>0x0B, Bytes per sector</summary>
|
||||
public UInt16 bps;
|
||||
public ushort bps;
|
||||
/// <summary>0x0D, unknown, 0x01</summary>
|
||||
public byte unk1;
|
||||
/// <summary>0x0E, unknown, 0x0201</summary>
|
||||
public UInt16 unk2;
|
||||
public ushort unk2;
|
||||
/// <summary>0x10, Number of entries on root directory ? (no root directory found)</summary>
|
||||
public UInt16 root_ent;
|
||||
public ushort root_ent;
|
||||
/// <summary>0x12, Sectors in volume</summary>
|
||||
public UInt16 sectors;
|
||||
public ushort sectors;
|
||||
/// <summary>0x14, Media descriptor</summary>
|
||||
public byte media;
|
||||
/// <summary>0x15, Sectors per FAT ? (no FAT found)</summary>
|
||||
public UInt16 spfat;
|
||||
public ushort spfat;
|
||||
/// <summary>0x17, Sectors per track</summary>
|
||||
public UInt16 sptrk;
|
||||
public ushort sptrk;
|
||||
/// <summary>0x19, Heads</summary>
|
||||
public UInt16 heads;
|
||||
public ushort heads;
|
||||
/// <summary>0x1B, unknown, 10 bytes, zero-filled</summary>
|
||||
public byte[] unk3;
|
||||
/// <summary>0x25, 0x29</summary>
|
||||
public byte signature;
|
||||
/// <summary>0x26, unknown, zero-filled</summary>
|
||||
public UInt32 unk4;
|
||||
public uint unk4;
|
||||
/// <summary>0x2A, 11 bytes, volume name, space-padded</summary>
|
||||
public string vol_name;
|
||||
/// <summary>0x35, 8 bytes, "SOL_FS "</summary>
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Security.Policy;
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
@@ -235,9 +234,9 @@ namespace DiscImageChef.Filesystems
|
||||
public bool IsGuid;
|
||||
|
||||
[FieldOffset(3)]
|
||||
public UInt32 Serial32;
|
||||
public uint Serial32;
|
||||
[FieldOffset(3)]
|
||||
public UInt64 Serial64;
|
||||
public ulong Serial64;
|
||||
[FieldOffset(3)]
|
||||
public Guid uuid;
|
||||
}
|
||||
|
||||
@@ -45,24 +45,24 @@ namespace DiscImageChef.Plugins
|
||||
class SymbianIS : Plugin
|
||||
{
|
||||
// Magics
|
||||
private const UInt32 SymbianMagic = 0x10000419;
|
||||
private const UInt32 EPOCMagic = 0x1000006D;
|
||||
private const UInt32 EPOC6Magic = 0x10003A12;
|
||||
private const UInt32 Symbian9Magic = 0x10201A7A;
|
||||
private const uint SymbianMagic = 0x10000419;
|
||||
private const uint EPOCMagic = 0x1000006D;
|
||||
private const uint EPOC6Magic = 0x10003A12;
|
||||
private const uint Symbian9Magic = 0x10201A7A;
|
||||
|
||||
// Options
|
||||
private const UInt16 IsUnicode = 0x0001;
|
||||
private const UInt16 IsDistributable = 0x0002;
|
||||
private const UInt16 NoCompress = 0x0008;
|
||||
private const UInt16 ShutdownApps = 0x0010;
|
||||
private const ushort IsUnicode = 0x0001;
|
||||
private const ushort IsDistributable = 0x0002;
|
||||
private const ushort NoCompress = 0x0008;
|
||||
private const ushort ShutdownApps = 0x0010;
|
||||
|
||||
// Types
|
||||
private const UInt16 SISApp = 0x0000; // Application
|
||||
private const UInt16 SISSystem = 0x0001; // System component (library)
|
||||
private const UInt16 SISOption = 0x0002; // Optional component
|
||||
private const UInt16 SISConfig = 0x0003; // Configures an application
|
||||
private const UInt16 SISPatch = 0x0004; // Patch
|
||||
private const UInt16 SISUpgrade = 0x0005; // Upgrade
|
||||
private const ushort SISApp = 0x0000; // Application
|
||||
private const ushort SISSystem = 0x0001; // System component (library)
|
||||
private const ushort SISOption = 0x0002; // Optional component
|
||||
private const ushort SISConfig = 0x0003; // Configures an application
|
||||
private const ushort SISPatch = 0x0004; // Patch
|
||||
private const ushort SISUpgrade = 0x0005; // Upgrade
|
||||
|
||||
private enum LanguageCodes
|
||||
{
|
||||
@@ -173,14 +173,14 @@ namespace DiscImageChef.Plugins
|
||||
|
||||
public override bool Identify(FileStream fileStream, long offset)
|
||||
{
|
||||
UInt32 uid1, uid2, uid3;
|
||||
uint uid1, uid2, uid3;
|
||||
BinaryReader br = new BinaryReader(fileStream);
|
||||
|
||||
br.BaseStream.Seek(0 + offset, SeekOrigin.Begin);
|
||||
|
||||
uid1 = br.ReadUInt32();
|
||||
uid2 = br.ReadUInt32();
|
||||
uid3 = br.ReadUInt32();
|
||||
uid1 = br.Readuint();
|
||||
uid2 = br.Readuint();
|
||||
uid3 = br.Readuint();
|
||||
|
||||
if(uid1 == Symbian9Magic)
|
||||
return true;
|
||||
@@ -200,10 +200,10 @@ namespace DiscImageChef.Plugins
|
||||
information = "";
|
||||
StringBuilder description = new StringBuilder();
|
||||
List<string> languages = new List<string>();
|
||||
Dictionary<UInt32, UInt32> capabilities = new Dictionary<UInt32, UInt32>();
|
||||
Dictionary<uint, uint> capabilities = new Dictionary<uint, uint>();
|
||||
int ENpos = 0;
|
||||
UInt32 comp_len;
|
||||
UInt32 comp_name_ptr;
|
||||
uint comp_len;
|
||||
uint comp_name_ptr;
|
||||
byte[] ComponentName_b;
|
||||
string ComponentName = "";
|
||||
|
||||
@@ -212,41 +212,41 @@ namespace DiscImageChef.Plugins
|
||||
|
||||
br.BaseStream.Seek(0 + offset, SeekOrigin.Begin);
|
||||
|
||||
sh.uid1 = br.ReadUInt32();
|
||||
sh.uid2 = br.ReadUInt32();
|
||||
sh.uid3 = br.ReadUInt32();
|
||||
sh.uid4 = br.ReadUInt32();
|
||||
sh.crc16 = br.ReadUInt16();
|
||||
sh.languages = br.ReadUInt16();
|
||||
sh.files = br.ReadUInt16();
|
||||
sh.requisites = br.ReadUInt16();
|
||||
sh.inst_lang = br.ReadUInt16();
|
||||
sh.inst_files = br.ReadUInt16();
|
||||
sh.inst_drive = br.ReadUInt16();
|
||||
sh.capabilities = br.ReadUInt16();
|
||||
sh.inst_version = br.ReadUInt32();
|
||||
sh.options = br.ReadUInt16();
|
||||
sh.type = br.ReadUInt16();
|
||||
sh.major = br.ReadUInt16();
|
||||
sh.minor = br.ReadUInt16();
|
||||
sh.variant = br.ReadUInt32();
|
||||
sh.lang_ptr = br.ReadUInt32();
|
||||
sh.files_ptr = br.ReadUInt32();
|
||||
sh.reqs_ptr = br.ReadUInt32();
|
||||
sh.certs_ptr = br.ReadUInt32();
|
||||
sh.comp_ptr = br.ReadUInt32();
|
||||
sh.sig_ptr = br.ReadUInt32();
|
||||
sh.caps_ptr = br.ReadUInt32();
|
||||
sh.instspace = br.ReadUInt32();
|
||||
sh.maxinsspc = br.ReadUInt32();
|
||||
sh.reserved1 = br.ReadUInt64();
|
||||
sh.reserved2 = br.ReadUInt64();
|
||||
sh.uid1 = br.Readuint();
|
||||
sh.uid2 = br.Readuint();
|
||||
sh.uid3 = br.Readuint();
|
||||
sh.uid4 = br.Readuint();
|
||||
sh.crc16 = br.Readushort();
|
||||
sh.languages = br.Readushort();
|
||||
sh.files = br.Readushort();
|
||||
sh.requisites = br.Readushort();
|
||||
sh.inst_lang = br.Readushort();
|
||||
sh.inst_files = br.Readushort();
|
||||
sh.inst_drive = br.Readushort();
|
||||
sh.capabilities = br.Readushort();
|
||||
sh.inst_version = br.Readuint();
|
||||
sh.options = br.Readushort();
|
||||
sh.type = br.Readushort();
|
||||
sh.major = br.Readushort();
|
||||
sh.minor = br.Readushort();
|
||||
sh.variant = br.Readuint();
|
||||
sh.lang_ptr = br.Readuint();
|
||||
sh.files_ptr = br.Readuint();
|
||||
sh.reqs_ptr = br.Readuint();
|
||||
sh.certs_ptr = br.Readuint();
|
||||
sh.comp_ptr = br.Readuint();
|
||||
sh.sig_ptr = br.Readuint();
|
||||
sh.caps_ptr = br.Readuint();
|
||||
sh.instspace = br.Readuint();
|
||||
sh.maxinsspc = br.Readuint();
|
||||
sh.reserved1 = br.Readulong();
|
||||
sh.reserved2 = br.Readulong();
|
||||
|
||||
// Go to enumerate languages
|
||||
br.BaseStream.Seek(sh.lang_ptr + offset, SeekOrigin.Begin);
|
||||
for(int i = 0; i < sh.languages; i++)
|
||||
{
|
||||
UInt16 language = br.ReadUInt16();
|
||||
ushort language = br.Readushort();
|
||||
if(language == 0x0001)
|
||||
ENpos = i;
|
||||
languages.Add(((LanguageCodes)language).ToString("G"));
|
||||
@@ -256,8 +256,8 @@ namespace DiscImageChef.Plugins
|
||||
br.BaseStream.Seek(sh.comp_ptr + offset, SeekOrigin.Begin);
|
||||
for(int i = 0; i < sh.languages; i++)
|
||||
{
|
||||
comp_len = br.ReadUInt32();
|
||||
comp_name_ptr = br.ReadUInt32();
|
||||
comp_len = br.Readuint();
|
||||
comp_name_ptr = br.Readuint();
|
||||
if(i == ENpos)
|
||||
{
|
||||
br.BaseStream.Seek(comp_name_ptr + offset, SeekOrigin.Begin);
|
||||
@@ -272,8 +272,8 @@ namespace DiscImageChef.Plugins
|
||||
br.BaseStream.Seek(sh.caps_ptr + offset, SeekOrigin.Begin);
|
||||
for(int i = 0; i < sh.capabilities; i++)
|
||||
{
|
||||
UInt32 cap_key = br.ReadUInt32();
|
||||
UInt32 cap_value = br.ReadUInt32();
|
||||
uint cap_key = br.Readuint();
|
||||
uint cap_value = br.Readuint();
|
||||
capabilities.Add(cap_key, cap_value);
|
||||
}
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace DiscImageChef.Plugins
|
||||
description.AppendFormat("File contains {0} files (pointer: {1})", sh.files, sh.files_ptr).AppendLine();
|
||||
description.AppendFormat("File contains {0} requisites", sh.requisites).AppendLine();
|
||||
// description.AppendLine("Capabilities:");
|
||||
// foreach(KeyValuePair<UInt32, UInt32> kvp in capabilities)
|
||||
// foreach(KeyValuePair<uint, uint> kvp in capabilities)
|
||||
// description.AppendFormat("{0} = {1}", kvp.Key, kvp.Value).AppendLine();
|
||||
}
|
||||
|
||||
@@ -330,36 +330,36 @@ namespace DiscImageChef.Plugins
|
||||
|
||||
private struct SymbianHeader
|
||||
{
|
||||
public UInt32 uid1; // Application UID before SymbianOS 9, magic after
|
||||
public UInt32 uid2; // EPOC release magic before SOS 9, NULLs after
|
||||
public UInt32 uid3; // Application UID after SOS 9, magic before
|
||||
public UInt32 uid4; // Checksum of UIDs 1 to 3
|
||||
public UInt16 crc16; // CRC16 of all header
|
||||
public UInt16 languages; // Number of languages
|
||||
public UInt16 files; // Number of files
|
||||
public UInt16 requisites; // Number of requisites
|
||||
public UInt16 inst_lang; // Installed language (only residual SIS)
|
||||
public UInt16 inst_files; // Installed files (only residual SIS)
|
||||
public UInt16 inst_drive; // Installed drive (only residual SIS), NULL or 0x0021
|
||||
public UInt16 capabilities; // Number of capabilities
|
||||
public UInt32 inst_version; // Version of Symbian Installer required
|
||||
public UInt16 options; // Option flags
|
||||
public UInt16 type; // Type
|
||||
public UInt16 major; // Major version of application
|
||||
public UInt16 minor; // Minor version of application
|
||||
public UInt32 variant; // Variant when SIS is a prerequisite for other SISs
|
||||
public UInt32 lang_ptr; // Pointer to language records
|
||||
public UInt32 files_ptr; // Pointer to file records
|
||||
public UInt32 reqs_ptr; // Pointer to requisite records
|
||||
public UInt32 certs_ptr; // Pointer to certificate records
|
||||
public UInt32 comp_ptr; // Pointer to component name record
|
||||
public uint uid1; // Application UID before SymbianOS 9, magic after
|
||||
public uint uid2; // EPOC release magic before SOS 9, NULLs after
|
||||
public uint uid3; // Application UID after SOS 9, magic before
|
||||
public uint uid4; // Checksum of UIDs 1 to 3
|
||||
public ushort crc16; // CRC16 of all header
|
||||
public ushort languages; // Number of languages
|
||||
public ushort files; // Number of files
|
||||
public ushort requisites; // Number of requisites
|
||||
public ushort inst_lang; // Installed language (only residual SIS)
|
||||
public ushort inst_files; // Installed files (only residual SIS)
|
||||
public ushort inst_drive; // Installed drive (only residual SIS), NULL or 0x0021
|
||||
public ushort capabilities; // Number of capabilities
|
||||
public uint inst_version; // Version of Symbian Installer required
|
||||
public ushort options; // Option flags
|
||||
public ushort type; // Type
|
||||
public ushort major; // Major version of application
|
||||
public ushort minor; // Minor version of application
|
||||
public uint variant; // Variant when SIS is a prerequisite for other SISs
|
||||
public uint lang_ptr; // Pointer to language records
|
||||
public uint files_ptr; // Pointer to file records
|
||||
public uint reqs_ptr; // Pointer to requisite records
|
||||
public uint certs_ptr; // Pointer to certificate records
|
||||
public uint comp_ptr; // Pointer to component name record
|
||||
// From EPOC Release 6
|
||||
public UInt32 sig_ptr; // Pointer to signature record
|
||||
public UInt32 caps_ptr; // Pointer to capability records
|
||||
public UInt32 instspace; // Installed space (only residual SIS)
|
||||
public UInt32 maxinsspc; // Space required
|
||||
public UInt64 reserved1; // Reserved
|
||||
public UInt64 reserved2; // Reserved
|
||||
public uint sig_ptr; // Pointer to signature record
|
||||
public uint caps_ptr; // Pointer to capability records
|
||||
public uint instspace; // Installed space (only residual SIS)
|
||||
public uint maxinsspc; // Space required
|
||||
public ulong reserved1; // Reserved
|
||||
public ulong reserved2; // Reserved
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,28 +32,27 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from the Linux kernel
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from the Linux kernel
|
||||
class SysVfs : Filesystem
|
||||
{
|
||||
const UInt32 XENIX_MAGIC = 0x002B5544;
|
||||
const UInt32 XENIX_CIGAM = 0x44552B00;
|
||||
const UInt32 SYSV_MAGIC = 0xFD187E20;
|
||||
const UInt32 SYSV_CIGAM = 0x207E18FD;
|
||||
const uint XENIX_MAGIC = 0x002B5544;
|
||||
const uint XENIX_CIGAM = 0x44552B00;
|
||||
const uint SYSV_MAGIC = 0xFD187E20;
|
||||
const uint SYSV_CIGAM = 0x207E18FD;
|
||||
// Rest have no magic.
|
||||
// Per a Linux kernel, Coherent fs has following:
|
||||
const string COH_FNAME = "nonamexxxxx ";
|
||||
const string COH_FPACK = "nopackxxxxx\n";
|
||||
// SCO AFS
|
||||
const UInt16 SCO_NFREE = 0xFFFF;
|
||||
const ushort SCO_NFREE = 0xFFFF;
|
||||
// UNIX 7th Edition has nothing to detect it, so check for a valid filesystem is a must :(
|
||||
const UInt16 V7_NICINOD = 100;
|
||||
const UInt16 V7_NICFREE = 50;
|
||||
const UInt32 V7_MAXSIZE = 0x00FFFFFF;
|
||||
const ushort V7_NICINOD = 100;
|
||||
const ushort V7_NICFREE = 50;
|
||||
const uint V7_MAXSIZE = 0x00FFFFFF;
|
||||
|
||||
public SysVfs()
|
||||
{
|
||||
@@ -72,15 +71,15 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt32 magic;
|
||||
uint magic;
|
||||
string s_fname, s_fpack;
|
||||
UInt16 s_nfree, s_ninode;
|
||||
UInt32 s_fsize;
|
||||
ushort s_nfree, s_ninode;
|
||||
uint s_fsize;
|
||||
|
||||
/*for(int j = 0; j<=(br.BaseStream.Length/0x200); j++)
|
||||
{
|
||||
br.BaseStream.Seek(offset + j*0x200 + 0x1F8, SeekOrigin.Begin); // System V magic location
|
||||
magic = br.ReadUInt32();
|
||||
magic = br.Readuint();
|
||||
|
||||
if(magic == SYSV_MAGIC || magic == SYSV_CIGAM)
|
||||
Console.WriteLine("0x{0:X8}: 0x{1:X8} FOUND", br.BaseStream.Position-4, magic);
|
||||
@@ -88,11 +87,11 @@ namespace DiscImageChef.Filesystems
|
||||
Console.WriteLine("0x{0:X8}: 0x{1:X8}", br.BaseStream.Position-4, magic);
|
||||
}*/
|
||||
|
||||
/*UInt32 number;
|
||||
/*uint number;
|
||||
br.BaseStream.Seek(offset+0x3A00, SeekOrigin.Begin);
|
||||
while((br.BaseStream.Position) <= (offset+0x3C00))
|
||||
{
|
||||
number = br.ReadUInt32();
|
||||
number = br.Readuint();
|
||||
|
||||
Console.WriteLine("@{0:X8}: 0x{1:X8} ({1})", br.BaseStream.Position-offset-4, number);
|
||||
}*/
|
||||
@@ -104,7 +103,7 @@ namespace DiscImageChef.Filesystems
|
||||
else
|
||||
sb_size_in_sectors = 1; // If not a single sector can store it
|
||||
|
||||
if(imagePlugin.GetSectors() <= (partitionStart + 4 * (ulong)sb_size_in_sectors + (ulong)sb_size_in_sectors)) // Device must be bigger than SB location + SB size + offset
|
||||
if(imagePlugin.GetSectors() <= (partitionStart + 4 * (ulong)sb_size_in_sectors + sb_size_in_sectors)) // Device must be bigger than SB location + SB size + offset
|
||||
return false;
|
||||
|
||||
// Superblock can start on 0x000, 0x200, 0x600 and 0x800, not aligned, so we assume 16 (128 bytes/sector) sectors as a safe value
|
||||
@@ -142,8 +141,8 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Byteswap
|
||||
s_fsize = ((s_fsize & 0xFF) << 24) + ((s_fsize & 0xFF00) << 8) + ((s_fsize & 0xFF0000) >> 8) + ((s_fsize & 0xFF000000) >> 24);
|
||||
s_nfree = (UInt16)(s_nfree >> 8);
|
||||
s_ninode = (UInt16)(s_ninode >> 8);
|
||||
s_nfree = (ushort)(s_nfree >> 8);
|
||||
s_ninode = (ushort)(s_ninode >> 8);
|
||||
}
|
||||
|
||||
if((s_fsize & 0xFF000000) == 0x00 && (s_nfree & 0xFF00) == 0x00 && (s_ninode & 0xFF00) == 0x00)
|
||||
@@ -167,10 +166,10 @@ namespace DiscImageChef.Filesystems
|
||||
StringBuilder sb = new StringBuilder();
|
||||
BigEndianBitConverter.IsLittleEndian = true; // Start in little endian until we know what are we handling here
|
||||
int start;
|
||||
UInt32 magic;
|
||||
uint magic;
|
||||
string s_fname, s_fpack;
|
||||
UInt16 s_nfree, s_ninode;
|
||||
UInt32 s_fsize;
|
||||
ushort s_nfree, s_ninode;
|
||||
uint s_fsize;
|
||||
bool xenix = false;
|
||||
bool sysv = false;
|
||||
bool sysvr4 = false;
|
||||
@@ -242,8 +241,8 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Byteswap
|
||||
s_fsize = ((s_fsize & 0xFF) << 24) + ((s_fsize & 0xFF00) << 8) + ((s_fsize & 0xFF0000) >> 8) + ((s_fsize & 0xFF000000) >> 24);
|
||||
s_nfree = (UInt16)(s_nfree >> 8);
|
||||
s_ninode = (UInt16)(s_ninode >> 8);
|
||||
s_nfree = (ushort)(s_nfree >> 8);
|
||||
s_ninode = (ushort)(s_ninode >> 8);
|
||||
}
|
||||
|
||||
if((s_fsize & 0xFF000000) == 0x00 && (s_nfree & 0xFF00) == 0x00 && (s_ninode & 0xFF00) == 0x00)
|
||||
@@ -294,7 +293,7 @@ namespace DiscImageChef.Filesystems
|
||||
xnx_sb.s_magic = BigEndianBitConverter.ToUInt32(sb_sector, 0x3F8);
|
||||
xnx_sb.s_type = BigEndianBitConverter.ToUInt32(sb_sector, 0x3FC);
|
||||
|
||||
UInt32 bs = 512;
|
||||
uint bs = 512;
|
||||
sb.AppendLine("XENIX filesystem");
|
||||
xmlFSType.Type = "XENIX fs";
|
||||
switch(xnx_sb.s_type)
|
||||
@@ -364,7 +363,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(sysv)
|
||||
{
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionStart, sb_size_in_sectors);
|
||||
UInt16 pad0, pad1, pad2;
|
||||
ushort pad0, pad1, pad2;
|
||||
byte[] sysv_strings = new byte[6];
|
||||
|
||||
pad0 = BigEndianBitConverter.ToUInt16(sb_sector, 0x002); // First padding
|
||||
@@ -425,7 +424,7 @@ namespace DiscImageChef.Filesystems
|
||||
sysv_sb.s_fpack = StringHandlers.CToString(sysv_strings);
|
||||
}
|
||||
|
||||
UInt32 bs = 512;
|
||||
uint bs = 512;
|
||||
if(sysvr4)
|
||||
{
|
||||
sb.AppendLine("System V Release 4 filesystem");
|
||||
@@ -617,19 +616,19 @@ namespace DiscImageChef.Filesystems
|
||||
struct XenixSuperBlock
|
||||
{
|
||||
/// <summary>0x000, index of first data zone</summary>
|
||||
public UInt16 s_isize;
|
||||
public ushort s_isize;
|
||||
/// <summary>0x002, total number of zones of this volume</summary>
|
||||
public UInt32 s_fsize;
|
||||
public uint s_fsize;
|
||||
// the start of the free block list:
|
||||
/// <summary>0x006, blocks in s_free, <=100</summary>
|
||||
public UInt16 s_nfree;
|
||||
public ushort s_nfree;
|
||||
/// <summary>0x008, 100 entries, first free block list chunk</summary>
|
||||
public UInt32[] s_free;
|
||||
public uint[] s_free;
|
||||
// the cache of free inodes:
|
||||
/// <summary>0x198, number of inodes in s_inode, <= 100</summary>
|
||||
public UInt16 s_ninode;
|
||||
public ushort s_ninode;
|
||||
/// <summary>0x19A, 100 entries, some free inodes</summary>
|
||||
public UInt16[] s_inode;
|
||||
public ushort[] s_inode;
|
||||
/// <summary>0x262, free block list manipulation lock</summary>
|
||||
public byte s_flock;
|
||||
/// <summary>0x263, inode cache manipulation lock</summary>
|
||||
@@ -639,19 +638,19 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x265, read-only mounted flag</summary>
|
||||
public byte s_ronly;
|
||||
/// <summary>0x266, time of last superblock update</summary>
|
||||
public UInt32 s_time;
|
||||
public uint s_time;
|
||||
/// <summary>0x26A, total number of free zones</summary>
|
||||
public UInt32 s_tfree;
|
||||
public uint s_tfree;
|
||||
/// <summary>0x26E, total number of free inodes</summary>
|
||||
public UInt16 s_tinode;
|
||||
public ushort s_tinode;
|
||||
/// <summary>0x270, blocks per cylinder</summary>
|
||||
public UInt16 s_cylblks;
|
||||
public ushort s_cylblks;
|
||||
/// <summary>0x272, blocks per gap</summary>
|
||||
public UInt16 s_gapblks;
|
||||
public ushort s_gapblks;
|
||||
/// <summary>0x274, device information ??</summary>
|
||||
public UInt16 s_dinfo0;
|
||||
public ushort s_dinfo0;
|
||||
/// <summary>0x276, device information ??</summary>
|
||||
public UInt16 s_dinfo1;
|
||||
public ushort s_dinfo1;
|
||||
/// <summary>0x278, 6 bytes, volume name</summary>
|
||||
public string s_fname;
|
||||
/// <summary>0x27E, 6 bytes, pack name</summary>
|
||||
@@ -661,33 +660,33 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x285, 371 bytes</summary>
|
||||
public byte[] s_fill;
|
||||
/// <summary>0x3F8, magic</summary>
|
||||
public UInt32 s_magic;
|
||||
public uint s_magic;
|
||||
/// <summary>0x3FC, filesystem type (1 = 512 bytes/blk, 2 = 1024 bytes/blk, 3 = 2048 bytes/blk)</summary>
|
||||
public UInt32 s_type;
|
||||
public uint s_type;
|
||||
}
|
||||
|
||||
struct SystemVRelease4SuperBlock
|
||||
{
|
||||
/// <summary>0x000, index of first data zone</summary>
|
||||
public UInt16 s_isize;
|
||||
public ushort s_isize;
|
||||
/// <summary>0x002, padding</summary>
|
||||
public UInt16 s_pad0;
|
||||
public ushort s_pad0;
|
||||
/// <summary>0x004, total number of zones of this volume</summary>
|
||||
public UInt32 s_fsize;
|
||||
public uint s_fsize;
|
||||
// the start of the free block list:
|
||||
/// <summary>0x008, blocks in s_free, <=100</summary>
|
||||
public UInt16 s_nfree;
|
||||
public ushort s_nfree;
|
||||
/// <summary>0x00A, padding</summary>
|
||||
public UInt16 s_pad1;
|
||||
public ushort s_pad1;
|
||||
/// <summary>0x00C, 50 entries, first free block list chunk</summary>
|
||||
public UInt32[] s_free;
|
||||
public uint[] s_free;
|
||||
// the cache of free inodes:
|
||||
/// <summary>0x0D4, number of inodes in s_inode, <= 100</summary>
|
||||
public UInt16 s_ninode;
|
||||
public ushort s_ninode;
|
||||
/// <summary>0x0D6, padding</summary>
|
||||
public UInt16 s_pad2;
|
||||
public ushort s_pad2;
|
||||
/// <summary>0x0D8, 100 entries, some free inodes</summary>
|
||||
public UInt16[] s_inode;
|
||||
public ushort[] s_inode;
|
||||
/// <summary>0x1A0, free block list manipulation lock</summary>
|
||||
public byte s_flock;
|
||||
/// <summary>0x1A1, inode cache manipulation lock</summary>
|
||||
@@ -697,21 +696,21 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x1A3, read-only mounted flag</summary>
|
||||
public byte s_ronly;
|
||||
/// <summary>0x1A4, time of last superblock update</summary>
|
||||
public UInt32 s_time;
|
||||
public uint s_time;
|
||||
/// <summary>0x1A8, blocks per cylinder</summary>
|
||||
public UInt16 s_cylblks;
|
||||
public ushort s_cylblks;
|
||||
/// <summary>0x1AA, blocks per gap</summary>
|
||||
public UInt16 s_gapblks;
|
||||
public ushort s_gapblks;
|
||||
/// <summary>0x1AC, device information ??</summary>
|
||||
public UInt16 s_dinfo0;
|
||||
public ushort s_dinfo0;
|
||||
/// <summary>0x1AE, device information ??</summary>
|
||||
public UInt16 s_dinfo1;
|
||||
public ushort s_dinfo1;
|
||||
/// <summary>0x1B0, total number of free zones</summary>
|
||||
public UInt32 s_tfree;
|
||||
public uint s_tfree;
|
||||
/// <summary>0x1B4, total number of free inodes</summary>
|
||||
public UInt16 s_tinode;
|
||||
public ushort s_tinode;
|
||||
/// <summary>0x1B6, padding</summary>
|
||||
public UInt16 s_pad3;
|
||||
public ushort s_pad3;
|
||||
/// <summary>0x1B8, 6 bytes, volume name</summary>
|
||||
public string s_fname;
|
||||
/// <summary>0x1BE, 6 bytes, pack name</summary>
|
||||
@@ -719,29 +718,29 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x1C4, 48 bytes</summary>
|
||||
public byte[] s_fill;
|
||||
/// <summary>0x1F4, if s_state == (0x7C269D38 - s_time) then filesystem is clean</summary>
|
||||
public UInt32 s_state;
|
||||
public uint s_state;
|
||||
/// <summary>0x1F8, magic</summary>
|
||||
public UInt32 s_magic;
|
||||
public uint s_magic;
|
||||
/// <summary>0x1FC, filesystem type (1 = 512 bytes/blk, 2 = 1024 bytes/blk)</summary>
|
||||
public UInt32 s_type;
|
||||
public uint s_type;
|
||||
}
|
||||
|
||||
struct SystemVRelease2SuperBlock
|
||||
{
|
||||
/// <summary>0x000, index of first data zone</summary>
|
||||
public UInt16 s_isize;
|
||||
public ushort s_isize;
|
||||
/// <summary>0x002, total number of zones of this volume</summary>
|
||||
public UInt32 s_fsize;
|
||||
public uint s_fsize;
|
||||
// the start of the free block list:
|
||||
/// <summary>0x006, blocks in s_free, <=100</summary>
|
||||
public UInt16 s_nfree;
|
||||
public ushort s_nfree;
|
||||
/// <summary>0x008, 50 entries, first free block list chunk</summary>
|
||||
public UInt32[] s_free;
|
||||
public uint[] s_free;
|
||||
// the cache of free inodes:
|
||||
/// <summary>0x0D0, number of inodes in s_inode, <= 100</summary>
|
||||
public UInt16 s_ninode;
|
||||
public ushort s_ninode;
|
||||
/// <summary>0x0D2, 100 entries, some free inodes</summary>
|
||||
public UInt16[] s_inode;
|
||||
public ushort[] s_inode;
|
||||
/// <summary>0x19A, free block list manipulation lock</summary>
|
||||
public byte s_flock;
|
||||
/// <summary>0x19B, inode cache manipulation lock</summary>
|
||||
@@ -751,19 +750,19 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x19D, read-only mounted flag</summary>
|
||||
public byte s_ronly;
|
||||
/// <summary>0x19E, time of last superblock update</summary>
|
||||
public UInt32 s_time;
|
||||
public uint s_time;
|
||||
/// <summary>0x1A2, blocks per cylinder</summary>
|
||||
public UInt16 s_cylblks;
|
||||
public ushort s_cylblks;
|
||||
/// <summary>0x1A4, blocks per gap</summary>
|
||||
public UInt16 s_gapblks;
|
||||
public ushort s_gapblks;
|
||||
/// <summary>0x1A6, device information ??</summary>
|
||||
public UInt16 s_dinfo0;
|
||||
public ushort s_dinfo0;
|
||||
/// <summary>0x1A8, device information ??</summary>
|
||||
public UInt16 s_dinfo1;
|
||||
public ushort s_dinfo1;
|
||||
/// <summary>0x1AA, total number of free zones</summary>
|
||||
public UInt32 s_tfree;
|
||||
public uint s_tfree;
|
||||
/// <summary>0x1AE, total number of free inodes</summary>
|
||||
public UInt16 s_tinode;
|
||||
public ushort s_tinode;
|
||||
/// <summary>0x1B0, 6 bytes, volume name</summary>
|
||||
public string s_fname;
|
||||
/// <summary>0x1B6, 6 bytes, pack name</summary>
|
||||
@@ -771,29 +770,29 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x1BC, 56 bytes</summary>
|
||||
public byte[] s_fill;
|
||||
/// <summary>0x1F4, if s_state == (0x7C269D38 - s_time) then filesystem is clean</summary>
|
||||
public UInt32 s_state;
|
||||
public uint s_state;
|
||||
/// <summary>0x1F8, magic</summary>
|
||||
public UInt32 s_magic;
|
||||
public uint s_magic;
|
||||
/// <summary>0x1FC, filesystem type (1 = 512 bytes/blk, 2 = 1024 bytes/blk)</summary>
|
||||
public UInt32 s_type;
|
||||
public uint s_type;
|
||||
}
|
||||
|
||||
struct UNIX7thEditionSuperBlock
|
||||
{
|
||||
/// <summary>0x000, index of first data zone</summary>
|
||||
public UInt16 s_isize;
|
||||
public ushort s_isize;
|
||||
/// <summary>0x002, total number of zones of this volume</summary>
|
||||
public UInt32 s_fsize;
|
||||
public uint s_fsize;
|
||||
// the start of the free block list:
|
||||
/// <summary>0x006, blocks in s_free, <=100</summary>
|
||||
public UInt16 s_nfree;
|
||||
public ushort s_nfree;
|
||||
/// <summary>0x008, 50 entries, first free block list chunk</summary>
|
||||
public UInt32[] s_free;
|
||||
public uint[] s_free;
|
||||
// the cache of free inodes:
|
||||
/// <summary>0x0D0, number of inodes in s_inode, <= 100</summary>
|
||||
public UInt16 s_ninode;
|
||||
public ushort s_ninode;
|
||||
/// <summary>0x0D2, 100 entries, some free inodes</summary>
|
||||
public UInt16[] s_inode;
|
||||
public ushort[] s_inode;
|
||||
/// <summary>0x19A, free block list manipulation lock</summary>
|
||||
public byte s_flock;
|
||||
/// <summary>0x19B, inode cache manipulation lock</summary>
|
||||
@@ -803,15 +802,15 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x19D, read-only mounted flag</summary>
|
||||
public byte s_ronly;
|
||||
/// <summary>0x19E, time of last superblock update</summary>
|
||||
public UInt32 s_time;
|
||||
public uint s_time;
|
||||
/// <summary>0x1A2, total number of free zones</summary>
|
||||
public UInt32 s_tfree;
|
||||
public uint s_tfree;
|
||||
/// <summary>0x1A6, total number of free inodes</summary>
|
||||
public UInt16 s_tinode;
|
||||
public ushort s_tinode;
|
||||
/// <summary>0x1A8, interleave factor</summary>
|
||||
public UInt16 s_int_m;
|
||||
public ushort s_int_m;
|
||||
/// <summary>0x1AA, interleave factor</summary>
|
||||
public UInt16 s_int_n;
|
||||
public ushort s_int_n;
|
||||
/// <summary>0x1AC, 6 bytes, volume name</summary>
|
||||
public string s_fname;
|
||||
/// <summary>0x1B2, 6 bytes, pack name</summary>
|
||||
@@ -821,19 +820,19 @@ namespace DiscImageChef.Filesystems
|
||||
struct CoherentSuperBlock
|
||||
{
|
||||
/// <summary>0x000, index of first data zone</summary>
|
||||
public UInt16 s_isize;
|
||||
public ushort s_isize;
|
||||
/// <summary>0x002, total number of zones of this volume</summary>
|
||||
public UInt32 s_fsize;
|
||||
public uint s_fsize;
|
||||
// the start of the free block list:
|
||||
/// <summary>0x006, blocks in s_free, <=100</summary>
|
||||
public UInt16 s_nfree;
|
||||
public ushort s_nfree;
|
||||
/// <summary>0x008, 64 entries, first free block list chunk</summary>
|
||||
public UInt32[] s_free;
|
||||
public uint[] s_free;
|
||||
// the cache of free inodes:
|
||||
/// <summary>0x108, number of inodes in s_inode, <= 100</summary>
|
||||
public UInt16 s_ninode;
|
||||
public ushort s_ninode;
|
||||
/// <summary>0x10A, 100 entries, some free inodes</summary>
|
||||
public UInt16[] s_inode;
|
||||
public ushort[] s_inode;
|
||||
/// <summary>0x1D2, free block list manipulation lock</summary>
|
||||
public byte s_flock;
|
||||
/// <summary>0x1D3, inode cache manipulation lock</summary>
|
||||
@@ -843,21 +842,21 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x1D5, read-only mounted flag</summary>
|
||||
public byte s_ronly;
|
||||
/// <summary>0x1D6, time of last superblock update</summary>
|
||||
public UInt32 s_time;
|
||||
public uint s_time;
|
||||
/// <summary>0x1DE, total number of free zones</summary>
|
||||
public UInt32 s_tfree;
|
||||
public uint s_tfree;
|
||||
/// <summary>0x1E2, total number of free inodes</summary>
|
||||
public UInt16 s_tinode;
|
||||
public ushort s_tinode;
|
||||
/// <summary>0x1E4, interleave factor</summary>
|
||||
public UInt16 s_int_m;
|
||||
public ushort s_int_m;
|
||||
/// <summary>0x1E6, interleave factor</summary>
|
||||
public UInt16 s_int_n;
|
||||
public ushort s_int_n;
|
||||
/// <summary>0x1E8, 6 bytes, volume name</summary>
|
||||
public string s_fname;
|
||||
/// <summary>0x1EE, 6 bytes, pack name</summary>
|
||||
public string s_fpack;
|
||||
/// <summary>0x1F4, zero-filled</summary>
|
||||
public UInt32 s_unique;
|
||||
public uint s_unique;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -33,17 +33,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
|
||||
// Information from the Linux kernel
|
||||
using DiscImageChef.Console;
|
||||
|
||||
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from the Linux kernel
|
||||
class BFS : Filesystem
|
||||
{
|
||||
const UInt32 BFS_MAGIC = 0x1BADFACE;
|
||||
const uint BFS_MAGIC = 0x1BADFACE;
|
||||
|
||||
public BFS()
|
||||
{
|
||||
@@ -62,7 +59,7 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
UInt32 magic;
|
||||
uint magic;
|
||||
|
||||
magic = BitConverter.ToUInt32(imagePlugin.ReadSector(0 + partitionStart), 0);
|
||||
|
||||
@@ -118,19 +115,19 @@ namespace DiscImageChef.Filesystems
|
||||
struct BFSSuperBlock
|
||||
{
|
||||
/// <summary>0x00, 0x1BADFACE</summary>
|
||||
public UInt32 s_magic;
|
||||
public uint s_magic;
|
||||
/// <summary>0x04, start in bytes of volume</summary>
|
||||
public UInt32 s_start;
|
||||
public uint s_start;
|
||||
/// <summary>0x08, end in bytes of volume</summary>
|
||||
public UInt32 s_end;
|
||||
public uint s_end;
|
||||
/// <summary>0x0C, unknown :p</summary>
|
||||
public UInt32 s_from;
|
||||
public uint s_from;
|
||||
/// <summary>0x10, unknown :p</summary>
|
||||
public UInt32 s_to;
|
||||
public uint s_to;
|
||||
/// <summary>0x14, unknown :p</summary>
|
||||
public Int32 s_bfrom;
|
||||
public int s_bfrom;
|
||||
/// <summary>0x18, unknown :p</summary>
|
||||
public Int32 s_bto;
|
||||
public int s_bto;
|
||||
/// <summary>0x1C, 6 bytes, filesystem name</summary>
|
||||
public string s_fsname;
|
||||
/// <summary>0x22, 6 bytes, volume name</summary>
|
||||
|
||||
@@ -32,12 +32,11 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from the Linux kernel
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from the Linux kernel
|
||||
class ext2FS : Filesystem
|
||||
{
|
||||
public ext2FS()
|
||||
@@ -59,7 +58,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionStart);
|
||||
|
||||
UInt16 magic = BitConverter.ToUInt16(sb_sector, 0x038);
|
||||
ushort magic = BitConverter.ToUInt16(sb_sector, 0x038);
|
||||
|
||||
if(magic == ext2FSMagic || magic == ext2OldFSMagic)
|
||||
return true;
|
||||
@@ -309,7 +308,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] temp_lo, temp_hi;
|
||||
byte[] temp_bytes = new byte[8];
|
||||
UInt64 blocks, reserved, free;
|
||||
ulong blocks, reserved, free;
|
||||
|
||||
if((supblk.ftr_incompat & EXT4_FEATURE_INCOMPAT_64BIT) == EXT4_FEATURE_INCOMPAT_64BIT)
|
||||
{
|
||||
@@ -624,9 +623,9 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// Same magic for ext2, ext3 and ext4
|
||||
/// </summary>
|
||||
public const UInt16 ext2FSMagic = 0xEF53;
|
||||
public const ushort ext2FSMagic = 0xEF53;
|
||||
|
||||
public const UInt16 ext2OldFSMagic = 0xEF51;
|
||||
public const ushort ext2OldFSMagic = 0xEF51;
|
||||
|
||||
/// <summary>
|
||||
/// ext2/3/4 superblock
|
||||
@@ -634,73 +633,73 @@ namespace DiscImageChef.Filesystems
|
||||
public struct ext2FSSuperBlock
|
||||
{
|
||||
/// <summary>0x000, inodes on volume</summary>
|
||||
public UInt32 inodes;
|
||||
public uint inodes;
|
||||
/// <summary>0x004, blocks on volume</summary>
|
||||
public UInt32 blocks;
|
||||
public uint blocks;
|
||||
/// <summary>0x008, reserved blocks</summary>
|
||||
public UInt32 reserved_blocks;
|
||||
public uint reserved_blocks;
|
||||
/// <summary>0x00C, free blocks count</summary>
|
||||
public UInt32 free_blocks;
|
||||
public uint free_blocks;
|
||||
/// <summary>0x010, free inodes count</summary>
|
||||
public UInt32 free_inodes;
|
||||
public uint free_inodes;
|
||||
/// <summary>0x014, first data block</summary>
|
||||
public UInt32 first_block;
|
||||
public uint first_block;
|
||||
/// <summary>0x018, block size</summary>
|
||||
public UInt32 block_size;
|
||||
public uint block_size;
|
||||
/// <summary>0x01C, fragment size</summary>
|
||||
public Int32 frag_size;
|
||||
/// <summary>0x020, blocks per group</summary>
|
||||
public UInt32 blocks_per_grp;
|
||||
public uint blocks_per_grp;
|
||||
/// <summary>0x024, fragments per group</summary>
|
||||
public UInt32 flags_per_grp;
|
||||
public uint flags_per_grp;
|
||||
/// <summary>0x028, inodes per group</summary>
|
||||
public UInt32 inodes_per_grp;
|
||||
public uint inodes_per_grp;
|
||||
/// <summary>0x02C, last mount time</summary>
|
||||
public UInt32 mount_t;
|
||||
public uint mount_t;
|
||||
/// <summary>0x030, last write time</summary>
|
||||
public UInt32 write_t;
|
||||
public uint write_t;
|
||||
/// <summary>0x034, mounts count</summary>
|
||||
public UInt16 mount_c;
|
||||
public ushort mount_c;
|
||||
/// <summary>0x036, max mounts</summary>
|
||||
public Int16 max_mount_c;
|
||||
/// <summary>0x038, (little endian)</summary>
|
||||
public UInt16 magic;
|
||||
public ushort magic;
|
||||
/// <summary>0x03A, filesystem state</summary>
|
||||
public UInt16 state;
|
||||
public ushort state;
|
||||
/// <summary>0x03C, behaviour on errors</summary>
|
||||
public UInt16 err_behaviour;
|
||||
public ushort err_behaviour;
|
||||
/// <summary>0x03E, From 0.5b onward</summary>
|
||||
public UInt16 minor_revision;
|
||||
public ushort minor_revision;
|
||||
/// <summary>0x040, last check time</summary>
|
||||
public UInt32 check_t;
|
||||
public uint check_t;
|
||||
/// <summary>0x044, max time between checks</summary>
|
||||
public UInt32 check_inv;
|
||||
public uint check_inv;
|
||||
|
||||
// From 0.5a onward
|
||||
/// <summary>0x048, Creation OS</summary>
|
||||
public UInt32 creator_os;
|
||||
public uint creator_os;
|
||||
/// <summary>0x04C, Revison level</summary>
|
||||
public UInt32 revision;
|
||||
public uint revision;
|
||||
/// <summary>0x050, Default UID for reserved blocks</summary>
|
||||
public UInt16 default_uid;
|
||||
public ushort default_uid;
|
||||
/// <summary>0x052, Default GID for reserved blocks</summary>
|
||||
public UInt16 default_gid;
|
||||
public ushort default_gid;
|
||||
|
||||
// From 0.5b onward
|
||||
/// <summary>0x054, First unreserved inode</summary>
|
||||
public UInt32 first_inode;
|
||||
public uint first_inode;
|
||||
/// <summary>0x058, inode size</summary>
|
||||
public UInt16 inode_size;
|
||||
public ushort inode_size;
|
||||
/// <summary>0x05A, Block group number of THIS superblock</summary>
|
||||
public UInt16 block_group_no;
|
||||
public ushort block_group_no;
|
||||
/// <summary>0x05C, Compatible features set</summary>
|
||||
public UInt32 ftr_compat;
|
||||
public uint ftr_compat;
|
||||
/// <summary>0x060, Incompatible features set</summary>
|
||||
public UInt32 ftr_incompat;
|
||||
public uint ftr_incompat;
|
||||
|
||||
// Found on Linux 2.0.40
|
||||
/// <summary>0x064, Read-only compatible features set</summary>
|
||||
public UInt32 ftr_ro_compat;
|
||||
public uint ftr_ro_compat;
|
||||
|
||||
// Found on Linux 2.1.132
|
||||
/// <summary>0x068, 16 bytes, UUID</summary>
|
||||
@@ -710,108 +709,108 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>0x088, 64 bytes, where last mounted</summary>
|
||||
public string last_mount_dir;
|
||||
/// <summary>0x0C8, Usage bitmap algorithm, for compression</summary>
|
||||
public UInt32 algo_usage_bmp;
|
||||
public uint algo_usage_bmp;
|
||||
/// <summary>0x0CC, Block to try to preallocate</summary>
|
||||
public byte prealloc_blks;
|
||||
/// <summary>0x0CD, Blocks to try to preallocate for directories</summary>
|
||||
public byte prealloc_dir_blks;
|
||||
/// <summary>0x0CE, Per-group desc for online growth</summary>
|
||||
public UInt16 rsrvd_gdt_blocks;
|
||||
public ushort rsrvd_gdt_blocks;
|
||||
|
||||
// Found on Linux 2.4
|
||||
// ext3
|
||||
/// <summary>0x0D0, 16 bytes, UUID of journal superblock</summary>
|
||||
public Guid journal_uuid;
|
||||
/// <summary>0x0E0, inode no. of journal file</summary>
|
||||
public UInt32 journal_inode;
|
||||
public uint journal_inode;
|
||||
/// <summary>0x0E4, device no. of journal file</summary>
|
||||
public UInt32 journal_dev;
|
||||
public uint journal_dev;
|
||||
/// <summary>0x0E8, Start of list of inodes to delete</summary>
|
||||
public UInt32 last_orphan;
|
||||
public uint last_orphan;
|
||||
/// <summary>0x0EC, First byte of 128bit HTREE hash seed</summary>
|
||||
public UInt32 hash_seed_1;
|
||||
public uint hash_seed_1;
|
||||
/// <summary>0x0F0, Second byte of 128bit HTREE hash seed</summary>
|
||||
public UInt32 hash_seed_2;
|
||||
public uint hash_seed_2;
|
||||
/// <summary>0x0F4, Third byte of 128bit HTREE hash seed</summary>
|
||||
public UInt32 hash_seed_3;
|
||||
public uint hash_seed_3;
|
||||
/// <summary>0x0F8, Fourth byte of 128bit HTREE hash seed</summary>
|
||||
public UInt32 hash_seed_4;
|
||||
public uint hash_seed_4;
|
||||
/// <summary>0x0FC, Hash version</summary>
|
||||
public byte hash_version;
|
||||
/// <summary>0x0FD, Journal backup type</summary>
|
||||
public byte jnl_backup_type;
|
||||
/// <summary>0x0FE, Size of group descriptor</summary>
|
||||
public UInt16 desc_grp_size;
|
||||
public ushort desc_grp_size;
|
||||
/// <summary>0x100, Default mount options</summary>
|
||||
public UInt32 default_mnt_opts;
|
||||
public uint default_mnt_opts;
|
||||
/// <summary>0x104, First metablock block group</summary>
|
||||
public UInt32 first_meta_bg;
|
||||
public uint first_meta_bg;
|
||||
|
||||
// Introduced with ext4, some can be ext3
|
||||
/// <summary>0x108, Filesystem creation time</summary>
|
||||
public UInt32 mkfs_t;
|
||||
public uint mkfs_t;
|
||||
// Follows 17 uint32 (68 bytes) of journal inode backup
|
||||
// Following 3 fields are valid if EXT4_FEATURE_COMPAT_64BIT is set
|
||||
/// <summary>0x14C, High 32bits of blocks no.</summary>
|
||||
public UInt32 blocks_hi;
|
||||
public uint blocks_hi;
|
||||
/// <summary>0x150, High 32bits of reserved blocks no.</summary>
|
||||
public UInt32 reserved_blocks_hi;
|
||||
public uint reserved_blocks_hi;
|
||||
/// <summary>0x154, High 32bits of free blocks no.</summary>
|
||||
public UInt32 free_blocks_hi;
|
||||
public uint free_blocks_hi;
|
||||
/// <summary>0x158, inodes minimal size in bytes</summary>
|
||||
public UInt16 min_inode_size;
|
||||
public ushort min_inode_size;
|
||||
/// <summary>0x15A, Bytes reserved by new inodes</summary>
|
||||
public UInt16 rsv_inode_size;
|
||||
public ushort rsv_inode_size;
|
||||
/// <summary>0x15C, Flags</summary>
|
||||
public UInt32 flags;
|
||||
public uint flags;
|
||||
/// <summary>0x160, RAID stride</summary>
|
||||
public UInt16 raid_stride;
|
||||
public ushort raid_stride;
|
||||
/// <summary>0x162, Waiting seconds in MMP check</summary>
|
||||
public UInt16 mmp_interval;
|
||||
public ushort mmp_interval;
|
||||
/// <summary>0x164, Block for multi-mount protection</summary>
|
||||
public UInt64 mmp_block;
|
||||
public ulong mmp_block;
|
||||
/// <summary>0x16C, Blocks on all data disks (N*stride)</summary>
|
||||
public UInt32 raid_stripe_width;
|
||||
public uint raid_stripe_width;
|
||||
/// <summary>0x170, FLEX_BG group size</summary>
|
||||
public byte flex_bg_grp_size;
|
||||
/// <summary>0x171 Padding</summary>
|
||||
public byte padding;
|
||||
/// <summary>0x172 Padding</summary>
|
||||
public UInt16 padding2;
|
||||
public ushort padding2;
|
||||
|
||||
// Following are introduced with ext4
|
||||
/// <summary>0x174, Kibibytes written in volume lifetime</summary>
|
||||
public UInt64 kbytes_written;
|
||||
public ulong kbytes_written;
|
||||
/// <summary>0x17C, Active snapshot inode number</summary>
|
||||
public UInt32 snapshot_inum;
|
||||
public uint snapshot_inum;
|
||||
/// <summary>0x180, Active snapshot sequential ID</summary>
|
||||
public UInt32 snapshot_id;
|
||||
public uint snapshot_id;
|
||||
/// <summary>0x184, Reserved blocks for active snapshot's future use</summary>
|
||||
public UInt64 snapshot_blocks;
|
||||
public ulong snapshot_blocks;
|
||||
/// <summary>0x18C, inode number of the on-disk start of the snapshot list</summary>
|
||||
public UInt32 snapshot_list;
|
||||
public uint snapshot_list;
|
||||
|
||||
// Optional ext4 error-handling features
|
||||
/// <summary>0x190, total registered filesystem errors</summary>
|
||||
public UInt32 error_count;
|
||||
public uint error_count;
|
||||
/// <summary>0x194, time on first error</summary>
|
||||
public UInt32 first_error_t;
|
||||
public uint first_error_t;
|
||||
/// <summary>0x198, inode involved in first error</summary>
|
||||
public UInt32 first_error_inode;
|
||||
public uint first_error_inode;
|
||||
/// <summary>0x19C, block involved of first error</summary>
|
||||
public UInt64 first_error_block;
|
||||
public ulong first_error_block;
|
||||
/// <summary>0x1A0, 32 bytes, function where the error happened</summary>
|
||||
public string first_error_func;
|
||||
/// <summary>0x1B0, line number where error happened</summary>
|
||||
public UInt32 first_error_line;
|
||||
public uint first_error_line;
|
||||
/// <summary>0x1B4, time of most recent error</summary>
|
||||
public UInt32 last_error_t;
|
||||
public uint last_error_t;
|
||||
/// <summary>0x1B8, inode involved in last error</summary>
|
||||
public UInt32 last_error_inode;
|
||||
public uint last_error_inode;
|
||||
/// <summary>0x1BC, line number where error happened</summary>
|
||||
public UInt32 last_error_line;
|
||||
public uint last_error_line;
|
||||
/// <summary>0x1C0, block involved of last error</summary>
|
||||
public UInt64 last_error_block;
|
||||
public ulong last_error_block;
|
||||
/// <summary>0x1C8, 32 bytes, function where the error happened</summary>
|
||||
public string last_error_func;
|
||||
// End of optional error-handling features
|
||||
@@ -822,112 +821,112 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
// ext? filesystem states
|
||||
/// <summary>Cleanly-unmounted volume</summary>
|
||||
public const UInt16 EXT2_VALID_FS = 0x0001;
|
||||
public const ushort EXT2_VALID_FS = 0x0001;
|
||||
/// <summary>Dirty volume</summary>
|
||||
public const UInt16 EXT2_ERROR_FS = 0x0002;
|
||||
public const ushort EXT2_ERROR_FS = 0x0002;
|
||||
/// <summary>Recovering orphan files</summary>
|
||||
public const UInt16 EXT3_ORPHAN_FS = 0x0004;
|
||||
public const ushort EXT3_ORPHAN_FS = 0x0004;
|
||||
|
||||
// ext? default mount flags
|
||||
/// <summary>Enable debugging messages</summary>
|
||||
public const UInt32 EXT2_DEFM_DEBUG = 0x000001;
|
||||
public const uint EXT2_DEFM_DEBUG = 0x000001;
|
||||
/// <summary>Emulates BSD behaviour on new file creation</summary>
|
||||
public const UInt32 EXT2_DEFM_BSDGROUPS = 0x000002;
|
||||
public const uint EXT2_DEFM_BSDGROUPS = 0x000002;
|
||||
/// <summary>Enable user xattrs</summary>
|
||||
public const UInt32 EXT2_DEFM_XATTR_USER = 0x000004;
|
||||
public const uint EXT2_DEFM_XATTR_USER = 0x000004;
|
||||
/// <summary>Enable POSIX ACLs</summary>
|
||||
public const UInt32 EXT2_DEFM_ACL = 0x000008;
|
||||
public const uint EXT2_DEFM_ACL = 0x000008;
|
||||
/// <summary>Use 16bit UIDs</summary>
|
||||
public const UInt32 EXT2_DEFM_UID16 = 0x000010;
|
||||
public const uint EXT2_DEFM_UID16 = 0x000010;
|
||||
/// <summary>Journal data mode</summary>
|
||||
public const UInt32 EXT3_DEFM_JMODE_DATA = 0x000040;
|
||||
public const uint EXT3_DEFM_JMODE_DATA = 0x000040;
|
||||
/// <summary>Journal ordered mode</summary>
|
||||
public const UInt32 EXT3_DEFM_JMODE_ORDERED = 0x000080;
|
||||
public const uint EXT3_DEFM_JMODE_ORDERED = 0x000080;
|
||||
/// <summary>Journal writeback mode</summary>
|
||||
public const UInt32 EXT3_DEFM_JMODE_WBACK = 0x000100;
|
||||
public const uint EXT3_DEFM_JMODE_WBACK = 0x000100;
|
||||
|
||||
// Behaviour on errors
|
||||
/// <summary>Continue execution</summary>
|
||||
public const UInt16 EXT2_ERRORS_CONTINUE = 1;
|
||||
public const ushort EXT2_ERRORS_CONTINUE = 1;
|
||||
/// <summary>Remount fs read-only</summary>
|
||||
public const UInt16 EXT2_ERRORS_RO = 2;
|
||||
public const ushort EXT2_ERRORS_RO = 2;
|
||||
/// <summary>Panic</summary>
|
||||
public const UInt16 EXT2_ERRORS_PANIC = 3;
|
||||
public const ushort EXT2_ERRORS_PANIC = 3;
|
||||
|
||||
// OS codes
|
||||
public const UInt32 EXT2_OS_LINUX = 0;
|
||||
public const UInt32 EXT2_OS_HURD = 1;
|
||||
public const UInt32 EXT2_OS_MASIX = 2;
|
||||
public const UInt32 EXT2_OS_FREEBSD = 3;
|
||||
public const UInt32 EXT2_OS_LITES = 4;
|
||||
public const uint EXT2_OS_LINUX = 0;
|
||||
public const uint EXT2_OS_HURD = 1;
|
||||
public const uint EXT2_OS_MASIX = 2;
|
||||
public const uint EXT2_OS_FREEBSD = 3;
|
||||
public const uint EXT2_OS_LITES = 4;
|
||||
|
||||
// Revision levels
|
||||
/// <summary>The good old (original) format</summary>
|
||||
public const UInt32 EXT2_GOOD_OLD_REV = 0;
|
||||
public const uint EXT2_GOOD_OLD_REV = 0;
|
||||
/// <summary>V2 format w/ dynamic inode sizes</summary>
|
||||
public const UInt32 EXT2_DYNAMIC_REV = 1;
|
||||
public const uint EXT2_DYNAMIC_REV = 1;
|
||||
|
||||
// Compatible features
|
||||
/// <summary>Pre-allocate directories</summary>
|
||||
public const UInt32 EXT2_FEATURE_COMPAT_DIR_PREALLOC = 0x00000001;
|
||||
public const uint EXT2_FEATURE_COMPAT_DIR_PREALLOC = 0x00000001;
|
||||
/// <summary>imagic inodes ?</summary>
|
||||
public const UInt32 EXT2_FEATURE_COMPAT_IMAGIC_INODES = 0x00000002;
|
||||
public const uint EXT2_FEATURE_COMPAT_IMAGIC_INODES = 0x00000002;
|
||||
/// <summary>Has journal (it's ext3)</summary>
|
||||
public const UInt32 EXT3_FEATURE_COMPAT_HAS_JOURNAL = 0x00000004;
|
||||
public const uint EXT3_FEATURE_COMPAT_HAS_JOURNAL = 0x00000004;
|
||||
/// <summary>EA blocks</summary>
|
||||
public const UInt32 EXT2_FEATURE_COMPAT_EXT_ATTR = 0x00000008;
|
||||
public const uint EXT2_FEATURE_COMPAT_EXT_ATTR = 0x00000008;
|
||||
/// <summary>Online filesystem resize reservations</summary>
|
||||
public const UInt32 EXT2_FEATURE_COMPAT_RESIZE_INO = 0x00000010;
|
||||
public const uint EXT2_FEATURE_COMPAT_RESIZE_INO = 0x00000010;
|
||||
/// <summary>Can use hashed indexes on directories</summary>
|
||||
public const UInt32 EXT2_FEATURE_COMPAT_DIR_INDEX = 0x00000020;
|
||||
public const uint EXT2_FEATURE_COMPAT_DIR_INDEX = 0x00000020;
|
||||
|
||||
// Read-only compatible features
|
||||
/// <summary>Reduced number of superblocks</summary>
|
||||
public const UInt32 EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER = 0x00000001;
|
||||
public const uint EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER = 0x00000001;
|
||||
/// <summary>Can have files bigger than 2GiB</summary>
|
||||
public const UInt32 EXT2_FEATURE_RO_COMPAT_LARGE_FILE = 0x00000002;
|
||||
public const uint EXT2_FEATURE_RO_COMPAT_LARGE_FILE = 0x00000002;
|
||||
/// <summary>Use B-Tree for directories</summary>
|
||||
public const UInt32 EXT2_FEATURE_RO_COMPAT_BTREE_DIR = 0x00000004;
|
||||
public const uint EXT2_FEATURE_RO_COMPAT_BTREE_DIR = 0x00000004;
|
||||
/// <summary>Can have files bigger than 2TiB *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_RO_COMPAT_HUGE_FILE = 0x00000008;
|
||||
public const uint EXT4_FEATURE_RO_COMPAT_HUGE_FILE = 0x00000008;
|
||||
/// <summary>Group descriptor checksums and sparse inode table *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_RO_COMPAT_GDT_CSUM = 0x00000010;
|
||||
public const uint EXT4_FEATURE_RO_COMPAT_GDT_CSUM = 0x00000010;
|
||||
/// <summary>More than 32000 directory entries *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_RO_COMPAT_DIR_NLINK = 0x00000020;
|
||||
public const uint EXT4_FEATURE_RO_COMPAT_DIR_NLINK = 0x00000020;
|
||||
/// <summary>Nanosecond timestamps and creation time *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE = 0x00000040;
|
||||
public const uint EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE = 0x00000040;
|
||||
|
||||
// Incompatible features
|
||||
/// <summary>Uses compression</summary>
|
||||
public const UInt32 EXT2_FEATURE_INCOMPAT_COMPRESSION = 0x00000001;
|
||||
public const uint EXT2_FEATURE_INCOMPAT_COMPRESSION = 0x00000001;
|
||||
/// <summary>Filetype in directory entries</summary>
|
||||
public const UInt32 EXT2_FEATURE_INCOMPAT_FILETYPE = 0x00000002;
|
||||
public const uint EXT2_FEATURE_INCOMPAT_FILETYPE = 0x00000002;
|
||||
/// <summary>Journal needs recovery *ext3*</summary>
|
||||
public const UInt32 EXT3_FEATURE_INCOMPAT_RECOVER = 0x00000004;
|
||||
public const uint EXT3_FEATURE_INCOMPAT_RECOVER = 0x00000004;
|
||||
/// <summary>Has journal on another device *ext3*</summary>
|
||||
public const UInt32 EXT3_FEATURE_INCOMPAT_JOURNAL_DEV = 0x00000008;
|
||||
public const uint EXT3_FEATURE_INCOMPAT_JOURNAL_DEV = 0x00000008;
|
||||
/// <summary>Reduced block group backups</summary>
|
||||
public const UInt32 EXT2_FEATURE_INCOMPAT_META_BG = 0x00000010;
|
||||
public const uint EXT2_FEATURE_INCOMPAT_META_BG = 0x00000010;
|
||||
/// <summary>Volume use extents *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_INCOMPAT_EXTENTS = 0x00000040;
|
||||
public const uint EXT4_FEATURE_INCOMPAT_EXTENTS = 0x00000040;
|
||||
/// <summary>Supports volumes bigger than 2^32 blocks *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_INCOMPAT_64BIT = 0x00000080;
|
||||
public const uint EXT4_FEATURE_INCOMPAT_64BIT = 0x00000080;
|
||||
/// <summary>Multi-mount protection *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_INCOMPAT_MMP = 0x00000100;
|
||||
public const uint EXT4_FEATURE_INCOMPAT_MMP = 0x00000100;
|
||||
/// <summary>Flexible block group metadata location *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_INCOMPAT_FLEX_BG = 0x00000200;
|
||||
public const uint EXT4_FEATURE_INCOMPAT_FLEX_BG = 0x00000200;
|
||||
/// <summary>EA in inode *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_INCOMPAT_EA_INODE = 0x00000400;
|
||||
public const uint EXT4_FEATURE_INCOMPAT_EA_INODE = 0x00000400;
|
||||
/// <summary>Data can reside in directory entry *ext4*</summary>
|
||||
public const UInt32 EXT4_FEATURE_INCOMPAT_DIRDATA = 0x00001000;
|
||||
public const uint EXT4_FEATURE_INCOMPAT_DIRDATA = 0x00001000;
|
||||
|
||||
// Miscellaneous filesystem flags
|
||||
/// <summary>Signed dirhash in use</summary>
|
||||
public const UInt32 EXT2_FLAGS_SIGNED_HASH = 0x00000001;
|
||||
public const uint EXT2_FLAGS_SIGNED_HASH = 0x00000001;
|
||||
/// <summary>Unsigned dirhash in use</summary>
|
||||
public const UInt32 EXT2_FLAGS_UNSIGNED_HASH = 0x00000002;
|
||||
public const uint EXT2_FLAGS_UNSIGNED_HASH = 0x00000002;
|
||||
/// <summary>Testing development code</summary>
|
||||
public const UInt32 EXT2_FLAGS_TEST_FILESYS = 0x00000004;
|
||||
public const uint EXT2_FLAGS_TEST_FILESYS = 0x00000004;
|
||||
|
||||
public override Errno Mount()
|
||||
{
|
||||
|
||||
@@ -32,12 +32,11 @@
|
||||
|
||||
using System;
|
||||
using System.Text;
|
||||
using DiscImageChef;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// Information from the Linux kernel
|
||||
namespace DiscImageChef.Filesystems
|
||||
{
|
||||
// Information from the Linux kernel
|
||||
class extFS : Filesystem
|
||||
{
|
||||
public extFS()
|
||||
@@ -59,7 +58,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionStart); // Superblock resides at 0x400
|
||||
|
||||
UInt16 magic = BitConverter.ToUInt16(sb_sector, 0x038); // Here should reside magic number
|
||||
ushort magic = BitConverter.ToUInt16(sb_sector, 0x038); // Here should reside magic number
|
||||
|
||||
return magic == extFSMagic;
|
||||
}
|
||||
@@ -106,7 +105,7 @@ namespace DiscImageChef.Filesystems
|
||||
/// <summary>
|
||||
/// ext superblock magic
|
||||
/// </summary>
|
||||
public const UInt16 extFSMagic = 0x137D;
|
||||
public const ushort extFSMagic = 0x137D;
|
||||
|
||||
/// <summary>
|
||||
/// ext superblock
|
||||
@@ -114,35 +113,35 @@ namespace DiscImageChef.Filesystems
|
||||
public struct extFSSuperBlock
|
||||
{
|
||||
/// <summary>0x000, inodes on volume</summary>
|
||||
public UInt32 inodes;
|
||||
public uint inodes;
|
||||
/// <summary>0x004, zones on volume</summary>
|
||||
public UInt32 zones;
|
||||
public uint zones;
|
||||
/// <summary>0x008, first free block</summary>
|
||||
public UInt32 firstfreeblk;
|
||||
public uint firstfreeblk;
|
||||
/// <summary>0x00C, free blocks count</summary>
|
||||
public UInt32 freecountblk;
|
||||
public uint freecountblk;
|
||||
/// <summary>0x010, first free inode</summary>
|
||||
public UInt32 firstfreeind;
|
||||
public uint firstfreeind;
|
||||
/// <summary>0x014, free inodes count</summary>
|
||||
public UInt32 freecountind;
|
||||
public uint freecountind;
|
||||
/// <summary>0x018, first data zone</summary>
|
||||
public UInt32 firstdatazone;
|
||||
public uint firstdatazone;
|
||||
/// <summary>0x01C, log zone size</summary>
|
||||
public UInt32 logzonesize;
|
||||
public uint logzonesize;
|
||||
/// <summary>0x020, max zone size</summary>
|
||||
public UInt32 maxsize;
|
||||
public uint maxsize;
|
||||
/// <summary>0x024, reserved</summary>
|
||||
public UInt32 reserved1;
|
||||
public uint reserved1;
|
||||
/// <summary>0x028, reserved</summary>
|
||||
public UInt32 reserved2;
|
||||
public uint reserved2;
|
||||
/// <summary>0x02C, reserved</summary>
|
||||
public UInt32 reserved3;
|
||||
public uint reserved3;
|
||||
/// <summary>0x030, reserved</summary>
|
||||
public UInt32 reserved4;
|
||||
public uint reserved4;
|
||||
/// <summary>0x034, reserved</summary>
|
||||
public UInt32 reserved5;
|
||||
public uint reserved5;
|
||||
/// <summary>0x038, 0x137D (little endian)</summary>
|
||||
public UInt16 magic;
|
||||
public ushort magic;
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
Reference in New Issue
Block a user