mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Added new possible compression algorithms and field names from
DiskImages.framework.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2016-09-07 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* NDIF.cs:
|
||||
* UDIF.cs: Added new possible compression algorithms and field
|
||||
names from DiskImages.framework.
|
||||
|
||||
2016-09-06 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* NDIF.cs:
|
||||
|
||||
@@ -42,12 +42,10 @@ using DiscImageChef.ImagePlugins;
|
||||
|
||||
namespace DiscImageChef.DiscImages
|
||||
{
|
||||
// TODO: Detect ShrinkWrap encrypted images
|
||||
// TODO: Detect OS X encrypted images
|
||||
// TODO: Check checksum
|
||||
// TODO: Implement segments
|
||||
// TODO: Implement compression
|
||||
// TODO: Get application version from "vers" resource
|
||||
public class NDIF : ImagePlugin
|
||||
{
|
||||
#region Internal constants
|
||||
@@ -66,11 +64,11 @@ namespace DiscImageChef.DiscImages
|
||||
struct ChunkHeader
|
||||
{
|
||||
/// <summary>
|
||||
/// Type? All OS X generated ones are 12, all DiskCopy 6.3.3 RdWr are 10 but rest are 12
|
||||
/// Version
|
||||
/// </summary>
|
||||
public short version;
|
||||
/// <summary>
|
||||
/// Driver? Changes with driver
|
||||
/// Filesystem ID
|
||||
/// </summary>
|
||||
public short driver;
|
||||
/// <summary>
|
||||
@@ -83,13 +81,13 @@ namespace DiscImageChef.DiscImages
|
||||
/// </summary>
|
||||
public uint sectors;
|
||||
/// <summary>
|
||||
/// Size of buffer, in sectors, for compression/decompression
|
||||
/// Maximum number of sectors per chunk
|
||||
/// </summary>
|
||||
public uint bufferSize;
|
||||
public uint maxSectorsPerChunk;
|
||||
/// <summary>
|
||||
/// Always 0?
|
||||
/// </summary>
|
||||
public uint zero;
|
||||
public uint zeroOffset;
|
||||
/// <summary>
|
||||
/// CRC28 of whole image
|
||||
/// </summary>
|
||||
@@ -99,9 +97,17 @@ namespace DiscImageChef.DiscImages
|
||||
/// </summary>
|
||||
public uint segmented;
|
||||
/// <summary>
|
||||
/// Unknown
|
||||
/// </summary>
|
||||
public uint p1;
|
||||
/// <summary>
|
||||
/// Unknown
|
||||
/// </summary>
|
||||
public uint p2;
|
||||
/// <summary>
|
||||
/// Unknown, spare?
|
||||
/// </summary>
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 7)]
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
|
||||
public uint[] unknown;
|
||||
/// <summary>
|
||||
/// Set to 1 by ShrinkWrap if image is encrypted
|
||||
@@ -166,6 +172,8 @@ namespace DiscImageChef.DiscImages
|
||||
const byte ChunkType_NoCopy = 0;
|
||||
const byte ChunkType_Copy = 2;
|
||||
const byte ChunkType_KenCode = 0x80;
|
||||
const byte ChunkType_RLE = 0x81;
|
||||
const byte ChunkType_LZH = 0x82;
|
||||
const byte ChunkType_ADC = 0x83;
|
||||
/// <summary>
|
||||
/// Created by ShrinkWrap 3.5, dunno which version of the StuffIt algorithm it is using
|
||||
@@ -276,17 +284,17 @@ namespace DiscImageChef.DiscImages
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.driver = {0}", header.driver);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.name = {0}", StringHandlers.PascalToString(header.name));
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.sectors = {0}", header.sectors);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.bufferSize = {0}", header.bufferSize);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.zero = {0}", header.zero);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.maxSectorsPerChunk = {0}", header.maxSectorsPerChunk);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.zeroOffset = {0}", header.zeroOffset);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.crc = 0x{0:X7}", header.crc);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.segmented = {0}", header.segmented);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.p1 = 0x{0:X8}", header.p1);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.p2 = 0x{0:X8}", header.p2);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.unknown[0] = 0x{0:X8}", header.unknown[0]);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.unknown[1] = 0x{0:X8}", header.unknown[1]);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.unknown[2] = 0x{0:X8}", header.unknown[2]);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.unknown[3] = 0x{0:X8}", header.unknown[3]);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.unknown[4] = 0x{0:X8}", header.unknown[4]);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.unknown[5] = 0x{0:X8}", header.unknown[5]);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.unknown[6] = 0x{0:X8}", header.unknown[6]);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.encrypted = {0}", header.encrypted);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.hash = 0x{0:X8}", header.hash);
|
||||
DicConsole.DebugWriteLine("NDIF plugin", "footer.chunks = {0}", header.chunks);
|
||||
|
||||
@@ -52,15 +52,18 @@ namespace DiscImageChef.DiscImages
|
||||
// All chunk types with this mask are compressed
|
||||
const uint ChunkType_CompressedMask = 0x80000000;
|
||||
|
||||
const uint ChunkType_Zero = 0x00000000;
|
||||
const uint ChunkType_Copy = 0x00000001;
|
||||
const uint ChunkType_NoCopy = 0x00000002;
|
||||
const uint ChunkType_ADC = 0x80000004;
|
||||
const uint ChunkType_Zlib = 0x80000005;
|
||||
const uint ChunkType_Bzip = 0x80000006;
|
||||
const uint ChunkType_LZFSE = 0x80000007;
|
||||
const uint ChunkType_Commnt = 0x7FFFFFFF;
|
||||
const uint ChunkType_End = 0xFFFFFFFF;
|
||||
const uint ChunkType_Zero = 0x00000000;
|
||||
const uint ChunkType_Copy = 0x00000001;
|
||||
const uint ChunkType_NoCopy = 0x00000002;
|
||||
const uint ChunkType_KenCode = 0x80000001;
|
||||
const uint ChunkType_RLE = 0x80000002;
|
||||
const uint ChunkType_LZH = 0x80000003;
|
||||
const uint ChunkType_ADC = 0x80000004;
|
||||
const uint ChunkType_Zlib = 0x80000005;
|
||||
const uint ChunkType_Bzip = 0x80000006;
|
||||
const uint ChunkType_LZFSE = 0x80000007;
|
||||
const uint ChunkType_Commnt = 0x7FFFFFFF;
|
||||
const uint ChunkType_End = 0xFFFFFFFF;
|
||||
|
||||
const string ResourceForkKey = "resource-fork";
|
||||
const string BlockKey = "blkx";
|
||||
@@ -518,10 +521,7 @@ namespace DiscImageChef.DiscImages
|
||||
if(!chunkFound)
|
||||
throw new ArgumentOutOfRangeException(nameof(sectorAddress), string.Format("Sector address {0} not found", sectorAddress));
|
||||
|
||||
if(currentChunk.type == ChunkType_Zero)
|
||||
throw new ImageNotSupportedException("Dunno how to handle ZERO chunk type, please fill issue and send image.");
|
||||
|
||||
if(currentChunk.type == ChunkType_NoCopy)
|
||||
if(currentChunk.type == ChunkType_NoCopy || currentChunk.type == ChunkType_Zero)
|
||||
{
|
||||
sector = new byte[sectorSize];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user