libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
helpers.c
Go to the documentation of this file.
1/*
2 * This file is part of the Aaru Data Preservation Suite.
3 * Copyright (c) 2019-2025 Natalia Portillo.
4 *
5 * This library is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU Lesser General Public License as
7 * published by the Free Software Foundation; either version 2.1 of the
8 * License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 */
18
19#if defined(_WIN32) || defined(_WIN64)
20#include <windows.h>
21#include <wincrypt.h>
22#endif
23
24#include <aaru.h>
25
26#include <aaruformat.h>
27#include <stdio.h>
28#include <stdlib.h>
29#include <time.h>
30
39 AARU_LOCAL int32_t AARU_CALL aaruf_get_media_tag_type_for_datatype(const int32_t type)
40{
41 switch(type)
42 {
43 case CompactDiscPartialToc:
44 return CD_TOC;
45 case CompactDiscSessionInfo:
46 return CD_SessionInfo;
47 case CompactDiscToc:
48 return CD_FullTOC;
49 case CompactDiscPma:
50 return CD_PMA;
51 case CompactDiscAtip:
52 return CD_ATIP;
53 case CompactDiscLeadInCdText:
54 return CD_TEXT;
55 case DvdPfi:
56 return DVD_PFI;
57 case DvdLeadInCmi:
58 return DVD_CMI;
59 case DvdDiscKey:
60 return DVD_DiscKey;
61 case DvdBca:
62 return DVD_BCA;
63 case DvdDmi:
64 return DVD_DMI;
65 case DvdMediaIdentifier:
66 return DVD_MediaIdentifier;
67 case DvdMediaKeyBlock:
68 return DVD_MKB;
69 case DvdRamDds:
70 return DVDRAM_DDS;
71 case DvdRamMediumStatus:
72 return DVDRAM_MediumStatus;
73 case DvdRamSpareArea:
74 return DVDRAM_SpareArea;
75 case DvdRRmd:
76 return DVDR_RMD;
77 case DvdRPrerecordedInfo:
78 return DVDR_PreRecordedInfo;
79 case DvdRMediaIdentifier:
80 return DVDR_MediaIdentifier;
81 case DvdRPfi:
82 return DVDR_PFI;
83 case DvdAdip:
84 return DVD_ADIP;
85 case HdDvdCpi:
86 return HDDVD_CPI;
87 case HdDvdMediumStatus:
88 return HDDVD_MediumStatus;
89 case DvdDlLayerCapacity:
90 return DVDDL_LayerCapacity;
91 case DvdDlMiddleZoneAddress:
92 return DVDDL_MiddleZoneAddress;
93 case DvdDlJumpIntervalSize:
94 return DVDDL_JumpIntervalSize;
95 case DvdDlManualLayerJumpLba:
96 return DVDDL_ManualLayerJumpLBA;
97 case BlurayDi:
98 return BD_DI;
99 case BlurayBca:
100 return BD_BCA;
101 case BlurayDds:
102 return BD_DDS;
103 case BlurayCartridgeStatus:
104 return BD_CartridgeStatus;
105 case BluraySpareArea:
106 return BD_SpareArea;
107 case AacsVolumeIdentifier:
108 return AACS_VolumeIdentifier;
109 case AacsSerialNumber:
110 return AACS_SerialNumber;
111 case AacsMediaIdentifier:
112 return AACS_MediaIdentifier;
113 case AacsMediaKeyBlock:
114 return AACS_MKB;
115 case AacsDataKeys:
116 return AACS_DataKeys;
117 case AacsLbaExtents:
118 return AACS_LBAExtents;
119 case CprmMediaKeyBlock:
120 return AACS_CPRM_MKB;
121 case HybridRecognizedLayers:
122 return Hybrid_RecognizedLayers;
123 case ScsiMmcWriteProtection:
124 return MMC_WriteProtection;
125 case ScsiMmcDiscInformation:
126 return MMC_DiscInformation;
127 case ScsiMmcTrackResourcesInformation:
128 return MMC_TrackResourcesInformation;
129 case ScsiMmcPowResourcesInformation:
130 return MMC_POWResourcesInformation;
131 case ScsiInquiry:
132 return SCSI_INQUIRY;
133 case ScsiModePage2A:
134 return SCSI_MODEPAGE_2A;
135 case AtaIdentify:
136 return ATA_IDENTIFY;
137 case AtapiIdentify:
138 return ATAPI_IDENTIFY;
139 case PcmciaCis:
140 return PCMCIA_CIS;
141 case SecureDigitalCid:
142 return SD_CID;
143 case SecureDigitalCsd:
144 return SD_CSD;
145 case SecureDigitalScr:
146 return SD_SCR;
147 case SecureDigitalOcr:
148 return SD_OCR;
149 case MultiMediaCardCid:
150 return MMC_CID;
151 case MultiMediaCardCsd:
152 return MMC_CSD;
153 case MultiMediaCardOcr:
154 return MMC_OCR;
155 case MultiMediaCardExtendedCsd:
156 return MMC_ExtendedCSD;
157 case XboxSecuritySector:
158 return Xbox_SecuritySector;
159 case FloppyLeadOut:
160 return Floppy_LeadOut;
161 case DvdDiscControlBlock:
162 return DiscControlBlock;
163 case CompactDiscFirstTrackPregap:
164 return CD_FirstTrackPregap;
165 case CompactDiscLeadOut:
166 return CD_LeadOut;
167 case ScsiModeSense6:
168 return SCSI_MODESENSE_6;
169 case ScsiModeSense10:
170 return SCSI_MODESENSE_10;
171 case UsbDescriptors:
172 return USB_Descriptors;
173 case XboxDmi:
174 return Xbox_DMI;
175 case XboxPfi:
176 return Xbox_PFI;
177 case CompactDiscMediaCatalogueNumber:
178 return CD_MCN;
179 case CompactDiscLeadIn:
180 return CD_LeadIn;
181 case DvdDiscKeyDecrypted:
182 return DVD_DiscKey_Decrypted;
183 default:
184 return -1;
185 }
186}
187
197 AARU_LOCAL int32_t AARU_CALL aaruf_get_datatype_for_media_tag_type(const int32_t tag_type)
198{
199 switch(tag_type)
200 {
201 case CD_TOC:
202 return CompactDiscPartialToc;
203 case CD_SessionInfo:
204 return CompactDiscSessionInfo;
205 case CD_FullTOC:
206 return CompactDiscToc;
207 case CD_PMA:
208 return CompactDiscPma;
209 case CD_ATIP:
210 return CompactDiscAtip;
211 case CD_TEXT:
212 return CompactDiscLeadInCdText;
213 case DVD_PFI:
214 return DvdPfi;
215 case DVD_CMI:
216 return DvdLeadInCmi;
217 case DVD_DiscKey:
218 return DvdDiscKey;
219 case DVD_BCA:
220 return DvdBca;
221 case DVD_DMI:
222 return DvdDmi;
223 case DVD_MediaIdentifier:
224 return DvdMediaIdentifier;
225 case DVD_MKB:
226 return DvdMediaKeyBlock;
227 case DVDRAM_DDS:
228 return DvdRamDds;
229 case DVDRAM_MediumStatus:
230 return DvdRamMediumStatus;
231 case DVDRAM_SpareArea:
232 return DvdRamSpareArea;
233 case DVDR_RMD:
234 return DvdRRmd;
235 case DVDR_PreRecordedInfo:
236 return DvdRPrerecordedInfo;
237 case DVDR_MediaIdentifier:
238 return DvdRMediaIdentifier;
239 case DVDR_PFI:
240 return DvdRPfi;
241 case DVD_ADIP:
242 return DvdAdip;
243 case HDDVD_CPI:
244 return HdDvdCpi;
245 case HDDVD_MediumStatus:
246 return HdDvdMediumStatus;
247 case DVDDL_LayerCapacity:
248 return DvdDlLayerCapacity;
249 case DVDDL_MiddleZoneAddress:
250 return DvdDlMiddleZoneAddress;
251 case DVDDL_JumpIntervalSize:
252 return DvdDlJumpIntervalSize;
253 case DVDDL_ManualLayerJumpLBA:
254 return DvdDlManualLayerJumpLba;
255 case BD_DI:
256 return BlurayDi;
257 case BD_BCA:
258 return BlurayBca;
259 case BD_DDS:
260 return BlurayDds;
261 case BD_CartridgeStatus:
262 return BlurayCartridgeStatus;
263 case BD_SpareArea:
264 return BluraySpareArea;
265 case AACS_VolumeIdentifier:
266 return AacsVolumeIdentifier;
267 case AACS_SerialNumber:
268 return AacsSerialNumber;
269 case AACS_MediaIdentifier:
270 return AacsMediaIdentifier;
271 case AACS_MKB:
272 return AacsMediaKeyBlock;
273 case AACS_DataKeys:
274 return AacsDataKeys;
275 case AACS_LBAExtents:
276 return AacsLbaExtents;
277 case AACS_CPRM_MKB:
278 return CprmMediaKeyBlock;
279 case Hybrid_RecognizedLayers:
280 return HybridRecognizedLayers;
281 case MMC_WriteProtection:
282 return ScsiMmcWriteProtection;
283 case MMC_DiscInformation:
284 return ScsiMmcDiscInformation;
285 case MMC_TrackResourcesInformation:
286 return ScsiMmcTrackResourcesInformation;
287 case MMC_POWResourcesInformation:
288 return ScsiMmcPowResourcesInformation;
289 case SCSI_INQUIRY:
290 return ScsiInquiry;
291 case SCSI_MODEPAGE_2A:
292 return ScsiModePage2A;
293 case ATA_IDENTIFY:
294 return AtaIdentify;
295 case ATAPI_IDENTIFY:
296 return AtapiIdentify;
297 case PCMCIA_CIS:
298 return PcmciaCis;
299 case SD_CID:
300 return SecureDigitalCid;
301 case SD_CSD:
302 return SecureDigitalCsd;
303 case SD_SCR:
304 return SecureDigitalScr;
305 case SD_OCR:
306 return SecureDigitalOcr;
307 case MMC_CID:
308 return MultiMediaCardCid;
309 case MMC_CSD:
310 return MultiMediaCardCsd;
311 case MMC_OCR:
312 return MultiMediaCardOcr;
313 case MMC_ExtendedCSD:
314 return MultiMediaCardExtendedCsd;
315 case Xbox_SecuritySector:
316 return XboxSecuritySector;
317 case Floppy_LeadOut:
318 return FloppyLeadOut;
319 case DiscControlBlock:
320 return DvdDiscControlBlock;
321 case CD_FirstTrackPregap:
322 return CompactDiscFirstTrackPregap;
323 case CD_LeadOut:
324 return CompactDiscLeadOut;
325 case SCSI_MODESENSE_6:
326 return ScsiModeSense6;
327 case SCSI_MODESENSE_10:
328 return ScsiModeSense10;
329 case USB_Descriptors:
330 return UsbDescriptors;
331 case Xbox_DMI:
332 return XboxDmi;
333 case Xbox_PFI:
334 return XboxPfi;
335 case CD_MCN:
336 return CompactDiscMediaCatalogueNumber;
337 case CD_LeadIn:
338 return CompactDiscLeadIn;
339 case DVD_DiscKey_Decrypted:
340 return DvdDiscKeyDecrypted;
341 default:
342 return -1;
343 }
344}
345
346// Get the CICM XML media type from AARU media type
347 AARU_LOCAL int32_t AARU_CALL aaruf_get_xml_mediatype(const int32_t type)
348{
349 switch(type)
350 {
351 case CD:
352 case CDDA:
353 case CDG:
354 case CDEG:
355 case CDI:
356 case CDIREADY:
357 case CDROM:
358 case CDROMXA:
359 case CDPLUS:
360 case CDMO:
361 case CDR:
362 case CDRW:
363 case CDMRW:
364 case VCD:
365 case SVCD:
366 case PCD:
367 case SACD:
368 case DDCD:
369 case DDCDR:
370 case DDCDRW:
371 case DTSCD:
372 case CDMIDI:
373 case CDV:
374 case DVDROM:
375 case DVDR:
376 case DVDRW:
377 case DVDPR:
378 case DVDPRW:
379 case DVDPRWDL:
380 case DVDRDL:
381 case DVDPRDL:
382 case DVDRAM:
383 case DVDRWDL:
384 case DVDDownload:
385 case HDDVDROM:
386 case HDDVDRAM:
387 case HDDVDR:
388 case HDDVDRW:
389 case HDDVDRDL:
390 case HDDVDRWDL:
391 case BDROM:
392 case BDR:
393 case BDRE:
394 case BDRXL:
395 case BDREXL:
396 case EVD:
397 case FVD:
398 case HVD:
399 case CBHD:
400 case HDVMD:
401 case VCDHD:
402 case SVOD:
403 case FDDVD:
404 case LD:
405 case LDROM:
406 case LDROM2:
407 case LVROM:
408 case MegaLD:
409 case PS1CD:
410 case PS2CD:
411 case PS2DVD:
412 case PS3DVD:
413 case PS3BD:
414 case PS4BD:
415 case UMD:
416 case XGD:
417 case XGD2:
418 case XGD3:
419 case XGD4:
420 case MEGACD:
421 case SATURNCD:
422 case GDROM:
423 case GDR:
424 case SuperCDROM2:
425 case JaguarCD:
426 case ThreeDO:
427 case PCFX:
428 case NeoGeoCD:
429 case GOD:
430 case WOD:
431 case WUOD:
432 case CDTV:
433 case CD32:
434 case Nuon:
435 case Playdia:
436 case Pippin:
437 case FMTOWNS:
438 case MilCD:
439 case VideoNow:
440 case VideoNowColor:
441 case VideoNowXp:
442 return OpticalDisc;
443 default:
444 return BlockMedia;
445 }
446}
447
459 int compare_extents(const void *a, const void *b)
460{
461 const DumpExtent *extent_a = a;
462 const DumpExtent *extent_b = b;
463
464 if(extent_a->start < extent_b->start) return -1;
465 if(extent_a->start > extent_b->start) return 1;
466 return 0;
467}
468
480 void generate_random_bytes(uint8_t *buffer, size_t length)
481{
482 if(buffer == NULL || length == 0) return;
483
484#if defined(_WIN32) || defined(_WIN64)
485 // Windows implementation using CryptGenRandom
486 HCRYPTPROV hCryptProv;
487 if(CryptAcquireContext(&hCryptProv, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT))
488 {
489 CryptGenRandom(hCryptProv, (DWORD)length, buffer);
490 CryptReleaseContext(hCryptProv, 0);
491 return;
492 }
493#else
494 // Unix-like systems (Linux, macOS, BSD, etc.) - use /dev/urandom
495 FILE *urandom = fopen("/dev/urandom", "rb");
496 if(urandom != NULL)
497 {
498 size_t bytes_read = fread(buffer, 1, length, urandom);
499 fclose(urandom);
500 if(bytes_read == length) return;
501 }
502#endif
503
504 // Fallback: use time-seeded rand() if platform-specific methods fail
505 // This is less secure but ensures we always generate some random data
506 srand((unsigned int)time(NULL));
507 for(size_t i = 0; i < length; i++) { buffer[i] = (uint8_t)(rand() % 256); }
508}
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:45
AARU_LOCAL
#define AARU_LOCAL
Definition decls.h:55
OpticalDisc
@ OpticalDisc
Purely optical discs.
Definition enums.h:218
BlockMedia
@ BlockMedia
Media that is physically block-based or abstracted like that.
Definition enums.h:219
DvdDiscKey
@ DvdDiscKey
DVD disc key.
Definition enums.h:55
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:983
BD_DDS
@ BD_DDS
Disc Definition Structure (recordable)
Definition aaru.h:967
MMC_CID
@ MMC_CID
MMC Card ID.
Definition aaru.h:991
DVDDL_JumpIntervalSize
@ DVDDL_JumpIntervalSize
Jump interval size (opposite track path)
Definition aaru.h:963
MMC_CSD
@ MMC_CSD
MMC Card Specific Data.
Definition aaru.h:992
DVD_DiscKey_Decrypted
@ DVD_DiscKey_Decrypted
Decrypted DVD disc key,.
Definition aaru.h:1010
BD_SpareArea
@ BD_SpareArea
BD spare area allocation map.
Definition aaru.h:969
CD_TOC
@ CD_TOC
Standard CD Table Of Contents (lead-in, first session)
Definition aaru.h:937
DVDDL_ManualLayerJumpLBA
@ DVDDL_ManualLayerJumpLBA
Manual layer jump LBA (OTP)
Definition aaru.h:964
DVDRAM_SpareArea
@ DVDRAM_SpareArea
Spare area descriptors.
Definition aaru.h:953
DVD_CMI
@ DVD_CMI
Copyright Management Information (CSS/CPRM flags)
Definition aaru.h:945
DVDR_MediaIdentifier
@ DVDR_MediaIdentifier
DVD-R/-RW writable media identifier.
Definition aaru.h:956
SCSI_MODESENSE_10
@ SCSI_MODESENSE_10
Raw MODE SENSE (10) data.
Definition aaru.h:1001
USB_Descriptors
@ USB_Descriptors
Concatenated USB descriptors (device/config/interface)
Definition aaru.h:1002
SCSI_MODESENSE_6
@ SCSI_MODESENSE_6
Raw MODE SENSE (6) data.
Definition aaru.h:1000
ATAPI_IDENTIFY
@ ATAPI_IDENTIFY
ATA PACKET IDENTIFY DEVICE.
Definition aaru.h:985
CD_SessionInfo
@ CD_SessionInfo
Per-session summary (start/end addresses, track count)
Definition aaru.h:938
DVD_PFI
@ DVD_PFI
Physical Format Information (layer geometry & book type)
Definition aaru.h:944
CD_LeadIn
@ CD_LeadIn
Raw lead-in (TOC frames)
Definition aaru.h:1005
BD_CartridgeStatus
@ BD_CartridgeStatus
Cartridge presence / write protect (BD-RE/BD-R in caddy)
Definition aaru.h:968
Xbox_DMI
@ Xbox_DMI
Xbox Disc Manufacturing Info (DMI)
Definition aaru.h:1003
AACS_SerialNumber
@ AACS_SerialNumber
Pre-recorded media serial number (AACS)
Definition aaru.h:971
DVDR_PreRecordedInfo
@ DVDR_PreRecordedInfo
Pre-recorded info area (lead-in)
Definition aaru.h:955
SD_SCR
@ SD_SCR
SecureDigital Configuration Register.
Definition aaru.h:989
DVDRAM_DDS
@ DVDRAM_DDS
Defect Data Structure (DVD-RAM mapping)
Definition aaru.h:951
AACS_DataKeys
@ AACS_DataKeys
Extracted AACS title/volume keys (when decrypted)
Definition aaru.h:974
CD_ATIP
@ CD_ATIP
Absolute Time In Pregroove (writable media timing & power metadata)
Definition aaru.h:941
AACS_MKB
@ AACS_MKB
AACS Media Key Block.
Definition aaru.h:973
DVD_DiscKey
@ DVD_DiscKey
Encrypted disc key block (CSS)
Definition aaru.h:946
MMC_DiscInformation
@ MMC_DiscInformation
Disc Information (recordable status, erasable, last session)
Definition aaru.h:979
ATA_IDENTIFY
@ ATA_IDENTIFY
ATA IDENTIFY DEVICE (512 bytes)
Definition aaru.h:984
DVDR_PFI
@ DVDR_PFI
DVD-R physical format (layer data)
Definition aaru.h:957
DVD_MediaIdentifier
@ DVD_MediaIdentifier
Writable media dye / manufacturer ID.
Definition aaru.h:949
CD_LeadOut
@ CD_LeadOut
Lead-out area contents.
Definition aaru.h:999
MMC_ExtendedCSD
@ MMC_ExtendedCSD
MMC Extended CSD (512 bytes)
Definition aaru.h:994
CD_TEXT
@ CD_TEXT
CD-Text blocks (titles, performers, etc.)
Definition aaru.h:942
CD_MCN
@ CD_MCN
Media Catalogue Number (EAN/UPC style identifier)
Definition aaru.h:943
MMC_TrackResourcesInformation
@ MMC_TrackResourcesInformation
Track Resources (allocated/open track data)
Definition aaru.h:980
Xbox_SecuritySector
@ Xbox_SecuritySector
Xbox/Xbox 360 Security Sector (SS.bin)
Definition aaru.h:995
HDDVD_MediumStatus
@ HDDVD_MediumStatus
HD DVD Medium status (spares/defects)
Definition aaru.h:960
DVDDL_MiddleZoneAddress
@ DVDDL_MiddleZoneAddress
Middle zone start LBA.
Definition aaru.h:962
Floppy_LeadOut
@ Floppy_LeadOut
Manufacturer / duplication cylinder (floppy special data)
Definition aaru.h:996
MMC_POWResourcesInformation
@ MMC_POWResourcesInformation
Pseudo OverWrite resources (BD-R POW)
Definition aaru.h:981
AACS_MediaIdentifier
@ AACS_MediaIdentifier
AACS Media Identifier (unique per disc)
Definition aaru.h:972
DVDDL_LayerCapacity
@ DVDDL_LayerCapacity
Dual layer capacity & break info.
Definition aaru.h:961
AACS_VolumeIdentifier
@ AACS_VolumeIdentifier
AACS Volume Identifier.
Definition aaru.h:970
BD_BCA
@ BD_BCA
Blu-ray Burst Cutting Area.
Definition aaru.h:966
Hybrid_RecognizedLayers
@ Hybrid_RecognizedLayers
Hybrid disc recognized layer combinations (e.g. CD/DVD/BD)
Definition aaru.h:977
AACS_CPRM_MKB
@ AACS_CPRM_MKB
CPRM Media Key Block.
Definition aaru.h:976
DVDR_RMD
@ DVDR_RMD
Recorded Media Data (RMD) last border-out.
Definition aaru.h:954
AACS_LBAExtents
@ AACS_LBAExtents
LBA extents requiring bus encryption.
Definition aaru.h:975
DVD_DMI
@ DVD_DMI
Disc Manufacturer Information (lead-in descriptor)
Definition aaru.h:948
DVD_BCA
@ DVD_BCA
Burst Cutting Area (etched manufacturer / AACS info)
Definition aaru.h:947
DVD_MKB
@ DVD_MKB
Media Key Block (AACS/DVD)
Definition aaru.h:950
DiscControlBlock
@ DiscControlBlock
DVD Disc Control Blocks.
Definition aaru.h:997
SD_CSD
@ SD_CSD
SecureDigital Card Specific Data.
Definition aaru.h:988
SCSI_INQUIRY
@ SCSI_INQUIRY
SCSI INQUIRY standard data (SPC-*)
Definition aaru.h:982
CD_FullTOC
@ CD_FullTOC
Complete multi-session TOC including hidden tracks.
Definition aaru.h:939
DVD_ADIP
@ DVD_ADIP
Address In Pregroove (DVD+ / wobble timing)
Definition aaru.h:958
MMC_OCR
@ MMC_OCR
MMC Operation Conditions.
Definition aaru.h:993
HDDVD_CPI
@ HDDVD_CPI
Content Protection Info (HD DVD)
Definition aaru.h:959
SD_OCR
@ SD_OCR
SecureDigital Operation Conditions (voltage)
Definition aaru.h:990
CD_PMA
@ CD_PMA
Program Memory Area (temporary track info before finalization)
Definition aaru.h:940
DVDRAM_MediumStatus
@ DVDRAM_MediumStatus
Medium Status (allocated spare info)
Definition aaru.h:952
PCMCIA_CIS
@ PCMCIA_CIS
PCMCIA/CardBus CIS tuple chain.
Definition aaru.h:986
Xbox_PFI
@ Xbox_PFI
Xbox Physical Format Information (PFI)
Definition aaru.h:1004
SD_CID
@ SD_CID
SecureDigital Card ID register.
Definition aaru.h:987
CD_FirstTrackPregap
@ CD_FirstTrackPregap
First track pregap (index 0)
Definition aaru.h:998
MMC_WriteProtection
@ MMC_WriteProtection
Write protection status (MMC GET CONFIG)
Definition aaru.h:978
BD_DI
@ BD_DI
Disc Information (BD)
Definition aaru.h:965
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:233
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:224
CDDA
@ CDDA
CD Digital Audio (Red Book)
Definition aaru.h:107
Pippin
@ Pippin
Definition aaru.h:702
CDMRW
@ CDMRW
Mount-Rainier CD-RW.
Definition aaru.h:117
MEGACD
@ MEGACD
Sega MegaCD.
Definition aaru.h:221
VideoNowColor
@ VideoNowColor
Hasbro VideoNow Color disc.
Definition aaru.h:772
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:502
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:231
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:235
DVDRW
@ DVDRW
DVD-RW.
Definition aaru.h:138
CDPLUS
@ CDPLUS
CD+ (Blue Book)
Definition aaru.h:113
CDTV
@ CDTV
Commodore CDTV.
Definition aaru.h:236
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:203
HDDVDRWDL
@ HDDVDRWDL
HD DVD-RW DL.
Definition aaru.h:155
XGD3
@ XGD3
Microsoft X-box 360 Game Disc.
Definition aaru.h:216
WOD
@ WOD
Nintendo Wii Optical Disc.
Definition aaru.h:512
PS3BD
@ PS3BD
Sony PlayStation 3 game Blu-ray.
Definition aaru.h:207
UMD
@ UMD
Sony PlayStation Portable Universal Media Disc (ECMA-365)
Definition aaru.h:209
XGD
@ XGD
Microsoft X-box Game Disc.
Definition aaru.h:214
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:206
CDMIDI
@ CDMIDI
CD-MIDI (Red Book)
Definition aaru.h:126
PCFX
@ PCFX
NEC PC-FX.
Definition aaru.h:234
BDROM
@ BDROM
BD-ROM (and BD Video)
Definition aaru.h:159
JaguarCD
@ JaguarCD
Atari Jaguar CD.
Definition aaru.h:232
PS2DVD
@ PS2DVD
Sony PlayStation 2 game DVD.
Definition aaru.h:205
XGD4
@ XGD4
Microsoft X-box One Game Disc.
Definition aaru.h:217
VideoNow
@ VideoNow
Hasbro VideoNow 85 mm proprietary video disc.
Definition aaru.h:771
VideoNowXp
@ VideoNowXp
Hasbro VideoNow XP higher capacity disc.
Definition aaru.h:773
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:223
SATURNCD
@ SATURNCD
Sega Saturn disc.
Definition aaru.h:222
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:215
LDROM
@ LDROM
Pioneer LaserDisc data.
Definition aaru.h:179
PS4BD
@ PS4BD
Sony PlayStation 4 game Blu-ray.
Definition aaru.h:208
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:226
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:239
DVDPRW
@ DVDPRW
DVD+RW.
Definition aaru.h:140
Nuon
@ Nuon
Nuon (DVD based videogame console)
Definition aaru.h:238
CD32
@ CD32
Amiga CD32.
Definition aaru.h:237
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:513
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:204
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:197
generate_random_bytes
void generate_random_bytes(uint8_t *buffer, size_t length)
Generates cryptographically strong random bytes.
Definition helpers.c:480
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:347
compare_extents
int compare_extents(const void *a, const void *b)
Comparison function for sorting DumpExtent arrays by start sector.
Definition helpers.c:459
DumpExtent
Inclusive [start,end] logical sector range contributed by a single hardware environment.
Definition context.h:333
DumpExtent::start
uint64_t start
Starting LBA (inclusive).
Definition context.h:334