Added skeleton for BSD FFS.

Added HFS+.
If HFS detects it has wrapped a HFS+ volume, inform that it's not its filesystem.
Added a workaround in calculation with UInt32 and ulong that made HFS and MFS show a bad date.


git-svn-id: svn://claunia.com/FileSystemIDandChk@2 17725271-3d32-4980-a8cb-9ff532f270ba
This commit is contained in:
2011-03-06 00:25:11 +00:00
parent beec65407a
commit 4f089c1539
7 changed files with 543 additions and 26 deletions

View File

@@ -30,7 +30,17 @@ namespace FileSystemIDandChk.Plugins
drSigWord = BitConverter.ToUInt16(signature, 0);
if(drSigWord == 0x4244)
return true;
{
stream.Seek(0x47C + offset, SeekOrigin.Begin); // Seek to embedded HFS+ signature
stream.Read(signature, 0, 2);
signature = Swapping.SwapTwoBytes(signature);
drSigWord = BitConverter.ToUInt16(signature, 0);
if(drSigWord == 0x482B) // "H+"
return false;
else
return true;
}
else
return false;
}
@@ -338,8 +348,8 @@ namespace FileSystemIDandChk.Plugins
private struct HFS_MasterDirectoryBlock // Should be offset 0x0400 bytes in volume
{
public UInt16 drSigWord; // Signature, 0x4244
public UInt32 drCrDate; // Volume creation date
public UInt32 drLsMod; // Volume last modification date
public ulong drCrDate; // Volume creation date
public ulong drLsMod; // Volume last modification date
public UInt16 drAtrb; // Volume attributes
public UInt16 drNmFls; // Files in root directory
public UInt16 drVBMSt; // Start 512-byte sector of volume bitmap
@@ -351,7 +361,7 @@ namespace FileSystemIDandChk.Plugins
public UInt32 drNxtCNID; // CNID for next file
public UInt16 drFreeBks; // Free allocation blocks
public byte[] drVN; // Volume name (28 bytes)
public UInt32 drVolBkUp; // Volume last backup time
public ulong drVolBkUp; // Volume last backup time
public UInt16 drVSeqNum; // Volume backup sequence number
public UInt32 drWrCnt; // Filesystem write count
public UInt32 drXTClpSiz; // Bytes to allocate when extending the extents B-Tree