7 #include <mach/machine.h>
9 #define MKEXT_MAGIC 'MKXT'
10 #define MKEXT_SIGN 'MOSX'
12 #define MKEXT_EXTN ".mkext"
14 // All binary values are big-endian
16 // If all fields are 0 then this file slot is empty
17 // If compsize is zero then the file isn't compressed.
18 typedef struct mkext_file
{
19 size_t offset
; // 4 bytes
20 size_t compsize
; // 4 bytes
21 size_t realsize
; // 4 bytes
22 time_t modifiedsecs
; // 4 bytes
25 // The plist file entry is mandatory, but module may be empty
26 typedef struct mkext_kext
{
27 mkext_file plist
; // 16 bytes
28 mkext_file
module; // 16 bytes
31 typedef struct mkext_header
{
32 u_int32_t magic
; // 'MKXT'
33 u_int32_t signature
; // 'MOSX'
36 u_int32_t version
; // vers resource, currently '1.0.0', 0x01008000
38 cpu_type_t cputype
; // CPU_TYPE_ANY for fat executables
39 cpu_subtype_t cpusubtype
; // CPU_SUBTYPE_MULITPLE for executables
40 mkext_kext kext
[1]; // 64 bytes/entry
44 __private_extern__ u_int8_t
*
45 compress_lzss(u_int8_t
*dst
, u_int32_t dstlen
, u_int8_t
*src
, u_int32_t srclen
);
47 __private_extern__
int
48 decompress_lzss(u_int8_t
*dst
, u_int8_t
*src
, u_int32_t srclen
);
50 __private_extern__ u_int32_t
51 adler32(u_int8_t
*src
, int32_t length
);
55 #endif /* _MKEXT_H_ */