1 int8_t ISZ_MAGIC
[] = {0x49, 0x73, 0x5a, 0x21}; // "IsZ!" on x86
3 typedef struct isz_header_st
{
4 int8_t signature
[4]; //00-03, 'IsZ!'
5 uint8_t header_sz
; //04 , header size in bytes
6 int8_t version
; //05 , version number
8 uint32_t vsn
; //06-09, volume serial number
10 uint16_t sector_sz
; //10-11, sector size in bytes
11 uint32_t total_sectors
;//12-15, total sectors of ISO image
13 int8_t has_password
; //16 , is Password protected?
15 int64_t segment_sz
; //17-24, size of segments in bytes
16 uint32_t nblocks
; //25-28, number of chunks in image
17 uint32_t block_sz
; //29-32, chunk size in bytes (must be multiple of sector_size)
18 uint8_t block_ptr_sz
; //33 , chunk pointer length
20 int8_t segment_num
; //34 , segment number of this segment file, max 99
22 uint32_t chunk_offset
; //35-38, offset of chunk pointers, zero = none
23 uint32_t segment_offset
; //39-42, offset of segment pointers, zero = none
24 uint32_t data_offset
; //43-46, data offset
25 int8_t reserved
; //47 ,
27 // next byte at 48 = size, size = 64 unpacked
28 }__attribute__ ((packed
)) isz_header
;
30 //contents of 'has_password'
31 #define ADI_PLAIN 0 // no encryption
32 #define ADI_PASSWORD 1 // password protected (not used)
33 #define ADI_AES128 2 // AES128 encryption
34 #define ADI_AES192 3 // AES192 encryption
35 #define ADI_AES256 4 // AES256 encryption
37 // if 'segment_offset' != 0
38 typedef struct isz_seg_st
{
39 int64_t size
; // segment size in bytes
40 int32_t num_chks
; // number of chunks in current file
41 int32_t first_chkno
; // first chunk number in current file
42 int32_t chk_off
; // offset to first chunk in current file
43 int32_t left_size
; // uncompltete chunk bytes in next file
46 // if 'chunk_offset' != 0
48 typedef struct isz_chunk_st {
55 #define ADI_ZERO 0x00 // all zeros chunk
56 #define ADI_DATA 0x40 // non-compressed data
57 #define ADI_ZLIB 0x80 // ZLIB compressed
58 #define ADI_BZ2 0xC0 // BZIP2 compressed