2 InstallShield Z file format
3 Copyright 2015 <hacker@iam.tj>
4 Licenced on the terms of then GNU General Public Licence version 3
6 Data structures used in InstallShield .Z archive files
13 const unsigned int file_magic = 0x8C655D12;
14 const ssize_t Z_FILE_HEADER_BYTES = 0x100;
16 /* __prefixed field purpose is not confirmed */
17 struct __attribute__((packed)) archive_header {
18 uint32_t magic; // 0x00
19 uint16_t __version; // 0x04
20 uint16_t __flags; // 0x06
21 uint32_t __unknown08; // 0x08
22 uint16_t files_entries; // 0x0C
23 uint32_t __crc32; // 0x0E
24 uint32_t file_bytes; // 0x12
25 uint32_t payload_bytes; // 0x16
26 uint8_t __known1A; // 0x1A
27 uint16_t __unknown1B; // 0x1B
28 uint32_t __unknown1D; // 0x1D
29 uint32_t __unknown21; // 0x21
30 uint32_t __unknown25; // 0x25
31 uint32_t directories_offset; // 0x29
32 uint32_t directories_bytes; // 0x2D
33 uint16_t directories_entries; // 0x31
34 uint32_t files_offset; // 0x33
35 uint32_t files_bytes; // 0x37
36 unsigned char unknown3B[0x100 - 0x3B]; // 0x3B to 0xFF
39 struct __attribute__((packed)) dirent_prefix {
40 uint16_t __flags; // 0x00
41 uint16_t entry_bytes; // 0x02
42 uint16_t name_bytes; // 0x04
43 unsigned char name[]; // 0x06
46 struct __attribute__((packed)) dirent_suffix {
47 unsigned char __eos; // end of string NUL
48 uint32_t __unknown00; // 0x01 after end of directory_entry_prefix
51 struct __attribute__((packed)) fileent_prefix {
55 uint32_t payload_bytes;
56 uint32_t payload_offset;
65 struct __attribute__((packed)) fileent_suffix {
72 struct dirent_prefix *entry;
73 struct ll_dirents *next;
78 struct fileent_prefix *entry;
79 struct ll_fileents *next;