mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Implement support for reading file format header version 2.
This commit is contained in:
@@ -30,7 +30,15 @@
|
||||
#define AARU_MAGIC 0x544D524655524141
|
||||
/** 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 AARUF_VERSION 1
|
||||
#define AARUF_VERSION 2
|
||||
/** First version of AaruFormat, created in C#.
|
||||
* CRC64 was byte-swapped
|
||||
*/
|
||||
#define AARUF_VERSION_V1 1
|
||||
/** Second version of AaruFormat, created in C.
|
||||
* Introduced new header, many new features, and blocks.
|
||||
*/
|
||||
#define AARUF_VERSION_V2 2
|
||||
/** Maximum read cache size, 512MiB. */
|
||||
#define MAX_CACHE_SIZE 536870912
|
||||
/** Size in bytes of LZMA properties. */
|
||||
|
||||
@@ -34,16 +34,18 @@
|
||||
#define SHA256_DIGEST_LENGTH 32
|
||||
#endif
|
||||
|
||||
typedef struct Crc64Context {
|
||||
typedef struct Crc64Context
|
||||
{
|
||||
uint64_t finalSeed;
|
||||
uint64_t table[256];
|
||||
uint64_t hashInt;
|
||||
} Crc64Context;
|
||||
|
||||
typedef struct CdEccContext {
|
||||
bool initedEdc;
|
||||
uint8_t *eccBTable;
|
||||
uint8_t *eccFTable;
|
||||
typedef struct CdEccContext
|
||||
{
|
||||
bool initedEdc;
|
||||
uint8_t *eccBTable;
|
||||
uint8_t *eccFTable;
|
||||
uint32_t *edcTable;
|
||||
} CdEccContext;
|
||||
|
||||
@@ -73,7 +75,7 @@ typedef struct aaruformatContext
|
||||
uint8_t libraryMajorVersion;
|
||||
uint8_t libraryMinorVersion;
|
||||
FILE *imageStream;
|
||||
AaruHeader header;
|
||||
AaruHeaderV2 header;
|
||||
uint8_t *sectorPrefix;
|
||||
uint8_t *sectorPrefixCorrected;
|
||||
uint8_t *sectorSuffix;
|
||||
|
||||
Reference in New Issue
Block a user