35#if defined(_WIN32) || defined(_WIN64)
52#if defined(_WIN32) || defined(_WIN64)
53 SetLastError((DWORD)error_code);
82 TRACE(
"Entering aaruf_close(%p)", context);
90 FATAL(
"Invalid context");
100 FATAL(
"Invalid context");
115 TRACE(
"Freeing memory pointers");
143 TRACE(
"Freeing media tags");
147 free(media_tag->
data);
152 TRACE(
"Unmapping user data DDT if it is not in memory");
239 memset(region_mem, 0, wiiu_count * 24);
265 memset(wii_region, 0, wii_count * 24);
294 TRACE(
"Exiting aaruf_close() = 0");
static void aaruf_set_close_error(const int error_code)
int aaruf_close(void *context)
Close an Aaru image context, flushing pending data structures and releasing resources.
#define AARU_MAGIC
Magic identifier for AaruFormat container (ASCII "AARUFRMT").
void aaruf_ecc_cd_free(void *context)
Frees a Compact Disc ECC context and its internal tables.
void ec_free(aaruformat_context *ctx)
Free all erasure coding state from the context.
#define AARUF_STATUS_OK
Sector present and read without uncorrectable errors.
void free_cache(struct CacheHeader *cache)
Frees all entries in the cache and clears it.
uint8_t * spamsum
SpamSum fuzzy hash (ASCII), allocated length+1 with trailing 0.
uint8_t * firmware
Firmware version string or NULL.
uint8_t * revision
Hardware revision string or NULL.
uint8_t * model
Model string or NULL.
uint8_t * softwareName
Dump software name or NULL.
struct DumpExtent * extents
Array of extents (entry.extents elements) or NULL.
uint8_t * manufacturer
Manufacturer string (UTF-8) or NULL.
uint8_t * softwareVersion
Dump software version or NULL.
uint8_t * serial
Serial number string or NULL.
uint8_t * softwareOperatingSystem
Host operating system string or NULL.
Master context representing an open or in‑creation Aaru image.
uint8_t * ps3_disc_key
Cached disc key (16 bytes), NULL if not loaded.
Checksums checksums
Whole-image checksums discovered.
void * wiiu_partition_regions
Parsed WiiuPartitionRegion array, NULL if not loaded.
uint8_t * cicm_block
CICM XML payload.
uint8_t * sector_cpr_mai
DVD sector CPR_MAI (6 bytes) if present.
uint32_t ps3_plaintext_region_count
Number of plaintext regions.
uint8_t * sector_prefix_corrected
Corrected variant (post error correction) if stored.
uint64_t * user_data_ddt
Legacy flat DDT pointer (NULL when using v2 mini/big arrays).
uint32_t wiiu_partition_region_count
Number of partition regions.
uint16_t ngcw_junk_seed_size
LFG seed size in uint32 words (expected: 17).
TrackEntry * data_tracks
Filtered list of data tracks (subset of trackEntries).
uint8_t * wiiu_encrypted_block_cache
Cached re-encrypted 0x8000-byte physical sector.
void * ngcw_junk_entries
Parsed NgcwJunkEntry array, NULL if not loaded.
struct CacheHeader block_header_cache
LRU/Cache header for block headers.
uint8_t * sector_ied
DVD sector IED (2 bytes) if present.
uint64_t * user_data_ddt2
DDT entries (big variant) primary/secondary current.
uint8_t * sector_prefix
Raw per-sector prefix (e.g., sync+header) uncorrected.
uint64_t * sector_suffix_ddt2
CD sector suffix DDT V2.
uint8_t * sector_edc
DVD sector EDC (4 bytes) if present.
CdEccContext * ecc_cd_context
CD ECC/EDC helper tables (allocated on demand).
struct CacheHeader block_cache
LRU/Cache header for block payloads.
bool ps3_encryption_initialized
Whether lazy init has occurred.
uint32_t * sector_suffix_ddt
Legacy CD sector suffix DDT.
bool in_memory_ddt
True if primary (and possibly secondary) DDT loaded.
uint8_t * sector_suffix
Raw per-sector suffix (EDC/ECC) uncorrected.
int32_t(* finalize_write)(struct aaruformat_context *ctx)
Writer finalization hook (NULL for reader).
uint64_t magic
File magic (AARU_MAGIC) post-open.
uint64_t * sector_prefix_ddt2
CD sector prefix DDT V2.
mediaTagEntry * mediaTags
Hash table of extra media tags (uthash root).
uint8_t * wiiu_disc_key
Cached disc key (16 bytes), NULL if not loaded.
struct DumpHardwareEntriesWithData * dump_hardware_entries_with_data
Array of dump hardware entries + strings.
uint32_t ngcw_junk_entry_count
Number of junk entries.
uint64_t * cached_secondary_ddt2
Cached secondary table (big entries) or NULL.
uint32_t wii_partition_region_count
Number of partition regions.
bool wiiu_encryption_initialized
Whether lazy init has occurred.
bool wii_encryption_initialized
Whether lazy init has occurred.
uint8_t * sector_subchannel
Raw 96-byte subchannel (if captured).
void * wii_partition_regions
Parsed WiiPartitionRegion array, NULL if not loaded.
FILE * imageStream
Underlying FILE* stream (binary mode).
UT_array * index_entries
Flattened index entries (UT_array of IndexEntry).
uint8_t * mode2_subheaders
MODE2 Form1/Form2 8-byte subheaders (concatenated).
bool wii_cache_valid
Whether the encrypted group cache is valid.
uint8_t * sector_id
DVD sector ID (4 bytes) if present.
DumpHardwareHeader dump_hardware_header
Dump hardware header.
void * ps3_plaintext_regions
Parsed Ps3PlaintextRegion array (max 32), NULL if not loaded.
bool * readableSectorTags
Per-sector boolean array (optical tags read successfully?).
uint32_t * sector_prefix_ddt
Legacy CD sector prefix DDT (deprecated by *2).
bool wiiu_cache_valid
Whether the encrypted block cache is valid.
TrackEntry * track_entries
Full track list (tracksHeader.entries elements).
uint8_t * sector_suffix_corrected
Corrected suffix if stored separately.
uint8_t * metadata_block
Raw metadata UTF-16LE concatenated strings.
uint8_t * wii_encrypted_group_cache
Cached re-encrypted 0x8000-byte group.
bool ngcw_junk_initialized
Whether junk map has been loaded.
size_t mapped_memory_ddt_size
Length of mmapped DDT if userDataDdt is mmapped.
Hash table entry for an arbitrary media tag (e.g., proprietary drive/medium descriptor).
uint8_t * data
Tag data blob (opaque to library core); length bytes long.