Loading...
Searching...
No Matches
helpers.c
Go to the documentation of this file.
/*
* This file is part of the Aaru Data Preservation Suite.
* Copyright (c) 2019-2026 Natalia Portillo.
*
* 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/>.
*/
#if defined(_WIN32) || defined(_WIN64)
#include <windows.h>
#include <wincrypt.h>
#endif
#include <aaru.h>
#include <aaruformat.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
AARU_LOCAL int32_t AARU_CALL aaruf_get_media_tag_type_for_datatype(const int32_t type)
{
switch(type)
{
case CompactDiscPartialToc:
return CD_TOC;
case CompactDiscSessionInfo:
return CD_SessionInfo;
case CompactDiscToc:
return CD_FullTOC;
case CompactDiscPma:
return CD_PMA;
case CompactDiscAtip:
return CD_ATIP;
case CompactDiscLeadInCdText:
return CD_TEXT;
case DvdPfi:
return DVD_PFI;
case DvdPfi2ndLayer:
return DVD_PFI_2ndLayer;
case DvdLeadInCmi:
return DVD_CMI;
case DvdDiscKey:
return DVD_DiscKey;
case DvdBca:
return DVD_BCA;
case DvdDmi:
return DVD_DMI;
case DvdMediaIdentifier:
return DVD_MediaIdentifier;
case DvdMediaKeyBlock:
return DVD_MKB;
case DvdRamDds:
return DVDRAM_DDS;
case DvdRamMediumStatus:
return DVDRAM_MediumStatus;
case DvdRamSpareArea:
return DVDRAM_SpareArea;
case DvdRRmd:
return DVDR_RMD;
case DvdRPrerecordedInfo:
return DVDR_PreRecordedInfo;
case DvdRMediaIdentifier:
return DVDR_MediaIdentifier;
case DvdRPfi:
return DVDR_PFI;
case DvdAdip:
return DVD_ADIP;
case HdDvdCpi:
return HDDVD_CPI;
case HdDvdMediumStatus:
return HDDVD_MediumStatus;
case DvdDlLayerCapacity:
return DVDDL_LayerCapacity;
case DvdDlMiddleZoneAddress:
return DVDDL_MiddleZoneAddress;
case DvdDlJumpIntervalSize:
return DVDDL_JumpIntervalSize;
case DvdDlManualLayerJumpLba:
return DVDDL_ManualLayerJumpLBA;
case BlurayDi:
return BD_DI;
case BlurayBca:
return BD_BCA;
case BlurayDds:
return BD_DDS;
case BlurayCartridgeStatus:
return BD_CartridgeStatus;
case BluraySpareArea:
return BD_SpareArea;
case AacsVolumeIdentifier:
return AACS_VolumeIdentifier;
case AacsSerialNumber:
return AACS_SerialNumber;
case AacsMediaIdentifier:
return AACS_MediaIdentifier;
case AacsMediaKeyBlock:
return AACS_MKB;
case AacsDataKeys:
return AACS_DataKeys;
case AacsLbaExtents:
return AACS_LBAExtents;
case CprmMediaKeyBlock:
return AACS_CPRM_MKB;
case HybridRecognizedLayers:
return Hybrid_RecognizedLayers;
case ScsiMmcWriteProtection:
return MMC_WriteProtection;
case ScsiMmcDiscInformation:
return MMC_DiscInformation;
case ScsiMmcTrackResourcesInformation:
return MMC_TrackResourcesInformation;
case ScsiMmcPowResourcesInformation:
return MMC_POWResourcesInformation;
case ScsiInquiry:
return SCSI_INQUIRY;
case ScsiModePage2A:
return SCSI_MODEPAGE_2A;
case AtaIdentify:
return ATA_IDENTIFY;
case AtapiIdentify:
return ATAPI_IDENTIFY;
case PcmciaCis:
return PCMCIA_CIS;
case SecureDigitalCid:
return SD_CID;
case SecureDigitalCsd:
return SD_CSD;
case SecureDigitalScr:
return SD_SCR;
case SecureDigitalOcr:
return SD_OCR;
case MultiMediaCardCid:
return MMC_CID;
case MultiMediaCardCsd:
return MMC_CSD;
case MultiMediaCardOcr:
return MMC_OCR;
case MultiMediaCardExtendedCsd:
return MMC_ExtendedCSD;
case XboxSecuritySector:
return Xbox_SecuritySector;
case FloppyLeadOut:
return Floppy_LeadOut;
case DvdDiscControlBlock:
return DiscControlBlock;
case CompactDiscFirstTrackPregap:
return CD_FirstTrackPregap;
case CompactDiscLeadOut:
return CD_LeadOut;
case ScsiModeSense6:
return SCSI_MODESENSE_6;
case ScsiModeSense10:
return SCSI_MODESENSE_10;
case UsbDescriptors:
return USB_Descriptors;
case XboxDmi:
return Xbox_DMI;
case XboxPfi:
return Xbox_PFI;
case CompactDiscMediaCatalogueNumber:
return CD_MCN;
case CompactDiscLeadIn:
return CD_LeadIn;
case DvdDiscKeyDecrypted:
return DVD_DiscKey_Decrypted;
default:
return -1;
}
}
AARU_LOCAL int32_t AARU_CALL aaruf_get_datatype_for_media_tag_type(const int32_t tag_type)
{
switch(tag_type)
{
case CD_TOC:
return CompactDiscPartialToc;
case CD_SessionInfo:
return CompactDiscSessionInfo;
case CD_FullTOC:
return CompactDiscToc;
case CD_PMA:
return CompactDiscPma;
case CD_ATIP:
return CompactDiscAtip;
case CD_TEXT:
return CompactDiscLeadInCdText;
case DVD_PFI:
return DvdPfi;
case DVD_PFI_2ndLayer:
return DvdPfi2ndLayer;
case DVD_CMI:
return DvdLeadInCmi;
case DVD_DiscKey:
return DvdDiscKey;
case DVD_BCA:
return DvdBca;
case DVD_DMI:
return DvdDmi;
case DVD_MediaIdentifier:
return DvdMediaIdentifier;
case DVD_MKB:
return DvdMediaKeyBlock;
case DVDRAM_DDS:
return DvdRamDds;
case DVDRAM_MediumStatus:
return DvdRamMediumStatus;
case DVDRAM_SpareArea:
return DvdRamSpareArea;
case DVDR_RMD:
return DvdRRmd;
case DVDR_PreRecordedInfo:
return DvdRPrerecordedInfo;
case DVDR_MediaIdentifier:
return DvdRMediaIdentifier;
case DVDR_PFI:
return DvdRPfi;
case DVD_ADIP:
return DvdAdip;
case HDDVD_CPI:
return HdDvdCpi;
case HDDVD_MediumStatus:
return HdDvdMediumStatus;
case DVDDL_LayerCapacity:
return DvdDlLayerCapacity;
case DVDDL_MiddleZoneAddress:
return DvdDlMiddleZoneAddress;
case DVDDL_JumpIntervalSize:
return DvdDlJumpIntervalSize;
case DVDDL_ManualLayerJumpLBA:
return DvdDlManualLayerJumpLba;
case BD_DI:
return BlurayDi;
case BD_BCA:
return BlurayBca;
case BD_DDS:
return BlurayDds;
case BD_CartridgeStatus:
return BlurayCartridgeStatus;
case BD_SpareArea:
return BluraySpareArea;
case AACS_VolumeIdentifier:
return AacsVolumeIdentifier;
case AACS_SerialNumber:
return AacsSerialNumber;
case AACS_MediaIdentifier:
return AacsMediaIdentifier;
case AACS_MKB:
return AacsMediaKeyBlock;
case AACS_DataKeys:
return AacsDataKeys;
case AACS_LBAExtents:
return AacsLbaExtents;
case AACS_CPRM_MKB:
return CprmMediaKeyBlock;
case Hybrid_RecognizedLayers:
return HybridRecognizedLayers;
case MMC_WriteProtection:
return ScsiMmcWriteProtection;
case MMC_DiscInformation:
return ScsiMmcDiscInformation;
case MMC_TrackResourcesInformation:
return ScsiMmcTrackResourcesInformation;
case MMC_POWResourcesInformation:
return ScsiMmcPowResourcesInformation;
case SCSI_INQUIRY:
return ScsiInquiry;
case SCSI_MODEPAGE_2A:
return ScsiModePage2A;
case ATA_IDENTIFY:
return AtaIdentify;
case ATAPI_IDENTIFY:
return AtapiIdentify;
case PCMCIA_CIS:
return PcmciaCis;
case SD_CID:
return SecureDigitalCid;
case SD_CSD:
return SecureDigitalCsd;
case SD_SCR:
return SecureDigitalScr;
case SD_OCR:
return SecureDigitalOcr;
case MMC_CID:
return MultiMediaCardCid;
case MMC_CSD:
return MultiMediaCardCsd;
case MMC_OCR:
return MultiMediaCardOcr;
case MMC_ExtendedCSD:
return MultiMediaCardExtendedCsd;
case Xbox_SecuritySector:
return XboxSecuritySector;
case Floppy_LeadOut:
return FloppyLeadOut;
case DiscControlBlock:
return DvdDiscControlBlock;
case CD_FirstTrackPregap:
return CompactDiscFirstTrackPregap;
case CD_LeadOut:
return CompactDiscLeadOut;
case SCSI_MODESENSE_6:
return ScsiModeSense6;
case SCSI_MODESENSE_10:
return ScsiModeSense10;
case USB_Descriptors:
return UsbDescriptors;
case Xbox_DMI:
return XboxDmi;
case Xbox_PFI:
return XboxPfi;
case CD_MCN:
return CompactDiscMediaCatalogueNumber;
case CD_LeadIn:
return CompactDiscLeadIn;
case DVD_DiscKey_Decrypted:
return DvdDiscKeyDecrypted;
default:
return -1;
}
}
// Get the CICM XML media type from AARU media type
AARU_LOCAL int32_t AARU_CALL aaruf_get_xml_mediatype(const int32_t type)
{
switch(type)
{
case CD:
case CDDA:
case CDG:
case CDEG:
case CDI:
case CDIREADY:
case CDROM:
case CDROMXA:
case CDPLUS:
case CDMO:
case CDR:
case CDRW:
case CDMRW:
case VCD:
case SVCD:
case PCD:
case SACD:
case DDCD:
case DDCDR:
case DDCDRW:
case DTSCD:
case CDMIDI:
case CDV:
case DVDROM:
case DVDR:
case DVDRW:
case DVDPR:
case DVDPRW:
case DVDPRWDL:
case DVDRDL:
case DVDPRDL:
case DVDRAM:
case DVDRWDL:
case DVDDownload:
case HDDVDROM:
case HDDVDRAM:
case HDDVDR:
case HDDVDRW:
case HDDVDRDL:
case HDDVDRWDL:
case BDROM:
case BDR:
case BDRE:
case BDRXL:
case BDREXL:
case EVD:
case FVD:
case HVD:
case CBHD:
case HDVMD:
case VCDHD:
case SVOD:
case FDDVD:
case LD:
case LDROM:
case LDROM2:
case LVROM:
case MegaLD:
case PS1CD:
case PS2CD:
case PS2DVD:
case PS3DVD:
case PS3BD:
case PS4BD:
case UMD:
case XGD:
case XGD2:
case XGD3:
case XGD4:
case MEGACD:
case SATURNCD:
case GDROM:
case GDR:
case SuperCDROM2:
case JaguarCD:
case ThreeDO:
case PCFX:
case NeoGeoCD:
case GOD:
case WOD:
case WUOD:
case CDTV:
case CD32:
case Nuon:
case Playdia:
case Pippin:
case FMTOWNS:
case MilCD:
case VideoNow:
case VideoNowColor:
case VideoNowXp:
return OpticalDisc;
default:
return BlockMedia;
}
}
int compare_extents(const void *a, const void *b)
{
const DumpExtent *extent_a = a;
const DumpExtent *extent_b = b;
if(extent_a->start < extent_b->start) return -1;
if(extent_a->start > extent_b->start) return 1;
return 0;
}
void generate_random_bytes(uint8_t *buffer, size_t length)
{
if(buffer == NULL || length == 0) return;
#if defined(_WIN32) || defined(_WIN64)
// Windows implementation using CryptGenRandom
HCRYPTPROV hCryptProv;
if(CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
{
CryptGenRandom(hCryptProv, (DWORD)length, buffer);
CryptReleaseContext(hCryptProv, 0);
return;
}
#else
// Unix-like systems (Linux, macOS, BSD, etc.) - use /dev/urandom
FILE *urandom = fopen("/dev/urandom", "rb");
if(urandom != NULL)
{
size_t bytes_read = fread(buffer, 1, length, urandom);
fclose(urandom);
if(bytes_read == length) return;
}
#endif
// Fallback: use time-seeded rand() if platform-specific methods fail
// This is less secure but ensures we always generate some random data
srand((unsigned int)time(NULL));
for(size_t i = 0; i < length; i++) { buffer[i] = (uint8_t)(rand() % 256); }
}
aaru.h
Public high-level API types: media classifications, per-sector / per-media tag enums and image summar...
aaruformat.h
AARU_CALL
#define AARU_CALL
Definition decls.h:46
AARU_LOCAL
#define AARU_LOCAL
Definition decls.h:56
OpticalDisc
@ OpticalDisc
Purely optical discs.
Definition enums.h:224
BlockMedia
@ BlockMedia
Media that is physically block-based or abstracted like that.
Definition enums.h:225
DvdDiscKey
@ DvdDiscKey
DVD disc key.
Definition enums.h:55
DvdPfi2ndLayer
@ DvdPfi2ndLayer
DVD Physical Format Information for the second layer.
Definition enums.h:133
CompactDiscSessionInfo
@ CompactDiscSessionInfo
Compact Disc session information.
Definition enums.h:48
DvdRPfi
@ DvdRPfi
DVD-R Physical Format Information.
Definition enums.h:66
ScsiMmcTrackResourcesInformation
@ ScsiMmcTrackResourcesInformation
MMC track resources information.
Definition enums.h:89
DvdPfi
@ DvdPfi
DVD Physical Format Information.
Definition enums.h:53
HdDvdCpi
@ HdDvdCpi
HD DVD Copy Protection Information (CPI).
Definition enums.h:68
DvdDlLayerCapacity
@ DvdDlLayerCapacity
DVD dual-layer capacity.
Definition enums.h:70
CompactDiscAtip
@ CompactDiscAtip
Compact Disc Absolute Time In Pregroove (ATIP).
Definition enums.h:51
CompactDiscLeadOut
@ CompactDiscLeadOut
Compact Disc lead‑out.
Definition enums.h:108
MultiMediaCardOcr
@ MultiMediaCardOcr
MultiMediaCard OCR register.
Definition enums.h:102
ScsiMmcDiscInformation
@ ScsiMmcDiscInformation
MMC disc information.
Definition enums.h:88
DvdRamDds
@ DvdRamDds
DVD-RAM Disc Definition Structure (DDS).
Definition enums.h:60
DvdRamMediumStatus
@ DvdRamMediumStatus
DVD-RAM medium status.
Definition enums.h:61
AacsMediaIdentifier
@ AacsMediaIdentifier
AACS media identifier.
Definition enums.h:81
AacsMediaKeyBlock
@ AacsMediaKeyBlock
AACS Media Key Block (MKB).
Definition enums.h:82
CompactDiscLeadInCdText
@ CompactDiscLeadInCdText
Compact Disc lead-in CD-Text.
Definition enums.h:52
ScsiModePage2A
@ ScsiModePage2A
SCSI MODE PAGE 2Ah.
Definition enums.h:92
SecureDigitalOcr
@ SecureDigitalOcr
Secure Digital OCR register.
Definition enums.h:99
MultiMediaCardCsd
@ MultiMediaCardCsd
MultiMediaCard CSD register.
Definition enums.h:101
CompactDiscPartialToc
@ CompactDiscPartialToc
Compact Disc partial Table of Contents.
Definition enums.h:47
CprmMediaKeyBlock
@ CprmMediaKeyBlock
CPRM Media Key Block (MKB).
Definition enums.h:85
ScsiMmcPowResourcesInformation
@ ScsiMmcPowResourcesInformation
MMC POW (Persistent Optical Write?) resources information.
Definition enums.h:90
SecureDigitalCid
@ SecureDigitalCid
Secure Digital CID register.
Definition enums.h:96
CompactDiscMediaCatalogueNumber
@ CompactDiscMediaCatalogueNumber
Compact Disc Media Catalogue Number (lead‑in, 13 ASCII bytes).
Definition enums.h:120
XboxSecuritySector
@ XboxSecuritySector
Xbox Security Sector.
Definition enums.h:104
AacsVolumeIdentifier
@ AacsVolumeIdentifier
AACS volume identifier.
Definition enums.h:79
DvdDmi
@ DvdDmi
DVD Disc Manufacturing Information (DMI).
Definition enums.h:57
ScsiInquiry
@ ScsiInquiry
SCSI INQUIRY response.
Definition enums.h:91
CompactDiscToc
@ CompactDiscToc
Compact Disc full Table of Contents.
Definition enums.h:49
DvdLeadInCmi
@ DvdLeadInCmi
DVD lead-in Copyright Management Information (CMI).
Definition enums.h:54
HdDvdMediumStatus
@ HdDvdMediumStatus
HD DVD medium status.
Definition enums.h:69
DvdAdip
@ DvdAdip
DVD Address In Pregroove (ADIP).
Definition enums.h:67
AacsLbaExtents
@ AacsLbaExtents
AACS LBA extents.
Definition enums.h:84
AtaIdentify
@ AtaIdentify
ATA IDENTIFY DEVICE data.
Definition enums.h:93
AacsDataKeys
@ AacsDataKeys
AACS data keys.
Definition enums.h:83
BlurayDi
@ BlurayDi
Blu-ray Disc Information (DI).
Definition enums.h:74
SecureDigitalCsd
@ SecureDigitalCsd
Secure Digital CSD register.
Definition enums.h:97
BluraySpareArea
@ BluraySpareArea
Blu-ray spare area information.
Definition enums.h:78
DvdDiscKeyDecrypted
@ DvdDiscKeyDecrypted
Decrypted DVD Disc Key.
Definition enums.h:125
AtapiIdentify
@ AtapiIdentify
ATAPI IDENTIFY PACKET DEVICE data.
Definition enums.h:94
SecureDigitalScr
@ SecureDigitalScr
Secure Digital SCR register.
Definition enums.h:98
DvdRPrerecordedInfo
@ DvdRPrerecordedInfo
DVD-R pre‑recorded information.
Definition enums.h:64
CompactDiscLeadIn
@ CompactDiscLeadIn
Compact Disc lead‑in.
Definition enums.h:124
PcmciaCis
@ PcmciaCis
PCMCIA Card Information Structure (CIS).
Definition enums.h:95
DvdBca
@ DvdBca
DVD Burst Cutting Area (BCA).
Definition enums.h:56
DvdRamSpareArea
@ DvdRamSpareArea
DVD-RAM spare area information.
Definition enums.h:62
MultiMediaCardCid
@ MultiMediaCardCid
MultiMediaCard CID register.
Definition enums.h:100
XboxDmi
@ XboxDmi
Xbox DMI.
Definition enums.h:112
DvdRMediaIdentifier
@ DvdRMediaIdentifier
DVD-R media identifier.
Definition enums.h:65
HybridRecognizedLayers
@ HybridRecognizedLayers
Recognized layers (hybrid media).
Definition enums.h:86
ScsiMmcWriteProtection
@ ScsiMmcWriteProtection
MMC write-protection data.
Definition enums.h:87
DvdDlMiddleZoneAddress
@ DvdDlMiddleZoneAddress
DVD dual-layer middle zone address.
Definition enums.h:71
BlurayCartridgeStatus
@ BlurayCartridgeStatus
Blu-ray cartridge status.
Definition enums.h:77
BlurayBca
@ BlurayBca
Blu-ray Burst Cutting Area (BCA).
Definition enums.h:75
CompactDiscFirstTrackPregap
@ CompactDiscFirstTrackPregap
Compact Disc first track pre-gap.
Definition enums.h:107
DvdMediaIdentifier
@ DvdMediaIdentifier
DVD media identifier.
Definition enums.h:58
ScsiModeSense6
@ ScsiModeSense6
SCSI MODE SENSE (6) response.
Definition enums.h:109
UsbDescriptors
@ UsbDescriptors
USB descriptors set.
Definition enums.h:111
AacsSerialNumber
@ AacsSerialNumber
AACS serial number.
Definition enums.h:80
DvdDiscControlBlock
@ DvdDiscControlBlock
DVD Disc Control Block.
Definition enums.h:106
FloppyLeadOut
@ FloppyLeadOut
Floppy lead‑out data.
Definition enums.h:105
ScsiModeSense10
@ ScsiModeSense10
SCSI MODE SENSE (10) response.
Definition enums.h:110
CompactDiscPma
@ CompactDiscPma
Compact Disc Power Management Area (PMA).
Definition enums.h:50
XboxPfi
@ XboxPfi
Xbox Physical Format Information (PFI).
Definition enums.h:113
MultiMediaCardExtendedCsd
@ MultiMediaCardExtendedCsd
MultiMediaCard Extended CSD register.
Definition enums.h:103
DvdDlManualLayerJumpLba
@ DvdDlManualLayerJumpLba
DVD dual-layer manual layer jump LBA.
Definition enums.h:73
DvdMediaKeyBlock
@ DvdMediaKeyBlock
DVD Media Key Block (MKB).
Definition enums.h:59
DvdDlJumpIntervalSize
@ DvdDlJumpIntervalSize
DVD dual-layer jump interval size.
Definition enums.h:72
BlurayDds
@ BlurayDds
Blu-ray Disc Definition Structure (DDS).
Definition enums.h:76
DvdRRmd
@ DvdRRmd
DVD-R RMD (Recording Management Data).
Definition enums.h:63
SCSI_MODEPAGE_2A
@ SCSI_MODEPAGE_2A
SCSI Mode Page 2Ah (CD/DVD capabilities).
Definition aaru.h:1045
BD_DDS
@ BD_DDS
Disc Definition Structure (recordable).
Definition aaru.h:1029
MMC_CID
@ MMC_CID
MMC Card ID.
Definition aaru.h:1053
DVDDL_JumpIntervalSize
@ DVDDL_JumpIntervalSize
Jump interval size (opposite track path).
Definition aaru.h:1025
MMC_CSD
@ MMC_CSD
MMC Card Specific Data.
Definition aaru.h:1054
DVD_DiscKey_Decrypted
@ DVD_DiscKey_Decrypted
Decrypted DVD disc key,.
Definition aaru.h:1072
BD_SpareArea
@ BD_SpareArea
BD spare area allocation map.
Definition aaru.h:1031
CD_TOC
@ CD_TOC
Standard CD Table Of Contents (lead-in, first session).
Definition aaru.h:999
DVDDL_ManualLayerJumpLBA
@ DVDDL_ManualLayerJumpLBA
Manual layer jump LBA (OTP).
Definition aaru.h:1026
DVDRAM_SpareArea
@ DVDRAM_SpareArea
Spare area descriptors.
Definition aaru.h:1015
DVD_CMI
@ DVD_CMI
Copyright Management Information (CSS/CPRM flags).
Definition aaru.h:1007
DVDR_MediaIdentifier
@ DVDR_MediaIdentifier
DVD-R/-RW writable media identifier.
Definition aaru.h:1018
SCSI_MODESENSE_10
@ SCSI_MODESENSE_10
Raw MODE SENSE (10) data.
Definition aaru.h:1063
USB_Descriptors
@ USB_Descriptors
Concatenated USB descriptors (device/config/interface).
Definition aaru.h:1064
SCSI_MODESENSE_6
@ SCSI_MODESENSE_6
Raw MODE SENSE (6) data.
Definition aaru.h:1062
DVD_PFI_2ndLayer
@ DVD_PFI_2ndLayer
DVD Physical Format Information for the second layer.
Definition aaru.h:1073
ATAPI_IDENTIFY
@ ATAPI_IDENTIFY
ATA PACKET IDENTIFY DEVICE.
Definition aaru.h:1047
CD_SessionInfo
@ CD_SessionInfo
Per-session summary (start/end addresses, track count).
Definition aaru.h:1000
DVD_PFI
@ DVD_PFI
Physical Format Information (layer geometry & book type).
Definition aaru.h:1006
CD_LeadIn
@ CD_LeadIn
Raw lead-in (TOC frames).
Definition aaru.h:1067
BD_CartridgeStatus
@ BD_CartridgeStatus
Cartridge presence / write protect (BD-RE/BD-R in caddy).
Definition aaru.h:1030
Xbox_DMI
@ Xbox_DMI
Xbox Disc Manufacturing Info (DMI).
Definition aaru.h:1065
AACS_SerialNumber
@ AACS_SerialNumber
Pre-recorded media serial number (AACS).
Definition aaru.h:1033
DVDR_PreRecordedInfo
@ DVDR_PreRecordedInfo
Pre-recorded info area (lead-in).
Definition aaru.h:1017
SD_SCR
@ SD_SCR
SecureDigital Configuration Register.
Definition aaru.h:1051
DVDRAM_DDS
@ DVDRAM_DDS
Defect Data Structure (DVD-RAM mapping).
Definition aaru.h:1013
AACS_DataKeys
@ AACS_DataKeys
Extracted AACS title/volume keys (when decrypted).
Definition aaru.h:1036
CD_ATIP
@ CD_ATIP
Absolute Time In Pregroove (writable media timing & power metadata).
Definition aaru.h:1003
AACS_MKB
@ AACS_MKB
AACS Media Key Block.
Definition aaru.h:1035
DVD_DiscKey
@ DVD_DiscKey
Encrypted disc key block (CSS).
Definition aaru.h:1008
MMC_DiscInformation
@ MMC_DiscInformation
Disc Information (recordable status, erasable, last session).
Definition aaru.h:1041
ATA_IDENTIFY
@ ATA_IDENTIFY
ATA IDENTIFY DEVICE (512 bytes).
Definition aaru.h:1046
DVDR_PFI
@ DVDR_PFI
DVD-R physical format (layer data).
Definition aaru.h:1019
DVD_MediaIdentifier
@ DVD_MediaIdentifier
Writable media dye / manufacturer ID.
Definition aaru.h:1011
CD_LeadOut
@ CD_LeadOut
Lead-out area contents.
Definition aaru.h:1061
MMC_ExtendedCSD
@ MMC_ExtendedCSD
MMC Extended CSD (512 bytes).
Definition aaru.h:1056
CD_TEXT
@ CD_TEXT
CD-Text blocks (titles, performers, etc.).
Definition aaru.h:1004
CD_MCN
@ CD_MCN
Media Catalogue Number (EAN/UPC style identifier).
Definition aaru.h:1005
MMC_TrackResourcesInformation
@ MMC_TrackResourcesInformation
Track Resources (allocated/open track data).
Definition aaru.h:1042
Xbox_SecuritySector
@ Xbox_SecuritySector
Xbox/Xbox 360 Security Sector (SS.bin).
Definition aaru.h:1057
HDDVD_MediumStatus
@ HDDVD_MediumStatus
HD DVD Medium status (spares/defects).
Definition aaru.h:1022
DVDDL_MiddleZoneAddress
@ DVDDL_MiddleZoneAddress
Middle zone start LBA.
Definition aaru.h:1024
Floppy_LeadOut
@ Floppy_LeadOut
Manufacturer / duplication cylinder (floppy special data).
Definition aaru.h:1058
MMC_POWResourcesInformation
@ MMC_POWResourcesInformation
Pseudo OverWrite resources (BD-R POW).
Definition aaru.h:1043
AACS_MediaIdentifier
@ AACS_MediaIdentifier
AACS Media Identifier (unique per disc).
Definition aaru.h:1034
DVDDL_LayerCapacity
@ DVDDL_LayerCapacity
Dual layer capacity & break info.
Definition aaru.h:1023
AACS_VolumeIdentifier
@ AACS_VolumeIdentifier
AACS Volume Identifier.
Definition aaru.h:1032
BD_BCA
@ BD_BCA
Blu-ray Burst Cutting Area.
Definition aaru.h:1028
Hybrid_RecognizedLayers
@ Hybrid_RecognizedLayers
Hybrid disc recognized layer combinations (e.g. CD/DVD/BD).
Definition aaru.h:1039
AACS_CPRM_MKB
@ AACS_CPRM_MKB
CPRM Media Key Block.
Definition aaru.h:1038
DVDR_RMD
@ DVDR_RMD
Recorded Media Data (RMD) last border-out.
Definition aaru.h:1016
AACS_LBAExtents
@ AACS_LBAExtents
LBA extents requiring bus encryption.
Definition aaru.h:1037
DVD_DMI
@ DVD_DMI
Disc Manufacturer Information (lead-in descriptor).
Definition aaru.h:1010
DVD_BCA
@ DVD_BCA
Burst Cutting Area (etched manufacturer / AACS info).
Definition aaru.h:1009
DVD_MKB
@ DVD_MKB
Media Key Block (AACS/DVD).
Definition aaru.h:1012
DiscControlBlock
@ DiscControlBlock
DVD Disc Control Blocks.
Definition aaru.h:1059
SD_CSD
@ SD_CSD
SecureDigital Card Specific Data.
Definition aaru.h:1050
SCSI_INQUIRY
@ SCSI_INQUIRY
SCSI INQUIRY standard data (SPC-*).
Definition aaru.h:1044
CD_FullTOC
@ CD_FullTOC
Complete multi-session TOC including hidden tracks.
Definition aaru.h:1001
DVD_ADIP
@ DVD_ADIP
Address In Pregroove (DVD+ / wobble timing).
Definition aaru.h:1020
MMC_OCR
@ MMC_OCR
MMC Operation Conditions.
Definition aaru.h:1055
HDDVD_CPI
@ HDDVD_CPI
Content Protection Info (HD DVD).
Definition aaru.h:1021
SD_OCR
@ SD_OCR
SecureDigital Operation Conditions (voltage).
Definition aaru.h:1052
CD_PMA
@ CD_PMA
Program Memory Area (temporary track info before finalization).
Definition aaru.h:1002
DVDRAM_MediumStatus
@ DVDRAM_MediumStatus
Medium Status (allocated spare info).
Definition aaru.h:1014
PCMCIA_CIS
@ PCMCIA_CIS
PCMCIA/CardBus CIS tuple chain.
Definition aaru.h:1048
Xbox_PFI
@ Xbox_PFI
Xbox Physical Format Information (PFI).
Definition aaru.h:1066
SD_CID
@ SD_CID
SecureDigital Card ID register.
Definition aaru.h:1049
CD_FirstTrackPregap
@ CD_FirstTrackPregap
First track pregap (index 0).
Definition aaru.h:1060
MMC_WriteProtection
@ MMC_WriteProtection
Write protection status (MMC GET CONFIG).
Definition aaru.h:1040
BD_DI
@ BD_DI
Disc Information (BD).
Definition aaru.h:1027
BDREXL
@ BDREXL
BD-RE XL.
Definition aaru.h:163
CDROMXA
@ CDROMXA
CD-ROM XA (Yellow Book).
Definition aaru.h:112
SVOD
@ SVOD
Stacked Volumetric Optical Disc.
Definition aaru.h:173
CDR
@ CDR
CD-Recordable (Orange Book).
Definition aaru.h:115
ThreeDO
@ ThreeDO
3DO CD
Definition aaru.h:236
PCD
@ PCD
Photo CD (Beige Book).
Definition aaru.h:120
CDV
@ CDV
CD-Video (ISO/IEC 61104).
Definition aaru.h:127
CDG
@ CDG
CD+G (Red Book).
Definition aaru.h:108
HVD
@ HVD
Holographic Versatile Disc.
Definition aaru.h:169
CDMO
@ CDMO
CD-MO (Orange Book).
Definition aaru.h:114
DDCD
@ DDCD
Double-Density CD-ROM (Purple Book).
Definition aaru.h:122
LD
@ LD
Pioneer LaserDisc.
Definition aaru.h:178
CDEG
@ CDEG
CD+EG (Red Book).
Definition aaru.h:109
GDR
@ GDR
Sega/Yamaha recordable Gigabyte Disc.
Definition aaru.h:227
CDDA
@ CDDA
CD Digital Audio (Red Book).
Definition aaru.h:107
Pippin
@ Pippin
Definition aaru.h:712
CDMRW
@ CDMRW
Mount-Rainier CD-RW.
Definition aaru.h:117
MEGACD
@ MEGACD
Sega MegaCD.
Definition aaru.h:224
VideoNowColor
@ VideoNowColor
Hasbro VideoNow Color disc.
Definition aaru.h:782
CDIREADY
@ CDIREADY
CD-i Ready, contains a track before the first TOC track, in mode 2, and all TOC tracks are Audio.
Definition aaru.h:130
GOD
@ GOD
Nintendo GameCube Optical Disc.
Definition aaru.h:512
CDROM
@ CDROM
CD-ROM (Yellow Book).
Definition aaru.h:111
HDDVDROM
@ HDDVDROM
HD DVD-ROM (applies to HD DVD Video).
Definition aaru.h:150
MegaLD
@ MegaLD
Definition aaru.h:182
VCD
@ VCD
Video CD (White Book).
Definition aaru.h:118
SuperCDROM2
@ SuperCDROM2
PC-Engine / TurboGrafx CD.
Definition aaru.h:234
CDRW
@ CDRW
CD-ReWritable (Orange Book).
Definition aaru.h:116
SVCD
@ SVCD
Super Video CD (White Book).
Definition aaru.h:119
DVDPRWDL
@ DVDPRWDL
DVD+RW DL.
Definition aaru.h:141
BDRXL
@ BDRXL
BD-R XL.
Definition aaru.h:162
DDCDR
@ DDCDR
DD CD-R (Purple Book).
Definition aaru.h:123
NeoGeoCD
@ NeoGeoCD
NEO-GEO CD.
Definition aaru.h:238
DVDRW
@ DVDRW
DVD-RW.
Definition aaru.h:138
CDPLUS
@ CDPLUS
CD+ (Blue Book).
Definition aaru.h:113
CDTV
@ CDTV
Commodore CDTV.
Definition aaru.h:239
DVDRWDL
@ DVDRWDL
DVD-RW DL.
Definition aaru.h:145
HDDVDRDL
@ HDDVDRDL
HD DVD-R DL.
Definition aaru.h:154
FMTOWNS
@ FMTOWNS
Fujitsu FM Towns bootable CD (mixed-mode proprietary extensions).
Definition aaru.h:132
PS1CD
@ PS1CD
Sony PlayStation game CD.
Definition aaru.h:206
HDDVDRWDL
@ HDDVDRWDL
HD DVD-RW DL.
Definition aaru.h:155
XGD3
@ XGD3
Microsoft X-box 360 Game Disc.
Definition aaru.h:219
WOD
@ WOD
Nintendo Wii Optical Disc.
Definition aaru.h:522
PS3BD
@ PS3BD
Sony PlayStation 3 game Blu-ray.
Definition aaru.h:210
UMD
@ UMD
Sony PlayStation Portable Universal Media Disc (ECMA-365).
Definition aaru.h:212
XGD
@ XGD
Microsoft X-box Game Disc.
Definition aaru.h:217
EVD
@ EVD
Enhanced Versatile Disc.
Definition aaru.h:167
SACD
@ SACD
Super Audio CD (Scarlet Book).
Definition aaru.h:121
DVDPRDL
@ DVDPRDL
DVD+R DL.
Definition aaru.h:143
HDDVDRAM
@ HDDVDRAM
HD DVD-RAM.
Definition aaru.h:151
DVDR
@ DVDR
DVD-R.
Definition aaru.h:137
PS3DVD
@ PS3DVD
Sony PlayStation 3 game DVD.
Definition aaru.h:209
CDMIDI
@ CDMIDI
CD-MIDI (Red Book).
Definition aaru.h:126
PCFX
@ PCFX
NEC PC-FX.
Definition aaru.h:237
BDROM
@ BDROM
BD-ROM (and BD Video).
Definition aaru.h:159
JaguarCD
@ JaguarCD
Atari Jaguar CD.
Definition aaru.h:235
PS2DVD
@ PS2DVD
Sony PlayStation 2 game DVD.
Definition aaru.h:208
XGD4
@ XGD4
Microsoft X-box One Game Disc.
Definition aaru.h:220
VideoNow
@ VideoNow
Hasbro VideoNow 85 mm proprietary video disc.
Definition aaru.h:781
VideoNowXp
@ VideoNowXp
Hasbro VideoNow XP higher capacity disc.
Definition aaru.h:783
VCDHD
@ VCDHD
Versatile Compact Disc High Density.
Definition aaru.h:172
CD
@ CD
Any unknown or standard violating CD.
Definition aaru.h:106
GDROM
@ GDROM
Sega/Yamaha Gigabyte Disc.
Definition aaru.h:226
SATURNCD
@ SATURNCD
Sega Saturn disc.
Definition aaru.h:225
CBHD
@ CBHD
China Blue High Definition.
Definition aaru.h:170
BDR
@ BDR
BD-R.
Definition aaru.h:160
XGD2
@ XGD2
Microsoft X-box 360 Game Disc.
Definition aaru.h:218
LDROM
@ LDROM
Pioneer LaserDisc data.
Definition aaru.h:179
PS4BD
@ PS4BD
Sony PlayStation 4 game Blu-ray.
Definition aaru.h:211
HDDVDR
@ HDDVDR
HD DVD-R.
Definition aaru.h:152
HDVMD
@ HDVMD
High Definition Versatile Multilayer Disc.
Definition aaru.h:171
HDDVDRW
@ HDDVDRW
HD DVD-RW.
Definition aaru.h:153
MilCD
@ MilCD
Sega Dreamcast MIL-CD enhanced multimedia disc.
Definition aaru.h:229
BDRE
@ BDRE
BD-RE.
Definition aaru.h:161
DTSCD
@ DTSCD
DTS audio CD (non-standard).
Definition aaru.h:125
DVDPR
@ DVDPR
DVD+R.
Definition aaru.h:139
DDCDRW
@ DDCDRW
DD CD-RW (Purple Book).
Definition aaru.h:124
FVD
@ FVD
Forward Versatile Disc.
Definition aaru.h:168
CDI
@ CDI
CD-i (Green Book).
Definition aaru.h:110
Playdia
@ Playdia
Bandai Playdia.
Definition aaru.h:242
DVDPRW
@ DVDPRW
DVD+RW.
Definition aaru.h:140
Nuon
@ Nuon
Nuon (DVD based videogame console).
Definition aaru.h:241
CD32
@ CD32
Amiga CD32.
Definition aaru.h:240
LVROM
@ LVROM
Definition aaru.h:181
DVDDownload
@ DVDDownload
DVD-Download.
Definition aaru.h:146
DVDRDL
@ DVDRDL
DVD-R DL.
Definition aaru.h:142
WUOD
@ WUOD
Nintendo Wii U Optical Disc.
Definition aaru.h:523
DVDROM
@ DVDROM
DVD-ROM (applies to DVD Video and DVD Audio).
Definition aaru.h:136
LDROM2
@ LDROM2
Definition aaru.h:180
FDDVD
@ FDDVD
Five Dimensional disc.
Definition aaru.h:174
PS2CD
@ PS2CD
Sony PlayStation 2 game CD.
Definition aaru.h:207
DVDRAM
@ DVDRAM
DVD-RAM.
Definition aaru.h:144
aaruf_get_datatype_for_media_tag_type
int32_t aaruf_get_datatype_for_media_tag_type(const int32_t tag_type)
Converts an Aaru media tag type to an image data type.
Definition helpers.c:199
generate_random_bytes
void generate_random_bytes(uint8_t *buffer, size_t length)
Generates cryptographically strong random bytes.
Definition helpers.c:484
aaruf_get_media_tag_type_for_datatype
int32_t aaruf_get_media_tag_type_for_datatype(const int32_t type)
Converts an image data type to an Aaru media tag type.
Definition helpers.c:39
aaruf_get_xml_mediatype
int32_t aaruf_get_xml_mediatype(const int32_t type)
Definition helpers.c:351
compare_extents
int compare_extents(const void *a, const void *b)
Comparison function for sorting DumpExtent arrays by start sector.
Definition helpers.c:463
DumpExtent
Inclusive [start,end] logical sector range contributed by a single hardware environment.
Definition context.h:369
DumpExtent::start
uint64_t start
Starting LBA (inclusive).
Definition context.h:370