6 Commits

8 changed files with 166 additions and 30 deletions

View File

@@ -544,6 +544,7 @@ For the most accurate and up-to-date list, refer to the `libaaruformat` source.
|ISO_14517|802|5.25", M.O., 1273011 sectors, 1024 bytes/sector, ISO 14517, 2.6Gb/cart
|ISO_14517_512|803|5.25", M.O., 2244958 sectors, 512 bytes/sector, ISO 14517, 2.3Gb/cart
|ISO_15041_512|804|3.5", M.O., 1041500 sectors, 512 bytes/sector, ISO 15041, 540Mb/cart
|HSM650|805|3,5", M.O., ??????? sectors, proprietary, 650Mb/cart, Sony HyperStorage
|MetaFloppy_Mod_I|820|5.25", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, MFM, 48 tpi, ???rpm
|AtariLynxCard|821|
|AtariJaguarCartridge|822|

View File

@@ -771,7 +771,59 @@ typedef enum
VideoNow = 740, ///< Hasbro VideoNow 85 mm proprietary video disc
VideoNowColor = 741, ///< Hasbro VideoNow Color disc
VideoNowXp = 742 ///< Hasbro VideoNow XP higher capacity disc
//
// VideoNow, types 740 to 749
// Iomega, types 750 to 759
Bernoulli10 = 750, ///< 8"x11" Bernoulli Box disk with 10Mb capacity
///< 8"x11" Bernoulli Box disk with 20Mb capacity
Bernoulli20 = 751,
///< 5⅓" Bernoulli Box II disk with 20Mb capacity
BernoulliBox2_20 = 752,
// Iomega, types 750 to 759
// Kodak, types 760 to 769
KodakVerbatim3 = 760, ///< Kodak/Verbatim (3Mb)
KodakVerbatim6 = 761, ///< Kodak/Verbatim (6Mb)
KodakVerbatim12 = 762, ///< Kodak/Verbatim (12Mb)
// Kodak, types 760 to 769
// Sony and Panasonic Blu-ray derived, types 770 to 799
ProfessionalDisc = 770, ///< Professional Disc for video, single layer, rewritable, 23Gb
ProfessionalDiscDual = 771, ///< Professional Disc for video, dual layer, rewritable, 50Gb
ProfessionalDiscTriple = 772, ///< Professional Disc for video, triple layer, rewritable, 100Gb
ProfessionalDiscQuad = 773, ///< Professional Disc for video, quad layer, write once, 128Gb
PDD = 774, ///< Professional Disc for DATA, single layer, rewritable, 23Gb
PDD_WORM = 775, ///< Professional Disc for DATA, single layer, write once, 23Gb
ArchivalDisc = 776, ///< Archival Disc, 1st gen., 300Gb
ArchivalDisc2 = 777, ///< Archival Disc, 2nd gen., 500Gb
ArchivalDisc3 = 778, ///< Archival Disc, 3rd gen., 1Tb
ODC300R = 779, ///< Optical Disc archive, 1st gen., write once, 300Gb
ODC300RE = 780, ///< Optical Disc archive, 1st gen., rewritable, 300Gb
ODC600R = 781, ///< Optical Disc archive, 2nd gen., write once, 600Gb
ODC600RE = 782, ///< Optical Disc archive, 2nd gen., rewritable, 600Gb
ODC1200RE = 783, ///< Optical Disc archive, 3rd gen., rewritable, 1200Gb
ODC1500R = 784, ///< Optical Disc archive, 3rd gen., write once, 1500Gb
ODC3300R = 785, ///< Optical Disc archive, 4th gen., write once, 3300Gb
ODC5500R = 786, ///< Optical Disc archive, 5th gen., write once, 5500Gb
// Sony and Panasonic Blu-ray derived, types 770 to 799
// Magneto-optical, types 800 to 819
ECMA_322_1k = 800, ///< 5,25", M.O., 4383356 sectors, 1024 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart
ECMA_322_512 = 801, ///< 5,25", M.O., ??????? sectors, 512 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart
ISO_14517 = 802, ///< 5,25", M.O., 1273011 sectors, 1024 bytes/sector, ISO 14517, 2.6Gb/cart
ISO_14517_512 = 803, ///< 5,25", M.O., 2244958 sectors, 512 bytes/sector, ISO 14517, 2.3Gb/cart
ISO_15041_512 = 804, ///< 3,5", M.O., 1041500 sectors, 512 bytes/sector, ISO 15041, 540Mb/cart
HSM650 = 805, ///< 3,5", M.O., ??????? sectors, proprietary, 650Mb/cart, Sony HyperStorage
// Magneto-optical, types 800 to 819
// More floppy formats, types 820 to deprecated
MetaFloppy_Mod_I = 820, ///< 5.25", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, MFM, 48 tpi, ???rpm
HF12 = 823, ///< HyperFlex (12Mb), 5.25", DS, 301 tracks, 78 spt, 256 bytes/sector, MFM, 333 tpi, 600rpm
HF24 = 824, ///< HyperFlex (24Mb), 5.25", DS, 506 tracks, 78 spt, 256 bytes/sector, MFM, 666 tpi, 720rpm
// More floppy formats, types 820 to deprecated
AtariLynxCard = 821, ///< Atari Lynx card
AtariJaguarCartridge = 822 ///< Atari Jaguar cartridge
} MediaType;
/** @} */ /* end of MediaTypes group */
@@ -1008,7 +1060,7 @@ typedef enum
MiniDiscUTOC = 71, ///< User TOC, contains fragments, track names, and can be from 1 to 3 sectors of 2336 bytes
MiniDiscDTOC = 72, ///< Not entirely clear kind of TOC that only appears on MD-DATA discs
DVD_DiscKey_Decrypted = 73, ///< Decrypted DVD disc key,
MaxMediaTag = DVD_DiscKey_Decrypted
MaxMediaTag = DVD_DiscKey_Decrypted
} MediaTagType;
/** @} */ /* end of MediaTags group */

View File

@@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata>
<id>libaaruformat</id>
<version>1.0.0-alpha.12</version>
<version>1.0.0-alpha.14</version>
<description>Library for management of AaruFormat images.</description>
<authors>claunia</authors>
<projectUrl>https://github.com/aaru-dps/libaaruformat</projectUrl>

View File

@@ -3304,6 +3304,8 @@ static void write_metadata_block(aaruformat_context *ctx)
block_position = aligned_position;
}
memcpy(buffer, &ctx->metadata_block_header, sizeof(MetadataBlockHeader));
TRACE("Writing metadata block at position %ld", block_position);
if(fwrite(buffer, ctx->metadata_block_header.blockSize, 1, ctx->imageStream) == 1)

View File

@@ -217,26 +217,26 @@ int32_t process_ddt_v1(aaruformat_context *ctx, IndexEntry *entry, bool *found_u
break;
// TODO: Check CRC
case None:
#ifdef __linux__
TRACE("Memory mapping deduplication table at position %" PRIu64, entry->offset + sizeof(ddt_header));
ctx->mapped_memory_ddt_size = sizeof(uint64_t) * ddt_header.entries;
ctx->user_data_ddt = mmap(NULL, ctx->mapped_memory_ddt_size, PROT_READ, MAP_SHARED,
fileno(ctx->imageStream), entry->offset + sizeof(ddt_header));
if(ctx->user_data_ddt == MAP_FAILED)
ctx->user_data_ddt = (uint64_t *)malloc(ddt_header.length);
if(ctx->user_data_ddt == NULL)
{
*found_user_data_ddt = false;
FATAL("Could not read map deduplication table.");
TRACE("Cannot allocate memory for DDT, continuing...");
break;
}
ctx->in_memory_ddt = false;
read_bytes = fread(ctx->user_data_ddt, 1, ddt_header.entries * sizeof(uint64_t), ctx->imageStream);
if(read_bytes != ddt_header.entries * sizeof(uint64_t))
{
free(ctx->user_data_ddt);
TRACE("Could not read deduplication table, continuing...");
break;
}
ctx->in_memory_ddt = true;
*found_user_data_ddt = true;
break;
#else // TODO: Implement
TRACE("Uncompressed DDT not yet implemented...");
*found_user_data_ddt = false;
break;
#endif
default:
TRACE("Found unknown compression type %d, continuing...", ddt_header.compression);
*found_user_data_ddt = false;

View File

@@ -576,7 +576,18 @@ enum MediaType : u32
ODC1200RE = 783,
ODC1500R = 784,
ODC3300R = 785,
ODC5500R = 786
ODC5500R = 786,
ECMA_322_1k = 800,
ECMA_322_512 = 801,
ISO_14517 = 802,
ISO_14517_512 = 803,
ISO_15041_512 = 804,
HSM650 = 805,
MetaFloppy_Mod_I = 820,
HF12 = 823,
HF24 = 824,
};
enum CompressionType : u16

View File

@@ -24,14 +24,14 @@
char *byte_array_to_hex_string(const unsigned char *array, int array_size)
{
char *hex_string = NULL;
int j = 0;
int j = 0;
hex_string = malloc(array_size * 2 + 1);
if(hex_string == NULL) return NULL;
j = 0;
for (int i = 0; i < array_size; i++)
for(int i = 0; i < array_size; i++)
{
hex_string[j] = (array[i] >> 4) + '0';
if(hex_string[j] > '9') hex_string[j] += 0x7;
@@ -1109,6 +1109,84 @@ const char *media_type_to_string(MediaType type)
case VideoNowXp:
return "VideoNow XP";
// Iomega, types 750 to 759
case Bernoulli10:
return "Bernoulli Box (10Mb)";
case Bernoulli20:
return "Bernoulli Box (20Mb)";
case BernoulliBox2_20:
return "Bernoulli Box II (20Mb)";
// Kodak, types 760 to 769
case KodakVerbatim3:
return "Kodak/Verbatim (3Mb)";
case KodakVerbatim6:
return "Kodak/Verbatim (6Mb)";
case KodakVerbatim12:
return "Kodak/Verbatim (12Mb)";
// Sony and Panasonic Blu-ray derived, types 770 to 799
case ProfessionalDisc:
return "Professional Disc for video";
case ProfessionalDiscDual:
return "Professional Disc for video";
case ProfessionalDiscTriple:
return "Professional Disc for video";
case ProfessionalDiscQuad:
return "Professional Disc for video";
case PDD:
return "Professional Disc for DATA";
case PDD_WORM:
return "Professional Disc for DATA";
case ArchivalDisc:
return "Archival Disc";
case ArchivalDisc2:
return "Archival Disc";
case ArchivalDisc3:
return "Archival Disc";
case ODC300R:
return "Optical Disc archive";
case ODC300RE:
return "Optical Disc archive";
case ODC600R:
return "Optical Disc archive";
case ODC600RE:
return "Optical Disc archive";
case ODC1200RE:
return "Optical Disc archive";
case ODC1500R:
return "Optical Disc archive";
case ODC3300R:
return "Optical Disc archive";
case ODC5500R:
return "Optical Disc archive";
// Magneto-optical, types 800 to 819
case ECMA_322_1k:
return "5,25\", M.O., 4383356 sectors, 1024 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart";
case ECMA_322_512:
return "5,25\", M.O., ??????? sectors, 512 bytes/sector, ECMA-322, ISO 22092, 9.1Gb/cart";
case ISO_14517:
return "5,25\", M.O., 1273011 sectors, 1024 bytes/sector, ISO 14517, 2.6Gb/cart";
case ISO_14517_512:
return "5,25\", M.O., 2244958 sectors, 512 bytes/sector, ISO 14517, 2.3Gb/cart";
case ISO_15041_512:
return "3,5\", M.O., 1041500 sectors, 512 bytes/sector, ISO 15041, 540Mb/cart";
case HSM650:
return "Sony HyperStorage";
// More floppy formats, types 820 to deprecated
case MetaFloppy_Mod_I:
return "5.25\", SS, DD, 35 tracks, 16 spt, 256 bytes/sector, MFM, 48 tpi, ???rpm";
case HF12:
return "HyperFlex (12Mb)";
case HF24:
return "HyperFlex (24Mb)";
case AtariLynxCard:
return "Atari Lynx card";
case AtariJaguarCartridge:
return "Atari Jaguar cartridge";
default:
return "Unknown Media Type";
}

View File

@@ -576,16 +576,8 @@ int info(const char *path)
printf("\tImage contains %llu sectors\n", ctx->image_info.Sectors);
printf("\tBiggest sector is %d bytes\n", ctx->image_info.SectorSize);
printf("\tImage version: %s\n", ctx->image_info.Version);
if(ctx->image_info.Application != NULL)
{
strBuffer = malloc(65);
memset(strBuffer, 0, 65);
ucnv_convert(NULL, "UTF-16LE", strBuffer, 64, (const char *)ctx->image_info.Application, 64, &u_error_code);
if(u_error_code == U_ZERO_ERROR) printf("\tApplication: %s\n", strBuffer);
free(strBuffer);
}
printf("\tApplication: %s\n", ctx->image_info.Application);
if(ctx->image_info.ApplicationVersion != NULL)
printf("\tApplication version: %s\n", ctx->image_info.ApplicationVersion);
printf("\tCreation time: %s\n", format_filetime(ctx->image_info.CreationTime));