graine.hex0
← Le code · src/amorce/graine.hex0 · 467 lignes
# graine.hex0 : la graine de miaou, écrite à la main en octets (Mach-O, macOS ARM64).
# Elle lit du texte hexadécimal sur l'entrée standard et écrit les octets sur la sortie standard.
# Règles : deux chiffres hexadécimaux = un octet ; '#' ou ';' ouvre un commentaire jusqu'à la fin de la ligne ; le reste est ignoré.
# Code de sortie : 0 = fini, 1 = échec de lecture ou d'écriture, 2 = nombre impair de chiffres hexadécimaux.
# Chaque ligne donne sa position dans le fichier (hex) en commentaire.
# ---------------------------------------------------------------------------
# En-tête Mach-O (32 octets)
cf fa ed fe # 000 magic MH_MAGIC_64
0c 00 00 01 # 004 cputype ARM64
00 00 00 00 # 008 cpusubtype ALL
02 00 00 00 # 00c filetype MH_EXECUTE
0b 00 00 00 # 010 ncmds = 11
38 02 00 00 # 014 sizeofcmds = 568
85 00 20 00 # 018 flags NOUNDEFS DYLDLINK TWOLEVEL PIE
00 00 00 00 # 01c reserved
# ---------------------------------------------------------------------------
# LC_SEGMENT_64 __PAGEZERO (72 octets) : 4 Gio sans accès, attrape les pointeurs nuls
19 00 00 00 48 00 00 00 # 020 cmd, cmdsize 72
5f 5f 50 41 47 45 5a 45 52 4f 00 00 00 00 00 00 # 028 "__PAGEZERO"
00 00 00 00 00 00 00 00 # 038 vmaddr 0
00 00 00 00 01 00 00 00 # 040 vmsize 0x100000000
00 00 00 00 00 00 00 00 # 048 fileoff 0
00 00 00 00 00 00 00 00 # 050 filesize 0
00 00 00 00 00 00 00 00 # 058 maxprot 0, initprot 0
00 00 00 00 00 00 00 00 # 060 nsects 0, flags 0
# LC_SEGMENT_64 __TEXT (152 octets, une section) : en-tête et code, lecture + exécution
19 00 00 00 98 00 00 00 # 068 cmd, cmdsize 152
5f 5f 54 45 58 54 00 00 00 00 00 00 00 00 00 00 # 070 "__TEXT"
00 00 00 00 01 00 00 00 # 080 vmaddr 0x100000000
00 40 00 00 00 00 00 00 # 088 vmsize 0x4000 (une page de 16 Kio)
00 00 00 00 00 00 00 00 # 090 fileoff 0
00 40 00 00 00 00 00 00 # 098 filesize 0x4000 (toute la page)
05 00 00 00 05 00 00 00 # 0a0 maxprot r-x, initprot r-x
01 00 00 00 00 00 00 00 # 0a8 nsects 1, flags 0
# section __text : là où vit le code
5f 5f 74 65 78 74 00 00 00 00 00 00 00 00 00 00 # 0b0 "__text"
5f 5f 54 45 58 54 00 00 00 00 00 00 00 00 00 00 # 0c0 "__TEXT"
60 02 00 00 01 00 00 00 # 0d0 addr 0x100000260
e0 00 00 00 00 00 00 00 # 0d8 size 0xe0 (56 instructions)
60 02 00 00 04 00 00 00 # 0e0 offset 0x260, align 2^4
00 00 00 00 00 00 00 00 # 0e8 reloff 0, nreloc 0
00 04 00 80 00 00 00 00 # 0f0 flags PURE_INSTRUCTIONS SOME_INSTRUCTIONS, reserved1
00 00 00 00 00 00 00 00 # 0f8 reserved2, reserved3
# LC_SEGMENT_64 __LINKEDIT (72 octets) : données de dyld et signature, lecture seule
19 00 00 00 48 00 00 00 # 100 cmd, cmdsize 72
5f 5f 4c 49 4e 4b 45 44 49 54 00 00 00 00 00 00 # 108 "__LINKEDIT"
00 40 00 00 01 00 00 00 # 118 vmaddr 0x100004000
00 40 00 00 00 00 00 00 # 120 vmsize 0x4000
00 40 00 00 00 00 00 00 # 128 fileoff 0x4000 (doit être aligné sur une page, sinon le noyau tue le processus)
60 01 00 00 00 00 00 00 # 130 filesize 0x160
01 00 00 00 01 00 00 00 # 138 maxprot r--, initprot r--
00 00 00 00 00 00 00 00 # 140 nsects 0, flags 0
# LC_DYLD_CHAINED_FIXUPS (16 octets) : correctifs vides, rien à lier
34 00 00 80 10 00 00 00 # 148 cmd, cmdsize 16
00 40 00 00 38 00 00 00 # 150 dataoff 0x4000, datasize 56
# LC_SYMTAB (24 octets) : aucun symbole
02 00 00 00 18 00 00 00 # 158 cmd, cmdsize 24
00 00 00 00 00 00 00 00 # 160 symoff 0, nsyms 0
38 40 00 00 00 00 00 00 # 168 stroff 0x4038, strsize 0
# LC_DYSYMTAB (80 octets) : tout à zéro
0b 00 00 00 50 00 00 00 # 170 cmd, cmdsize 80
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # 178
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # 188
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # 198
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 # 1a8
00 00 00 00 00 00 00 00 # 1b8
# LC_LOAD_DYLINKER (32 octets) : le chargeur est /usr/lib/dyld
0e 00 00 00 20 00 00 00 # 1c0 cmd, cmdsize 32
0c 00 00 00 # 1c8 position du nom 12
2f 75 73 72 2f 6c 69 62 2f 64 79 6c 64 00 # 1cc "/usr/lib/dyld"
00 00 00 00 00 00 # 1da remplissage
# LC_MAIN (24 octets) : point d'entrée = début du code
28 00 00 80 18 00 00 00 # 1e0 cmd, cmdsize 24
60 02 00 00 00 00 00 00 # 1e8 entryoff 0x260
00 00 00 00 00 00 00 00 # 1f0 stacksize 0 (par défaut)
# LC_LOAD_DYLIB (56 octets) : libSystem, exigée par Apple, rien n'y est importé
0c 00 00 00 38 00 00 00 # 1f8 cmd, cmdsize 56
18 00 00 00 02 00 00 00 # 200 position du nom 24, timestamp 2
03 64 27 05 00 00 01 00 # 208 current_version 1319.100.3, compatibility_version 1.0.0
2f 75 73 72 2f 6c 69 62 2f 6c 69 62 53 79 73 74 65 6d 2e 42 2e 64 79 6c 69 62 00 # 210 "/usr/lib/libSystem.B.dylib"
00 00 00 00 00 # 22b remplissage
# LC_BUILD_VERSION (24 octets) : macOS 11.0
32 00 00 00 18 00 00 00 # 230 cmd, cmdsize 24
01 00 00 00 # 238 platform MACOS
00 00 0b 00 00 00 0b 00 # 23c minos 11.0, sdk 11.0
00 00 00 00 # 244 ntools 0
# LC_CODE_SIGNATURE (16 octets) : où vit la signature
1d 00 00 00 10 00 00 00 # 248 cmd, cmdsize 16
40 40 00 00 20 01 00 00 # 250 dataoff 0x4040, datasize 0x120
00 00 00 00 00 00 00 00 # 258 remplissage jusqu'au code
# ---------------------------------------------------------------------------
# Code (ARM64). Registres : x19 = 1 si un chiffre haut attend, x20 = ce chiffre, x21 = octet lu, x22 = valeur du chiffre.
# Appels système : numéro dans x16, svc #0x80, échec = retenue levée.
# début : une case de 16 octets sur la pile, sert de tampon d'un octet
ff 43 00 d1 # 260 sub sp, sp, #16
13 00 80 d2 # 264 mov x19, #0
14 00 80 d2 # 268 mov x20, #0
# lire : lire un octet dans [sp]
00 00 80 d2 # 26c mov x0, #0 ; entrée standard
e1 03 00 91 # 270 mov x1, sp
22 00 80 d2 # 274 mov x2, #1
70 00 80 d2 # 278 mov x16, #3 ; lecture
01 10 00 d4 # 27c svc #0x80
a2 05 00 54 # 280 b.cs echec ; -> 334
e0 04 00 b4 # 284 cbz x0, fin ; fin de l'entrée -> 320
f5 03 40 39 # 288 ldrb w21, [sp]
# trier l'octet : commentaire, chiffre décimal, lettre hexadécimale, ou ignoré
bf 8e 00 71 # 28c cmp w21, #0x23 ; '#'
20 03 00 54 # 290 b.eq commentaire ; -> 2f4
bf ee 00 71 # 294 cmp w21, #0x3b ; ';'
e0 02 00 54 # 298 b.eq commentaire ; -> 2f4
b6 c2 00 51 # 29c sub w22, w21, #0x30 ; '0'
df 26 00 71 # 2a0 cmp w22, #9
c9 00 00 54 # 2a4 b.ls chiffre ; -> 2bc
b5 02 1b 32 # 2a8 orr w21, w21, #0x20 ; minuscule
b6 86 01 51 # 2ac sub w22, w21, #0x61 ; 'a'
df 16 00 71 # 2b0 cmp w22, #5
c8 fd ff 54 # 2b4 b.hi lire ; pas hex : ignoré -> 26c
d6 2a 00 11 # 2b8 add w22, w22, #10
# chiffre : le premier chiffre attend, le second complète l'octet
93 00 00 b5 # 2bc cbnz x19, second ; -> 2cc
f4 03 16 aa # 2c0 mov x20, x22
33 00 80 d2 # 2c4 mov x19, #1
e9 ff ff 17 # 2c8 b lire ; -> 26c
# second : octet = haut * 16 + bas, écrit sur la sortie standard
d4 12 14 0b # 2cc add w20, w22, w20, lsl #4
f4 03 00 39 # 2d0 strb w20, [sp]
20 00 80 d2 # 2d4 mov x0, #1 ; sortie standard
e1 03 00 91 # 2d8 mov x1, sp
22 00 80 d2 # 2dc mov x2, #1
90 00 80 d2 # 2e0 mov x16, #4 ; écriture
01 10 00 d4 # 2e4 svc #0x80
62 02 00 54 # 2e8 b.cs echec ; -> 334
13 00 80 d2 # 2ec mov x19, #0
df ff ff 17 # 2f0 b lire ; -> 26c
# (un remplissage dans le code casserait les positions : aucun ici)
# commentaire : sauter les octets jusqu'à la fin de la ligne
00 00 80 d2 # 2f4 mov x0, #0
e1 03 00 91 # 2f8 mov x1, sp
22 00 80 d2 # 2fc mov x2, #1
70 00 80 d2 # 300 mov x16, #3 ; lecture
01 10 00 d4 # 304 svc #0x80
62 01 00 54 # 308 b.cs echec ; -> 334
a0 00 00 b4 # 30c cbz x0, fin ; -> 320
f5 03 40 39 # 310 ldrb w21, [sp]
bf 2a 00 71 # 314 cmp w21, #0x0a ; '\n'
e1 fe ff 54 # 318 b.ne commentaire ; -> 2f4
d4 ff ff 17 # 31c b lire ; -> 26c
# fin : un chiffre resté seul signifie un compte impair
73 00 00 b5 # 320 cbnz x19, impair ; -> 32c
00 00 80 d2 # 324 mov x0, #0
04 00 00 14 # 328 b sortir ; -> 338
# impair
40 00 80 d2 # 32c mov x0, #2
02 00 00 14 # 330 b sortir ; -> 338
# échec
20 00 80 d2 # 334 mov x0, #1
# sortir : exit(x0)
30 00 80 d2 # 338 mov x16, #1 ; sortie
01 10 00 d4 # 33c svc #0x80
# ---------------------------------------------------------------------------
# Zéros de 0x340 à 0x4000 : le noyau projette les segments par pages entières de 16 Kio, donc __LINKEDIT doit commencer sur une frontière de page (243 lignes de 64 octets nuls).
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
# ---------------------------------------------------------------------------
# __LINKEDIT en 0x4000. Correctifs chaînés vides (56 octets) : en-tête, puis 3 segments sans correctif.
00 00 00 00 20 00 00 00 # 4000 fixups_version 0, starts_offset 32
30 00 00 00 30 00 00 00 # 4008 imports_offset 48, symbols_offset 48
00 00 00 00 01 00 00 00 # 4010 imports_count 0, imports_format 1
00 00 00 00 00 00 00 00 # 4018 symbols_format 0, remplissage
03 00 00 00 00 00 00 00 # 4020 seg_count 3, seg_info_offset[0]
00 00 00 00 00 00 00 00 # 4028 seg_info_offset[1], seg_info_offset[2]
00 00 00 00 00 00 00 00 # 4030 remplissage
00 00 00 00 00 00 00 00 # 4038 remplissage jusqu'à la signature
# ---------------------------------------------------------------------------
# Signature ad hoc en 0x4040 (gros-boutiste) : un SuperBlob qui contient un CodeDirectory.
fa de 0c c0 00 00 01 13 # 4040 magic EMBEDDED_SIGNATURE, length 275
00 00 00 01 # 4048 count 1
00 00 00 00 00 00 00 14 # 404c type CODEDIRECTORY, offset 20
# CodeDirectory (255 octets)
fa de 0c 02 00 00 00 ff # 4054 magic CODEDIRECTORY, length 255
00 02 04 00 # 405c version 0x20400
00 02 00 02 # 4060 flags ADHOC LINKER_SIGNED
00 00 00 5f 00 00 00 58 # 4064 hashOffset 95, identOffset 88
00 00 00 00 00 00 00 05 # 406c nSpecialSlots 0, nCodeSlots 5
00 00 40 40 # 4074 codeLimit 0x4040 (tout ce qui précède la signature)
20 02 00 0c # 4078 hashSize 32, hashType SHA-256, platform 0, pageSize 2^12
00 00 00 00 # 407c spare2
00 00 00 00 00 00 00 00 00 00 00 00 # 4080 scatterOffset, teamOffset, spare3
00 00 00 00 00 00 00 00 # 408c codeLimit64
00 00 00 00 00 00 00 00 # 4094 execSegBase 0
00 00 00 00 00 00 40 00 # 409c execSegLimit 0x4000
00 00 00 00 00 00 00 01 # 40a4 execSegFlags MAIN_BINARY
67 72 61 69 6e 65 00 # 40ac identifiant "graine"
# SHA-256 de chaque page de 4 Kio avant la signature (0x0000, 0x1000, 0x2000, 0x3000, 0x4000-0x403f).
# Les seuls octets pas écrits à la main : calculés une fois par `shasum -a 256`, revérifiés depuis par notre propre SHA-256 (signeur.hex0) : identiques.
a9 17 00 6b 5e 1f d5 e2 ff e6 47 58 a7 a5 94 c2 bb 55 0e ac bb 44 0c 72 7a 28 f2 3c f7 22 b0 55 # 40b3 page 0
ad 7f ac b2 58 6f c6 e9 66 c0 04 d7 d1 d1 6b 02 4f 58 05 ff 7c b4 7c 7a 85 da bd 8b 48 89 2c a7 # page nulle
ad 7f ac b2 58 6f c6 e9 66 c0 04 d7 d1 d1 6b 02 4f 58 05 ff 7c b4 7c 7a 85 da bd 8b 48 89 2c a7 # page nulle
ad 7f ac b2 58 6f c6 e9 66 c0 04 d7 d1 d1 6b 02 4f 58 05 ff 7c b4 7c 7a 85 da bd 8b 48 89 2c a7 # page nulle
b6 15 f4 af 01 8a 2d 46 cf e2 34 ed 74 ca bf 41 b1 86 59 7f 50 f6 be 06 e0 28 74 58 25 f7 60 74 # 4133 page 4
00 00 00 00 00 00 00 00 00 00 00 00 00 # 4153 remplissage jusqu'à 0x4160 (fin du fichier)