From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:PyInstaller archive (CArchive and PYZ)" |
|---|
| claim | "The CArchive cookie is 88 bytes, big-endian: magic[8], pkg_length, toc_offset, toc_length, python_version (major*100+minor, e.g. 313), python_libname[64]; the archive starts at cookie_end - pkg_length and toc_offset is relative to that start." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:PyInstaller archive (CArchive and PYZ)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "ARCHIVE_COOKIE" |
|---|
| size | 88 |
|---|
| fields | | name | "magic" |
|---|
| offset | 0 |
|---|
| type | "char[8]" |
|---|
|
| name | "pkg_length" |
|---|
| offset | 8 |
|---|
| type | "uint32 BE" |
|---|
|
| name | "toc_offset" |
|---|
| offset | 12 |
|---|
| type | "uint32 BE" |
|---|
|
| name | "toc_length" |
|---|
| offset | 16 |
|---|
| type | "uint32 BE" |
|---|
|
| name | "python_version" |
|---|
| offset | 20 |
|---|
| type | "uint32 BE" |
|---|
|
| name | "python_libname" |
|---|
| offset | 24 |
|---|
| type | "char[64]" |
|---|
|
|
|---|
| endianness | "big" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "struct format '!8sIIII64s' and start/end offset computation; writers.py computes pyvers = major*100+minor" |
|---|
| repo | "https://github.com/pyinstaller/pyinstaller" |
|---|
| commit | "ad07220e06931adbd54d4ad1b7ef955ef2a73713" |
|---|
| path | "PyInstaller/archive/readers.py" |
|---|
| lines | "43-60, 98-106" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "CArchive cookie" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-18T08:06:30.115Z" |
|---|
| verifications | |
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T16:36:50.204Z" |
|---|
| summary | "data.endianness big added (format '!8sIIII64s'); magic is the 8 bytes 'MEI\014\013\012\013\016' found by scanning backwards from the file end; archive_length counts up to the end of the cookie." |
|---|
| changed | |
|---|
|
|
|---|