libaaruformat 1.0 Aaru Data Preservation Suite - Format Library

Loading...
Searching...
No Matches
data.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#include <inttypes.h>
20#include <stdint.h>
21#include <stdio.h>
22#include <stdlib.h>
23
24#include "aaruformat.h"
25#include "log.h"
26#include "uthash.h"
27
70
71int32_t process_data_block(aaruformat_context *ctx, IndexEntry *entry)
72{
73 TRACE("Entering process_data_block(%p, %p)", ctx, entry);
74 BlockHeader block_header;
75 int pos = 0;
76 size_t read_bytes = 0;
77 size_t lzma_size = 0;
78 uint8_t *cmp_data = NULL;
79 uint8_t *cst_data = NULL;
80 mediaTagEntry *old_media_tag = NULL;
81 mediaTagEntry *media_tag = NULL;
82 uint8_t *data = NULL;
83 uint8_t lzma_properties[LZMA_PROPERTIES_LENGTH];
84
85 // Check if the context, index entry, and image stream are valid
86 if(ctx == NULL || entry == NULL || ctx->imageStream == NULL)
87 {
88 FATAL("Invalid context or image stream.");
89 return AARUF_ERROR_NOT_AARUFORMAT;
90 }
91
92 // Seek to block
93 pos = fseek(ctx->imageStream, entry->offset, SEEK_SET);
94 if(pos < 0 || ftell(ctx->imageStream) != entry->offset)
95 {
96 FATAL("Could not seek to %" PRIu64 " as indicated by index entry...", entry->offset);
97
98 return AARUF_ERROR_CANNOT_READ_BLOCK;
99 }
100
101 // Even if those two checks shall have been done before
102
103 // NOP block, skip
104 if(entry->dataType == NoData)
105 {
106 TRACE("NoData block found, skipping");
107 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
108 return AARUF_STATUS_OK;
109 }
110
111 TRACE("Reading block header at position %" PRIu64, entry->offset);
112 read_bytes = fread(&block_header, 1, sizeof(BlockHeader), ctx->imageStream);
113
114 if(read_bytes != sizeof(BlockHeader))
115 {
116 FATAL("Could not read block header at %" PRIu64, entry->offset);
117
118 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
119 return AARUF_STATUS_OK;
120 }
121
122 ctx->image_info.ImageSize += block_header.cmpLength;
123
124 // Unused, skip
125 if(entry->dataType == UserData)
126 {
127 if(block_header.sectorSize > ctx->image_info.SectorSize)
128 {
129 TRACE("Setting sector size to %" PRIu64 " bytes", block_header.sectorSize);
130 ctx->image_info.SectorSize = block_header.sectorSize;
131 }
132
133 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
134 return AARUF_STATUS_OK;
135 }
136
137 if(block_header.identifier != entry->blockType)
138 {
139 TRACE("Incorrect identifier for data block at position %" PRIu64, entry->offset);
140
141 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
142 return AARUF_STATUS_OK;
143 }
144
145 if(block_header.type != entry->dataType)
146 {
147 TRACE("Expected block with data type %4.4s at position %" PRIu64 " but found data type %4.4s",
148 (char *)&entry->blockType, entry->offset, (char *)&block_header.type);
149
150 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
151 return AARUF_STATUS_OK;
152 }
153
154 TRACE("Found data block with type %4.4s at position %" PRIu64, (char *)&entry->blockType, entry->offset);
155
156 if(block_header.compression == Lzma || block_header.compression == LzmaClauniaSubchannelTransform)
157 {
158 int error_no = 0;
159 if(block_header.compression == LzmaClauniaSubchannelTransform && block_header.type != CdSectorSubchannel)
160 {
161 TRACE("Invalid compression type %u for block with data type %u, continuing...", block_header.compression,
162 block_header.type);
163
164 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
165 return AARUF_STATUS_OK;
166 }
167
168 if(block_header.cmpLength < LZMA_PROPERTIES_LENGTH)
169 {
170 TRACE("Compressed block length %" PRIu32 " too small for LZMA properties, continuing...",
171 block_header.cmpLength);
172 TRACE("Exiting process_data_block() = AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK");
173 return AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK;
174 }
175
176 lzma_size = block_header.cmpLength - LZMA_PROPERTIES_LENGTH;
177
178 cmp_data = (lzma_size == 0) ? NULL : (uint8_t *)malloc(lzma_size);
179 if(lzma_size != 0 && cmp_data == NULL)
180 {
181 TRACE("Cannot allocate memory for block, continuing...");
182
183 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
184 return AARUF_STATUS_OK;
185 }
186
187 if(block_header.length != 0)
188 {
189 data = (uint8_t *)malloc(block_header.length);
190 if(data == NULL)
191 {
192 TRACE("Cannot allocate memory for block, continuing...");
193 free(cmp_data);
194
195 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
196 return AARUF_STATUS_OK;
197 }
198 }
199 else
200 data = NULL;
201
202 read_bytes = fread(lzma_properties, 1, LZMA_PROPERTIES_LENGTH, ctx->imageStream);
203 if(read_bytes != LZMA_PROPERTIES_LENGTH)
204 {
205 TRACE("Could not read LZMA properties, continuing...");
206 free(cmp_data);
207 free(data);
208
209 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
210 return AARUF_STATUS_OK;
211 }
212
213 if(lzma_size != 0)
214 {
215 read_bytes = fread(cmp_data, 1, lzma_size, ctx->imageStream);
216 if(read_bytes != lzma_size)
217 {
218 TRACE("Could not read compressed block, continuing...");
219 free(cmp_data);
220 free(data);
221
222 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
223 return AARUF_STATUS_OK;
224 }
225 }
226
227 if(block_header.length != 0)
228 {
229 read_bytes = block_header.length;
230 error_no = aaruf_lzma_decode_buffer(data, &read_bytes, cmp_data, &lzma_size, lzma_properties,
231 LZMA_PROPERTIES_LENGTH);
232
233 if(error_no != 0)
234 {
235 TRACE("Got error %d from LZMA, continuing...", error_no);
236 free(cmp_data);
237 free(data);
238
239 TRACE("Exiting process_data_block() = AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK");
240 return AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK;
241 }
242
243 if(read_bytes != block_header.length)
244 {
245 TRACE("Error decompressing block, expected %" PRIu32 " bytes but got %zu bytes, continuing...",
246 block_header.length, read_bytes);
247 free(cmp_data);
248 free(data);
249
250 TRACE("Exiting process_data_block() = AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK");
251 return AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK;
252 }
253 }
254 else if(lzma_size != 0)
255 {
256 TRACE("Compressed payload present for zero-length block, continuing...");
257 free(cmp_data);
258
259 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
260 return AARUF_STATUS_OK;
261 }
262
263 if(block_header.compression == LzmaClauniaSubchannelTransform && block_header.length != 0)
264 {
265 cst_data = (uint8_t *)malloc(block_header.length);
266 if(cst_data == NULL)
267 {
268 TRACE("Cannot allocate memory for block, continuing...");
269 free(cmp_data);
270 free(data);
271
272 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
273 return AARUF_STATUS_OK;
274 }
275
276 aaruf_cst_untransform(data, cst_data, block_header.length);
277 free(data);
278 data = cst_data;
279 cst_data = NULL;
280 }
281
282 free(cmp_data);
283 }
284 else if(block_header.compression == None)
285 {
286 if(block_header.length != 0)
287 {
288 data = (uint8_t *)malloc(block_header.length);
289 if(data == NULL)
290 {
291 TRACE("Cannot allocate memory for block, continuing...");
292
293 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
294 return AARUF_STATUS_OK;
295 }
296 }
297 else
298 data = NULL;
299
300 read_bytes = (block_header.length == 0) ? 0 : fread(data, 1, block_header.length, ctx->imageStream);
301
302 if(block_header.length != 0 && read_bytes != block_header.length)
303 {
304 free(data);
305 TRACE("Could not read block, continuing...");
306
307 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
308 return AARUF_STATUS_OK;
309 }
310 }
311 else
312 {
313 TRACE("Found unknown compression type %d, continuing...", block_header.compression);
314
315 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
316 return AARUF_STATUS_OK;
317 }
318
319 if(block_header.length > 0)
320 {
321 uint64_t crc64 = aaruf_crc64_data(data, block_header.length);
322
323 // Due to how C# wrote it, it is effectively reversed
324 if(ctx->header.imageMajorVersion <= AARUF_VERSION_V1) crc64 = bswap_64(crc64);
325
326 if(crc64 != block_header.crc64)
327 {
328 TRACE("Incorrect CRC found: 0x%" PRIx64 " found, expected 0x%" PRIx64 ", continuing...", crc64,
329 block_header.crc64);
330 free(data);
331
332 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
333 return AARUF_STATUS_OK;
334 }
335 }
336
337 // Check if it's not a media tag, but a sector tag, and fill the appropriate table then
338 switch(entry->dataType)
339 {
340 case CdSectorPrefix:
341 case CdSectorPrefixCorrected:
342 if(entry->dataType == CdSectorPrefixCorrected) { ctx->sector_prefix_corrected = data; }
343 else
344 ctx->sector_prefix = data;
345
346 ctx->readableSectorTags[CdSectorSync] = true;
347 ctx->readableSectorTags[CdSectorHeader] = true;
348
349 break;
350 case CdSectorSuffix:
351 case CdSectorSuffixCorrected:
352 if(entry->dataType == CdSectorSuffixCorrected)
353 ctx->sector_suffix_corrected = data;
354 else
355 ctx->sector_suffix = data;
356
357 ctx->readableSectorTags[CdSectorSubHeader] = true;
358 ctx->readableSectorTags[CdSectorEcc] = true;
359 ctx->readableSectorTags[CdSectorEccP] = true;
360 ctx->readableSectorTags[CdSectorEccQ] = true;
361 ctx->readableSectorTags[CdSectorEdc] = true;
362 break;
363 case CdSectorSubchannel:
364 ctx->sector_subchannel = data;
365 ctx->readableSectorTags[CdSectorSubchannelAaru] = true;
366 break;
367 case AppleProfileTag:
368 ctx->sector_subchannel = data;
369 ctx->readableSectorTags[AppleProfileTagAaru] = true;
370 break;
371 case AppleSonyTag:
372 ctx->sector_subchannel = data;
373 ctx->readableSectorTags[PriamDataTowerTagAaru] = true;
374 break;
375 case PriamDataTowerTag:
376 ctx->sector_subchannel = data;
377 ctx->readableSectorTags[AppleSonyTagAaru] = true;
378 break;
379 case CompactDiscMode2Subheader:
380 ctx->mode2_subheaders = data;
381 break;
382 case DvdSectorId:
383 ctx->sector_id = data;
384 ctx->readableSectorTags[DvdSectorNumber] = true;
385 ctx->readableSectorTags[DvdSectorInformation] = true;
386 break;
387 case DvdSectorIed:
388 ctx->sector_ied = data;
389 ctx->readableSectorTags[DvdSectorIedAaru] = true;
390 break;
391 case DvdSectorCprMai:
392 ctx->sector_cpr_mai = data;
393 ctx->readableSectorTags[DvdCmi] = true;
394 break;
395 case DvdSectorEdc:
396 ctx->sector_edc = data;
397 ctx->readableSectorTags[DvdSectorEdcAaru] = true;
398 break;
399 case DvdTitleKeyDecrypted:
400 ctx->sector_decrypted_title_key = data;
401 ctx->readableSectorTags[DvdSectorTitleKeyDecrypted] = true;
402 break;
403 default:
404 media_tag = (mediaTagEntry *)malloc(sizeof(mediaTagEntry));
405
406 if(media_tag == NULL)
407 {
408 TRACE("Cannot allocate memory for media tag entry.");
409 free(data);
410 data = NULL;
411 break;
412 }
413 memset(media_tag, 0, sizeof(mediaTagEntry));
414
415 media_tag->type = aaruf_get_media_tag_type_for_datatype(block_header.type);
416 media_tag->data = data;
417 media_tag->length = block_header.length;
418
419 HASH_REPLACE_INT(ctx->mediaTags, type, media_tag, old_media_tag);
420
421 if(old_media_tag != NULL)
422 {
423 TRACE("Replaced media tag with type %d", old_media_tag->type);
424 free(old_media_tag->data);
425 free(old_media_tag);
426 old_media_tag = NULL;
427 }
428
429 break;
430 }
431
432 TRACE("Exiting process_data_block() = AARUF_STATUS_OK");
433 return AARUF_STATUS_OK;
434}
aaruformat.h
LZMA_PROPERTIES_LENGTH
#define LZMA_PROPERTIES_LENGTH
Size in bytes of the fixed LZMA properties header (lc/lp/pb + dictionary size).
Definition consts.h:82
AARUF_VERSION_V1
#define AARUF_VERSION_V1
First on‑disk version (C# implementation).
Definition consts.h:71
process_data_block
int32_t process_data_block(aaruformat_context *ctx, IndexEntry *entry)
Processes a data block from the image stream.
Definition data.c:71
aaruf_crc64_data
uint64_t aaruf_crc64_data(const uint8_t *data, uint32_t len)
Definition crc64.c:160
aaruf_lzma_decode_buffer
int32_t aaruf_lzma_decode_buffer(uint8_t *dst_buffer, size_t *dst_size, const uint8_t *src_buffer, size_t *src_size, const uint8_t *props, size_t props_size)
Decodes an LZMA-compressed buffer.
Definition lzma.c:39
aaruf_get_media_tag_type_for_datatype
int32_t aaruf_get_media_tag_type_for_datatype(int32_t type)
Converts an image data type to an Aaru media tag type.
Definition helpers.c:39
aaruf_cst_untransform
int32_t aaruf_cst_untransform(const uint8_t *sequential, uint8_t *interleaved, size_t length)
Reverses the CST (Claunia's Subchannel Transform) transformation from sequential to interleaved data.
Definition cst.c:193
bswap_64
#define bswap_64(x)
Definition endian.h:81
CdSectorSubchannel
@ CdSectorSubchannel
Compact Disc subchannel data.
Definition enums.h:116
AppleProfileTag
@ AppleProfileTag
Apple Profile (20‑byte) tag.
Definition enums.h:117
DvdSectorIed
@ DvdSectorIed
DVD ID Error Detection Code (IED)
Definition enums.h:129
CdSectorPrefixCorrected
@ CdSectorPrefixCorrected
Compact Disc sector prefix (sync, header) corrected-only stored.
Definition enums.h:121
DvdSectorCprMai
@ DvdSectorCprMai
DVD Copyright Management Information (CPR_MAI)
Definition enums.h:126
AppleSonyTag
@ AppleSonyTag
Apple Sony (12‑byte) tag.
Definition enums.h:118
CdSectorPrefix
@ CdSectorPrefix
Compact Disc sector prefix (sync, header).
Definition enums.h:114
CdSectorSuffixCorrected
@ CdSectorSuffixCorrected
Compact Disc sector suffix (EDC, ECC P, ECC Q) corrected-only stored.
Definition enums.h:122
PriamDataTowerTag
@ PriamDataTowerTag
Priam Data Tower (24‑byte) tag.
Definition enums.h:119
UserData
@ UserData
User (main) data.
Definition enums.h:46
NoData
@ NoData
No data.
Definition enums.h:45
DvdSectorEdc
@ DvdSectorEdc
DVD Error Detection Code (EDC)
Definition enums.h:130
DvdSectorTitleKeyDecrypted
@ DvdSectorTitleKeyDecrypted
Decrypted DVD Title Key.
Definition enums.h:127
DvdSectorId
@ DvdSectorId
DVD Identification Data (ID)
Definition enums.h:128
CdSectorSuffix
@ CdSectorSuffix
Compact Disc sector suffix (EDC, ECC P, ECC Q).
Definition enums.h:115
CompactDiscMode2Subheader
@ CompactDiscMode2Subheader
Compact Disc MODE 2 subheader.
Definition enums.h:123
Lzma
@ Lzma
LZMA compression.
Definition enums.h:34
LzmaClauniaSubchannelTransform
@ LzmaClauniaSubchannelTransform
LZMA applied to Claunia Subchannel Transform processed data.
Definition enums.h:36
None
@ None
Not compressed.
Definition enums.h:33
AARUF_STATUS_OK
#define AARUF_STATUS_OK
Sector present and read without uncorrectable errors.
Definition errors.h:75
AARUF_ERROR_CANNOT_READ_BLOCK
#define AARUF_ERROR_CANNOT_READ_BLOCK
Generic block read failure (seek/read error).
Definition errors.h:46
AARUF_ERROR_NOT_AARUFORMAT
#define AARUF_ERROR_NOT_AARUFORMAT
Input file/stream failed magic or structural validation.
Definition errors.h:40
AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK
#define AARUF_ERROR_CANNOT_DECOMPRESS_BLOCK
Decompression routine failed or size mismatch.
Definition errors.h:56
DvdSectorIedAaru
@ DvdSectorIedAaru
DVD sector ID error detection, 2 bytes.
Definition aaru.h:914
CdSectorHeader
@ CdSectorHeader
4-byte CD header (minute, second, frame, mode)
Definition aaru.h:898
CdSectorEdc
@ CdSectorEdc
32-bit CRC (EDC)
Definition aaru.h:900
CdSectorEccP
@ CdSectorEccP
172 bytes Reed-Solomon ECC (P)
Definition aaru.h:901
DvdSectorEdcAaru
@ DvdSectorEdcAaru
DVD sector EDC, 4 bytes.
Definition aaru.h:915
DvdCmi
@ DvdCmi
DVD Copyright Management Information (CSS)
Definition aaru.h:908
CdSectorSubchannelAaru
@ CdSectorSubchannelAaru
96 raw subchannel bytes (P-W)
Definition aaru.h:904
CdSectorSubHeader
@ CdSectorSubHeader
Mode 2 Form subheader (8 bytes: copy, submode, channel)
Definition aaru.h:899
DvdSectorNumber
@ DvdSectorNumber
DVD sector number, 3 bytes.
Definition aaru.h:913
PriamDataTowerTagAaru
@ PriamDataTowerTagAaru
Priam DataTower sector tags, 24 bytes.
Definition aaru.h:917
AppleProfileTagAaru
@ AppleProfileTagAaru
Apple's Profile sector tags, 20 bytes.
Definition aaru.h:916
DvdSectorInformation
@ DvdSectorInformation
DVD sector information, 1 bytes.
Definition aaru.h:912
CdSectorEcc
@ CdSectorEcc
Combined P+Q ECC (276 bytes)
Definition aaru.h:903
DvdTitleKeyDecrypted
@ DvdTitleKeyDecrypted
Decrypted DVD sector title key, 5 bytes.
Definition aaru.h:911
CdSectorSync
@ CdSectorSync
12-byte CD sync pattern (00 FF*10 00)
Definition aaru.h:897
CdSectorEccQ
@ CdSectorEccQ
104 bytes Reed-Solomon ECC (Q)
Definition aaru.h:902
AppleSonyTagAaru
@ AppleSonyTagAaru
Apple's Sony sector tags, 12 bytes (address prolog + checksum)
Definition aaru.h:896
log.h
FATAL
#define FATAL(fmt,...)
Definition log.h:40
TRACE
#define TRACE(fmt,...)
Definition log.h:25
AaruHeaderV2::imageMajorVersion
uint8_t imageMajorVersion
Container format major version.
Definition header.h:110
BlockHeader
Header preceding the compressed data payload of a data block (BlockType::DataBlock).
Definition data.h:71
BlockHeader::cmpLength
uint32_t cmpLength
Size in bytes of the compressed payload immediately following this header.
Definition data.h:76
BlockHeader::length
uint32_t length
Size in bytes of the uncompressed payload resulting after decompression.
Definition data.h:77
BlockHeader::identifier
uint32_t identifier
Block identifier, must be BlockType::DataBlock.
Definition data.h:72
BlockHeader::sectorSize
uint32_t sectorSize
Size in bytes of each logical sector represented in this block.
Definition data.h:75
BlockHeader::crc64
uint64_t crc64
CRC64-ECMA of the uncompressed payload (length bytes).
Definition data.h:79
BlockHeader::type
uint16_t type
Logical data classification (value from DataType).
Definition data.h:73
BlockHeader::compression
uint16_t compression
Compression algorithm used (value from CompressionType).
Definition data.h:74
ImageInfo::SectorSize
uint32_t SectorSize
Size of each logical sector in bytes (512, 2048, 2352, 4096, etc.)
Definition aaru.h:875
ImageInfo::ImageSize
uint64_t ImageSize
Size of the image payload in bytes (excludes headers/metadata)
Definition aaru.h:873
IndexEntry
Single index entry describing a block's type, (optional) data classification, and file offset.
Definition index.h:109
IndexEntry::blockType
uint32_t blockType
Block identifier of the referenced block (value from BlockType).
Definition index.h:110
IndexEntry::offset
uint64_t offset
Absolute byte offset in the image where the referenced block header begins.
Definition index.h:112
IndexEntry::dataType
uint16_t dataType
Data classification (value from DataType) or unused for untyped blocks.
Definition index.h:111
aaruformat_context
Master context representing an open or in‑creation Aaru image.
Definition context.h:172
aaruformat_context::sector_cpr_mai
uint8_t * sector_cpr_mai
DVD sector CPR_MAI (6 bytes) if present.
Definition context.h:207
aaruformat_context::sector_prefix_corrected
uint8_t * sector_prefix_corrected
Corrected variant (post error correction) if stored.
Definition context.h:200
aaruformat_context::sector_ied
uint8_t * sector_ied
DVD sector IED (2 bytes) if present.
Definition context.h:206
aaruformat_context::sector_prefix
uint8_t * sector_prefix
Raw per-sector prefix (e.g., sync+header) uncorrected.
Definition context.h:199
aaruformat_context::sector_edc
uint8_t * sector_edc
DVD sector EDC (4 bytes) if present.
Definition context.h:208
aaruformat_context::sector_suffix
uint8_t * sector_suffix
Raw per-sector suffix (EDC/ECC) uncorrected.
Definition context.h:201
aaruformat_context::header
AaruHeaderV2 header
Parsed container header (v2).
Definition context.h:175
aaruformat_context::mediaTags
mediaTagEntry * mediaTags
Hash table of extra media tags (uthash root).
Definition context.h:264
aaruformat_context::sector_decrypted_title_key
uint8_t * sector_decrypted_title_key
DVD decrypted title key (5 bytes) if present.
Definition context.h:209
aaruformat_context::sector_subchannel
uint8_t * sector_subchannel
Raw 96-byte subchannel (if captured).
Definition context.h:203
aaruformat_context::imageStream
FILE * imageStream
Underlying FILE* stream (binary mode).
Definition context.h:176
aaruformat_context::mode2_subheaders
uint8_t * mode2_subheaders
MODE2 Form1/Form2 8-byte subheaders (concatenated).
Definition context.h:204
aaruformat_context::image_info
ImageInfo image_info
Exposed high-level image info summary.
Definition context.h:260
aaruformat_context::sector_id
uint8_t * sector_id
DVD sector ID (4 bytes) if present.
Definition context.h:205
aaruformat_context::readableSectorTags
bool * readableSectorTags
Per-sector boolean array (optical tags read successfully?).
Definition context.h:263
aaruformat_context::sector_suffix_corrected
uint8_t * sector_suffix_corrected
Corrected suffix if stored separately.
Definition context.h:202
mediaTagEntry
Hash table entry for an arbitrary media tag (e.g., proprietary drive/medium descriptor).
Definition context.h:119
mediaTagEntry::data
uint8_t * data
Tag data blob (opaque to library core); length bytes long.
Definition context.h:120
mediaTagEntry::type
int32_t type
Numeric type identifier.
Definition context.h:121
mediaTagEntry::length
uint32_t length
Length in bytes of data.
Definition context.h:122