mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Reformat
This commit is contained in:
@@ -37,7 +37,8 @@
|
||||
|
||||
/** Magic identidier = "DICMFMT". */
|
||||
#define DIC_MAGIC 0x544D52464D434944
|
||||
/** Image format version. A change in this number indicates an incompatible change to the format that prevents older implementations from reading it correctly, if at all. */
|
||||
/** Image format version. A change in this number indicates an incompatible change to the format that prevents older
|
||||
* implementations from reading it correctly, if at all. */
|
||||
#define DICF_VERSION 1
|
||||
/** Maximum read cache size, 256MiB. */
|
||||
#define MAX_CACHE_SIZE 256 * 1024 * 1024
|
||||
@@ -59,6 +60,6 @@
|
||||
#define CRC64_ECMA_POLY 0xC96C5795D7870F42
|
||||
#define CRC64_ECMA_SEED 0xFFFFFFFFFFFFFFFF
|
||||
|
||||
#endif //LIBDICFORMAT_CONSTS_H
|
||||
#endif // LIBDICFORMAT_CONSTS_H
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
@@ -32,68 +32,68 @@
|
||||
#ifndef LIBDICFORMAT_CONTEXT_H
|
||||
#define LIBDICFORMAT_CONTEXT_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
typedef struct dicformatContext
|
||||
{
|
||||
uint64_t magic;
|
||||
uint8_t libraryMajorVersion;
|
||||
uint8_t libraryMinorVersion;
|
||||
FILE *imageStream;
|
||||
DicHeader header;
|
||||
struct dataLinkedList *mediaTagsHead;
|
||||
struct dataLinkedList *mediaTagsTail;
|
||||
uint8_t *sectorPrefix;
|
||||
uint8_t *sectorPrefixCorrected;
|
||||
uint8_t *sectorSuffix;
|
||||
uint8_t *sectorSuffixCorrected;
|
||||
uint8_t *sectorSubchannel;
|
||||
uint8_t *mode2Subheaders;
|
||||
uint8_t shift;
|
||||
bool inMemoryDdt;
|
||||
uint64_t *userDataDdt;
|
||||
size_t mappedMemoryDdtSize;
|
||||
uint32_t *sectorPrefixDdt;
|
||||
uint32_t *sectorSuffixDdt;
|
||||
GeometryBlockHeader geometryBlock;
|
||||
MetadataBlockHeader metadataBlockHeader;
|
||||
uint8_t *metadataBlock;
|
||||
TracksHeader tracksHeader;
|
||||
TrackEntry *trackEntries;
|
||||
CicmMetadataBlock cicmBlockHeader;
|
||||
uint8_t *cicmBlock;
|
||||
DumpHardwareHeader dumpHardwareHeader;
|
||||
uint64_t magic;
|
||||
uint8_t libraryMajorVersion;
|
||||
uint8_t libraryMinorVersion;
|
||||
FILE * imageStream;
|
||||
DicHeader header;
|
||||
struct dataLinkedList * mediaTagsHead;
|
||||
struct dataLinkedList * mediaTagsTail;
|
||||
uint8_t * sectorPrefix;
|
||||
uint8_t * sectorPrefixCorrected;
|
||||
uint8_t * sectorSuffix;
|
||||
uint8_t * sectorSuffixCorrected;
|
||||
uint8_t * sectorSubchannel;
|
||||
uint8_t * mode2Subheaders;
|
||||
uint8_t shift;
|
||||
bool inMemoryDdt;
|
||||
uint64_t * userDataDdt;
|
||||
size_t mappedMemoryDdtSize;
|
||||
uint32_t * sectorPrefixDdt;
|
||||
uint32_t * sectorSuffixDdt;
|
||||
GeometryBlockHeader geometryBlock;
|
||||
MetadataBlockHeader metadataBlockHeader;
|
||||
uint8_t * metadataBlock;
|
||||
TracksHeader tracksHeader;
|
||||
TrackEntry * trackEntries;
|
||||
CicmMetadataBlock cicmBlockHeader;
|
||||
uint8_t * cicmBlock;
|
||||
DumpHardwareHeader dumpHardwareHeader;
|
||||
struct DumpHardwareEntriesWithData *dumpHardwareEntriesWithData;
|
||||
struct ImageInfo imageInfo;
|
||||
CdEccContext *eccCdContext;
|
||||
uint8_t numberOfDataTracks;
|
||||
TrackEntry *dataTracks;
|
||||
bool *readableSectorTags;
|
||||
struct ImageInfo imageInfo;
|
||||
CdEccContext * eccCdContext;
|
||||
uint8_t numberOfDataTracks;
|
||||
TrackEntry * dataTracks;
|
||||
bool * readableSectorTags;
|
||||
} dicformatContext;
|
||||
|
||||
typedef struct dataLinkedList
|
||||
{
|
||||
struct dataLinkedList *previous;
|
||||
struct dataLinkedList *next;
|
||||
uint8_t *data;
|
||||
int32_t type;
|
||||
uint32_t length;
|
||||
uint8_t * data;
|
||||
int32_t type;
|
||||
uint32_t length;
|
||||
} dataLinkedList;
|
||||
|
||||
typedef struct DumpHardwareEntriesWithData
|
||||
{
|
||||
DumpHardwareEntry entry;
|
||||
DumpHardwareEntry entry;
|
||||
struct DumpExtent *extents;
|
||||
uint8_t *manufacturer;
|
||||
uint8_t *model;
|
||||
uint8_t *revision;
|
||||
uint8_t *firmware;
|
||||
uint8_t *serial;
|
||||
uint8_t *softwareName;
|
||||
uint8_t *softwareVersion;
|
||||
uint8_t *softwareOperatingSystem;
|
||||
uint8_t * manufacturer;
|
||||
uint8_t * model;
|
||||
uint8_t * revision;
|
||||
uint8_t * firmware;
|
||||
uint8_t * serial;
|
||||
uint8_t * softwareName;
|
||||
uint8_t * softwareVersion;
|
||||
uint8_t * softwareOperatingSystem;
|
||||
} DumpHardwareEntriesWithData;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
@@ -106,4 +106,4 @@ typedef struct DumpExtent
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif //LIBDICFORMAT_CONTEXT_H
|
||||
#endif // LIBDICFORMAT_CONTEXT_H
|
||||
|
||||
@@ -33,9 +33,9 @@
|
||||
#ifndef LIBDICFORMAT_DECLS_H
|
||||
#define LIBDICFORMAT_DECLS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
int identify(const char *filename);
|
||||
|
||||
@@ -71,37 +71,37 @@ bool ecc_cd_is_suffix_correct(void *context, const uint8_t *sector);
|
||||
|
||||
bool ecc_cd_is_suffix_correct_mode2(void *context, const uint8_t *sector);
|
||||
|
||||
bool ecc_cd_check(void *context,
|
||||
bool ecc_cd_check(void * context,
|
||||
const uint8_t *address,
|
||||
const uint8_t *data,
|
||||
uint32_t majorCount,
|
||||
uint32_t minorCount,
|
||||
uint32_t majorMult,
|
||||
uint32_t minorInc,
|
||||
uint32_t majorCount,
|
||||
uint32_t minorCount,
|
||||
uint32_t majorMult,
|
||||
uint32_t minorInc,
|
||||
const uint8_t *ecc,
|
||||
int32_t addressOffset,
|
||||
int32_t dataOffset,
|
||||
int32_t eccOffset);
|
||||
int32_t addressOffset,
|
||||
int32_t dataOffset,
|
||||
int32_t eccOffset);
|
||||
|
||||
void ecc_cd_write(void *context,
|
||||
void ecc_cd_write(void * context,
|
||||
const uint8_t *address,
|
||||
const uint8_t *data,
|
||||
uint32_t majorCount,
|
||||
uint32_t minorCount,
|
||||
uint32_t majorMult,
|
||||
uint32_t minorInc,
|
||||
uint8_t *ecc,
|
||||
int32_t addressOffset,
|
||||
int32_t dataOffset,
|
||||
int32_t eccOffset);
|
||||
uint32_t majorCount,
|
||||
uint32_t minorCount,
|
||||
uint32_t majorMult,
|
||||
uint32_t minorInc,
|
||||
uint8_t * ecc,
|
||||
int32_t addressOffset,
|
||||
int32_t dataOffset,
|
||||
int32_t eccOffset);
|
||||
|
||||
void ecc_cd_write_sector(void *context,
|
||||
void ecc_cd_write_sector(void * context,
|
||||
const uint8_t *address,
|
||||
const uint8_t *data,
|
||||
uint8_t *ecc,
|
||||
int32_t addressOffset,
|
||||
int32_t dataOffset,
|
||||
int32_t eccOffset);
|
||||
uint8_t * ecc,
|
||||
int32_t addressOffset,
|
||||
int32_t dataOffset,
|
||||
int32_t eccOffset);
|
||||
|
||||
void cd_lba_to_msf(int64_t pos, uint8_t *minute, uint8_t *second, uint8_t *frame);
|
||||
|
||||
@@ -117,4 +117,4 @@ int32_t GetMediaTagTypeForDataType(int32_t type);
|
||||
|
||||
int32_t GetXmlMediaType(int32_t type);
|
||||
|
||||
#endif //LIBDICFORMAT_DECLS_H
|
||||
#endif // LIBDICFORMAT_DECLS_H
|
||||
|
||||
@@ -7,211 +7,215 @@
|
||||
typedef enum
|
||||
{
|
||||
/** Not compressed */
|
||||
None = 0, /** LZMA */
|
||||
Lzma = 1, /** FLAC */
|
||||
Flac = 2, /** LZMA in Claunia Subchannel Transform processed data */
|
||||
LzmaClauniaSubchannelTransform = 3
|
||||
None = 0, /** LZMA */
|
||||
Lzma = 1, /** FLAC */
|
||||
Flac = 2, /** LZMA in Claunia Subchannel Transform processed data */
|
||||
LzmaClauniaSubchannelTransform = 3
|
||||
} CompressionType;
|
||||
|
||||
/** List of known data types */
|
||||
typedef enum
|
||||
{
|
||||
/** No data */
|
||||
NoData = 0,
|
||||
NoData = 0,
|
||||
/** User data */
|
||||
UserData = 1,
|
||||
UserData = 1,
|
||||
/** CompactDisc partial Table of Contents */
|
||||
CompactDiscPartialToc = 2,
|
||||
CompactDiscPartialToc = 2,
|
||||
/** CompactDisc session information */
|
||||
CompactDiscSessionInfo = 3,
|
||||
CompactDiscSessionInfo = 3,
|
||||
/** CompactDisc Table of Contents */
|
||||
CompactDiscToc = 4,
|
||||
CompactDiscToc = 4,
|
||||
/** CompactDisc Power Management Area */
|
||||
CompactDiscPma = 5,
|
||||
CompactDiscPma = 5,
|
||||
/** CompactDisc Absolute Time In Pregroove */
|
||||
CompactDiscAtip = 6,
|
||||
CompactDiscAtip = 6,
|
||||
/** CompactDisc Lead-in's CD-Text */
|
||||
CompactDiscLeadInCdText = 7,
|
||||
CompactDiscLeadInCdText = 7,
|
||||
/** DVD Physical Format Information */
|
||||
DvdPfi = 8,
|
||||
DvdPfi = 8,
|
||||
/** DVD Lead-in's Copyright Management Information */
|
||||
DvdLeadInCmi = 9,
|
||||
DvdLeadInCmi = 9,
|
||||
/** DVD Disc Key */
|
||||
DvdDiscKey = 10,
|
||||
DvdDiscKey = 10,
|
||||
/** DVD Burst Cutting Area */
|
||||
DvdBca = 11,
|
||||
DvdBca = 11,
|
||||
/** DVD DMI */
|
||||
DvdDmi = 12,
|
||||
DvdDmi = 12,
|
||||
/** DVD Media Identifier */
|
||||
DvdMediaIdentifier = 13,
|
||||
DvdMediaIdentifier = 13,
|
||||
/** DVD Media Key Block */
|
||||
DvdMediaKeyBlock = 14,
|
||||
DvdMediaKeyBlock = 14,
|
||||
/** DVD-RAM Disc Definition Structure */
|
||||
DvdRamDds = 15,
|
||||
DvdRamDds = 15,
|
||||
/** DVD-RAM Medium Status */
|
||||
DvdRamMediumStatus = 16,
|
||||
DvdRamMediumStatus = 16,
|
||||
/** DVD-RAM Spare Area Information */
|
||||
DvdRamSpareArea = 17,
|
||||
DvdRamSpareArea = 17,
|
||||
/** DVD-R RMD */
|
||||
DvdRRmd = 18,
|
||||
DvdRRmd = 18,
|
||||
/** DVD-R Pre-recorded Information */
|
||||
DvdRPrerecordedInfo = 19,
|
||||
DvdRPrerecordedInfo = 19,
|
||||
/** DVD-R Media Identifier */
|
||||
DvdRMediaIdentifier = 20,
|
||||
DvdRMediaIdentifier = 20,
|
||||
/** DVD-R Physical Format Information */
|
||||
DvdRPfi = 21,
|
||||
DvdRPfi = 21,
|
||||
/** DVD ADress In Pregroove */
|
||||
DvdAdip = 22,
|
||||
DvdAdip = 22,
|
||||
/** HD DVD Copy Protection Information */
|
||||
HdDvdCpi = 23,
|
||||
HdDvdCpi = 23,
|
||||
/** HD DVD Medium Status */
|
||||
HdDvdMediumStatus = 24,
|
||||
HdDvdMediumStatus = 24,
|
||||
/** DVD DL Layer Capacity */
|
||||
DvdDlLayerCapacity = 25,
|
||||
DvdDlLayerCapacity = 25,
|
||||
/** DVD DL Middle Zone Address */
|
||||
DvdDlMiddleZoneAddress = 26,
|
||||
DvdDlMiddleZoneAddress = 26,
|
||||
/** DVD DL Jump Interval Size */
|
||||
DvdDlJumpIntervalSize = 27,
|
||||
DvdDlJumpIntervalSize = 27,
|
||||
/** DVD DL Manual Layer Jump LBA */
|
||||
DvdDlManualLayerJumpLba = 28,
|
||||
DvdDlManualLayerJumpLba = 28,
|
||||
/** Bluray Disc Information */
|
||||
BlurayDi = 29,
|
||||
BlurayDi = 29,
|
||||
/** Bluray Burst Cutting Area */
|
||||
BlurayBca = 30,
|
||||
BlurayBca = 30,
|
||||
/** Bluray Disc Definition Structure */
|
||||
BlurayDds = 31,
|
||||
BlurayDds = 31,
|
||||
/** Bluray Cartridge Status */
|
||||
BlurayCartridgeStatus = 32,
|
||||
BlurayCartridgeStatus = 32,
|
||||
/** Bluray Spare Area Information */
|
||||
BluraySpareArea = 33,
|
||||
BluraySpareArea = 33,
|
||||
/** AACS Volume Identifier */
|
||||
AacsVolumeIdentifier = 34,
|
||||
AacsVolumeIdentifier = 34,
|
||||
/** AACS Serial Number */
|
||||
AacsSerialNumber = 35,
|
||||
AacsSerialNumber = 35,
|
||||
/** AACS Media Identifier */
|
||||
AacsMediaIdentifier = 36,
|
||||
AacsMediaIdentifier = 36,
|
||||
/** AACS Media Key Block */
|
||||
AacsMediaKeyBlock = 37,
|
||||
AacsMediaKeyBlock = 37,
|
||||
/** AACS Data Keys */
|
||||
AacsDataKeys = 38,
|
||||
AacsDataKeys = 38,
|
||||
/** AACS LBA Extents */
|
||||
AacsLbaExtents = 39,
|
||||
AacsLbaExtents = 39,
|
||||
/** CPRM Media Key Block */
|
||||
CprmMediaKeyBlock = 40,
|
||||
CprmMediaKeyBlock = 40,
|
||||
/** Recognized Layers */
|
||||
HybridRecognizedLayers = 41,
|
||||
HybridRecognizedLayers = 41,
|
||||
/** MMC Write Protection */
|
||||
ScsiMmcWriteProtection = 42,
|
||||
ScsiMmcWriteProtection = 42,
|
||||
/** MMC Disc Information */
|
||||
ScsiMmcDiscInformation = 43,
|
||||
ScsiMmcDiscInformation = 43,
|
||||
/** MMC Track Resources Information */
|
||||
ScsiMmcTrackResourcesInformation = 44,
|
||||
ScsiMmcTrackResourcesInformation = 44,
|
||||
/** MMC POW Resources Information */
|
||||
ScsiMmcPowResourcesInformation = 45,
|
||||
ScsiMmcPowResourcesInformation = 45,
|
||||
/** SCSI INQUIRY RESPONSE */
|
||||
ScsiInquiry = 46,
|
||||
ScsiInquiry = 46,
|
||||
/** SCSI MODE PAGE 2Ah */
|
||||
ScsiModePage2A = 47,
|
||||
ScsiModePage2A = 47,
|
||||
/** ATA IDENTIFY response */
|
||||
AtaIdentify = 48,
|
||||
AtaIdentify = 48,
|
||||
/** ATAPI IDENTIFY response */
|
||||
AtapiIdentify = 49,
|
||||
AtapiIdentify = 49,
|
||||
/** PCMCIA CIS */
|
||||
PcmciaCis = 50,
|
||||
PcmciaCis = 50,
|
||||
/** SecureDigital CID */
|
||||
SecureDigitalCid = 51,
|
||||
SecureDigitalCid = 51,
|
||||
/** SecureDigital CSD */
|
||||
SecureDigitalCsd = 52,
|
||||
SecureDigitalCsd = 52,
|
||||
/** SecureDigital SCR */
|
||||
SecureDigitalScr = 53,
|
||||
SecureDigitalScr = 53,
|
||||
/** SecureDigital OCR */
|
||||
SecureDigitalOcr = 54,
|
||||
SecureDigitalOcr = 54,
|
||||
/** MultiMediaCard CID */
|
||||
MultiMediaCardCid = 55,
|
||||
MultiMediaCardCid = 55,
|
||||
/** MultiMediaCard CSD */
|
||||
MultiMediaCardCsd = 56,
|
||||
MultiMediaCardCsd = 56,
|
||||
/** MultiMediaCard OCR */
|
||||
MultiMediaCardOcr = 57,
|
||||
MultiMediaCardOcr = 57,
|
||||
/** MultiMediaCard Extended CSD */
|
||||
MultiMediaCardExtendedCsd = 58,
|
||||
MultiMediaCardExtendedCsd = 58,
|
||||
/** Xbox Security Sector */
|
||||
XboxSecuritySector = 59,
|
||||
XboxSecuritySector = 59,
|
||||
/** Floppy Lead-out */
|
||||
FloppyLeadOut = 60,
|
||||
FloppyLeadOut = 60,
|
||||
/** Dvd Disc Control Block */
|
||||
DvdDiscControlBlock = 61,
|
||||
DvdDiscControlBlock = 61,
|
||||
/** CompactDisc First track pregap */
|
||||
CompactDiscFirstTrackPregap = 62,
|
||||
CompactDiscFirstTrackPregap = 62,
|
||||
/** CompactDisc Lead-out */
|
||||
CompactDiscLeadOut = 63,
|
||||
CompactDiscLeadOut = 63,
|
||||
/** SCSI MODE SENSE (6) response */
|
||||
ScsiModeSense6 = 64,
|
||||
ScsiModeSense6 = 64,
|
||||
/** SCSI MODE SENSE (10) response */
|
||||
ScsiModeSense10 = 65,
|
||||
ScsiModeSense10 = 65,
|
||||
/** USB descriptors */
|
||||
UsbDescriptors = 66,
|
||||
UsbDescriptors = 66,
|
||||
/** Xbox DMI */
|
||||
XboxDmi = 67,
|
||||
XboxDmi = 67,
|
||||
/** Xbox Physical Format Information */
|
||||
XboxPfi = 68,
|
||||
XboxPfi = 68,
|
||||
/** CompactDisc sector prefix (sync, header */
|
||||
CdSectorPrefix = 69,
|
||||
CdSectorPrefix = 69,
|
||||
/** CompactDisc sector suffix (edc, ecc p, ecc q) */
|
||||
CdSectorSuffix = 70,
|
||||
CdSectorSuffix = 70,
|
||||
/** CompactDisc subchannel */
|
||||
CdSectorSubchannel = 71,
|
||||
CdSectorSubchannel = 71,
|
||||
/** Apple Profile (20 byte) tag */
|
||||
AppleProfileTag = 72,
|
||||
AppleProfileTag = 72,
|
||||
/** Apple Sony (12 byte) tag */
|
||||
AppleSonyTag = 73,
|
||||
AppleSonyTag = 73,
|
||||
/** Priam Data Tower (24 byte) tag */
|
||||
PriamDataTowerTag = 74,
|
||||
PriamDataTowerTag = 74,
|
||||
/** CompactDisc Media Catalogue Number (as in Lead-in), 13 bytes, ASCII */
|
||||
CompactDiscMediaCatalogueNumber = 75,
|
||||
CompactDiscMediaCatalogueNumber = 75,
|
||||
/** CompactDisc sector prefix (sync, header), only incorrect stored */
|
||||
CdSectorPrefixCorrected = 76,
|
||||
CdSectorPrefixCorrected = 76,
|
||||
/** CompactDisc sector suffix (edc, ecc p, ecc q), only incorrect stored */
|
||||
CdSectorSuffixCorrected = 77,
|
||||
CdSectorSuffixCorrected = 77,
|
||||
/** CompactDisc MODE 2 subheader */
|
||||
CompactDiscMode2Subheader = 78,
|
||||
CompactDiscMode2Subheader = 78,
|
||||
/** CompactDisc Lead-in */
|
||||
CompactDiscLeadIn = 79
|
||||
CompactDiscLeadIn = 79
|
||||
} DataType;
|
||||
|
||||
/** List of known blocks types */
|
||||
typedef enum
|
||||
{
|
||||
/** Block containing data */
|
||||
DataBlock = 0x4B4C4244,
|
||||
DataBlock = 0x4B4C4244,
|
||||
/** Block containing a deduplication table */
|
||||
DeDuplicationTable = 0X2A544444,
|
||||
DeDuplicationTable = 0X2A544444,
|
||||
/** Block containing the index */
|
||||
IndexBlock = 0X58444E49,
|
||||
IndexBlock = 0X58444E49,
|
||||
/** Block containing logical geometry */
|
||||
GeometryBlock = 0x4D4F4547,
|
||||
GeometryBlock = 0x4D4F4547,
|
||||
/** Block containing metadata */
|
||||
MetadataBlock = 0x4154454D,
|
||||
MetadataBlock = 0x4154454D,
|
||||
/** Block containing optical disc tracks */
|
||||
TracksBlock = 0x534B5254,
|
||||
TracksBlock = 0x534B5254,
|
||||
/** Block containing CICM XML metadata */
|
||||
CicmBlock = 0x4D434943,
|
||||
CicmBlock = 0x4D434943,
|
||||
/** Block containing contents checksums */
|
||||
ChecksumBlock = 0x4D534B43,
|
||||
ChecksumBlock = 0x4D534B43,
|
||||
/** TODO: Block containing data position measurements */
|
||||
DataPositionMeasurementBlock = 0x2A4D5044,
|
||||
DataPositionMeasurementBlock = 0x2A4D5044,
|
||||
/** TODO: Block containing a snapshot index */
|
||||
SnapshotBlock = 0x50414E53,
|
||||
SnapshotBlock = 0x50414E53,
|
||||
/** TODO: Block containing how to locate the parent image */
|
||||
ParentBlock = 0x50524E54,
|
||||
ParentBlock = 0x50524E54,
|
||||
/** Block containing an array of hardware used to create the image */
|
||||
DumpHardwareBlock = 0x2A504D44,
|
||||
DumpHardwareBlock = 0x2A504D44,
|
||||
/** TODO: Block containing list of files for a tape image */
|
||||
TapeFileBlock = 0x454C4654
|
||||
TapeFileBlock = 0x454C4654
|
||||
} BlockType;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
Invalid = 0, Md5 = 1, Sha1 = 2, Sha256 = 3, SpamSum = 4
|
||||
Invalid = 0,
|
||||
Md5 = 1,
|
||||
Sha1 = 2,
|
||||
Sha256 = 3,
|
||||
SpamSum = 4
|
||||
} ChecksumAlgorithm;
|
||||
|
||||
typedef enum
|
||||
@@ -227,12 +231,12 @@ typedef enum
|
||||
typedef enum
|
||||
{
|
||||
/** Audio track */
|
||||
Audio = 0, /** Data track (not any of the below defined ones) */
|
||||
Data = 1, /** Data track, compact disc mode 1 */
|
||||
CdMode1 = 2, /** Data track, compact disc mode 2, formless */
|
||||
CdMode2Formless = 3, /** Data track, compact disc mode 2, form 1 */
|
||||
CdMode2Form1 = 4, /** Data track, compact disc mode 2, form 2 */
|
||||
CdMode2Form2 = 5
|
||||
Audio = 0, /** Data track (not any of the below defined ones) */
|
||||
Data = 1, /** Data track, compact disc mode 1 */
|
||||
CdMode1 = 2, /** Data track, compact disc mode 2, formless */
|
||||
CdMode2Formless = 3, /** Data track, compact disc mode 2, form 1 */
|
||||
CdMode2Form1 = 4, /** Data track, compact disc mode 2, form 2 */
|
||||
CdMode2Form2 = 5
|
||||
} TrackType;
|
||||
|
||||
typedef enum
|
||||
@@ -248,19 +252,19 @@ typedef enum
|
||||
/**
|
||||
* Purely optical discs
|
||||
*/
|
||||
OpticalDisc = 0, /**
|
||||
* Media that is physically block-based or abstracted like that
|
||||
OpticalDisc = 0, /**
|
||||
* Media that is physically block-based or abstracted like that
|
||||
|
||||
*/
|
||||
BlockMedia = 1, /**
|
||||
* Media that can be accessed by-byte or by-bit, like chips
|
||||
*/
|
||||
LinearMedia = 2, /**
|
||||
* Media that can only store data when it is modulated to audio
|
||||
*/
|
||||
AudioMedia = 3
|
||||
*/
|
||||
BlockMedia = 1, /**
|
||||
* Media that can be accessed by-byte or by-bit, like chips
|
||||
*/
|
||||
LinearMedia = 2, /**
|
||||
* Media that can only store data when it is modulated to audio
|
||||
*/
|
||||
AudioMedia = 3
|
||||
} XmlMediaType;
|
||||
|
||||
#endif //LIBDICFORMAT_ENUMS_H
|
||||
#endif // LIBDICFORMAT_ENUMS_H
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
@@ -27,4 +27,4 @@
|
||||
#define DICF_STATUS_SECTOR_WITH_ERRORS 2
|
||||
#define DICF_STATUS_SECTOR_DELETED 3
|
||||
|
||||
#endif //LIBDICFORMAT_ERRORS_H
|
||||
#endif // LIBDICFORMAT_ERRORS_H
|
||||
|
||||
@@ -37,34 +37,35 @@
|
||||
|
||||
#pragma pack(push, 1)
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <dic.h>
|
||||
#include "enums.h"
|
||||
|
||||
#include <dic.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/**Header, at start of file */
|
||||
typedef struct DicHeader
|
||||
{
|
||||
/**Header identifier, <see cref="DIC_MAGIC" /> */
|
||||
uint64_t identifier;
|
||||
/**UTF-16LE name of the application that created the image */
|
||||
uint8_t application[64];
|
||||
uint8_t application[64];
|
||||
/**Image format major version. A new major version means a possibly incompatible change of format */
|
||||
uint8_t imageMajorVersion;
|
||||
uint8_t imageMajorVersion;
|
||||
/**Image format minor version. A new minor version indicates a compatible change of format */
|
||||
uint8_t imageMinorVersion;
|
||||
uint8_t imageMinorVersion;
|
||||
/**Major version of the application that created the image */
|
||||
uint8_t applicationMajorVersion;
|
||||
uint8_t applicationMajorVersion;
|
||||
/**Minor version of the application that created the image */
|
||||
uint8_t applicationMinorVersion;
|
||||
uint8_t applicationMinorVersion;
|
||||
/**Type of media contained on image */
|
||||
uint32_t mediaType;
|
||||
/**Offset to index */
|
||||
uint64_t indexOffset;
|
||||
/**Windows filetime (100 nanoseconds since 1601/01/01 00:00:00 UTC) of image creation time */
|
||||
int64_t creationTime;
|
||||
int64_t creationTime;
|
||||
/**Windows filetime (100 nanoseconds since 1601/01/01 00:00:00 UTC) of image last written time */
|
||||
int64_t lastWrittenTime;
|
||||
int64_t lastWrittenTime;
|
||||
} DicHeader;
|
||||
|
||||
/**Header for a deduplication table. Table follows it */
|
||||
@@ -77,7 +78,7 @@ typedef struct DdtHeader
|
||||
/**Compression algorithm used to compress the DDT */
|
||||
uint16_t compression;
|
||||
/**Each entry is ((uint8_t offset in file) << shift) + (sector offset in block) */
|
||||
uint8_t shift;
|
||||
uint8_t shift;
|
||||
/**How many entries are in the table */
|
||||
uint64_t entries;
|
||||
/**Compressed length for the DDT */
|
||||
@@ -151,9 +152,9 @@ typedef struct MetadataBlockHeader
|
||||
/**Size in uint8_ts of this whole metadata block */
|
||||
uint32_t blockSize;
|
||||
/**Sequence of media set this media beint64_ts to */
|
||||
int32_t mediaSequence;
|
||||
int32_t mediaSequence;
|
||||
/**Total number of media on the media set this media beint64_ts to */
|
||||
int32_t lastMediaSequence;
|
||||
int32_t lastMediaSequence;
|
||||
/**Offset to start of creator string from start of this block */
|
||||
uint32_t creatorOffset;
|
||||
/**Length in uint8_ts of the null-terminated UTF-16LE creator string */
|
||||
@@ -291,14 +292,14 @@ typedef struct ChecksumHeader
|
||||
/**Length in uint8_ts of the block */
|
||||
uint32_t length;
|
||||
/**How many checksums follow */
|
||||
uint8_t entries;
|
||||
uint8_t entries;
|
||||
} ChecksumHeader;
|
||||
|
||||
/**Checksum entry, followed by checksum data itself */
|
||||
typedef struct ChecksumEntry
|
||||
{
|
||||
/**Checksum algorithm */
|
||||
uint8_t type;
|
||||
uint8_t type;
|
||||
/**Length in uint8_ts of checksum that follows this structure */
|
||||
uint32_t length;
|
||||
} ChecksumEntry;
|
||||
@@ -312,14 +313,14 @@ typedef struct Crc64Context
|
||||
|
||||
typedef struct CdEccContext
|
||||
{
|
||||
bool initedEdc;
|
||||
uint8_t *eccBTable;
|
||||
uint8_t *eccFTable;
|
||||
bool initedEdc;
|
||||
uint8_t * eccBTable;
|
||||
uint8_t * eccFTable;
|
||||
uint32_t *edcTable;
|
||||
} CdEccContext;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
#endif //LIBDICFORMAT_STRUCTS_H
|
||||
#endif // LIBDICFORMAT_STRUCTS_H
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
Reference in New Issue
Block a user