From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "struct" |
|---|
| subject | "Format:Papyrus compiled script (PEX)" |
|---|
| claim | "PEX header after the magic: major u8, minor u8, game id u16, compilation time 64-bit, then source file name, user name and computer name as u16-length strings." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Papyrus compiled script (PEX)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | name | "PexHeader" |
|---|
| size_min | "0x12" |
|---|
| fields | | offset | "0x0" |
|---|
| size | 4 |
|---|
| type | "uint32_t" |
|---|
| name | "magic" |
|---|
|
| offset | "0x4" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "major_version" |
|---|
|
| offset | "0x5" |
|---|
| size | 1 |
|---|
| type | "uint8_t" |
|---|
| name | "minor_version" |
|---|
|
| offset | "0x6" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "game_id" |
|---|
|
| offset | "0x8" |
|---|
| size | 8 |
|---|
| type | "int64_t" |
|---|
| name | "compilation_time" |
|---|
|
| offset | "0x10" |
|---|
| size | 2 |
|---|
| type | "uint16_t" |
|---|
| name | "source_name_length (string bytes follow; user name and computer name strings repeat the pattern)" |
|---|
|
|
|---|
| endianness | "per magic" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "readHeader field order" |
|---|
| repo | "orvid/Champollion" |
|---|
| commit | "bc961a0bdfb4831f8240e6dacee0818b4bf81e00" |
|---|
| path | "Pex/FileReader.cpp" |
|---|
| lines | "107-114" |
|---|
|
| type | "source" |
|---|
| detail | "getString: u16 length then bytes" |
|---|
| repo | "orvid/Champollion" |
|---|
| commit | "bc961a0bdfb4831f8240e6dacee0818b4bf81e00" |
|---|
| path | "Pex/FileReader.cpp" |
|---|
| lines | "578-591" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "PEX header" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T01:30:20.704Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T08:38:06.617Z" |
|---|
| result | "confirmed" |
|---|
| method | "Read Pex::FileReader::readHeader (FileReader.cpp lines 90-115) and getString (578-591) at the cited commit: magic read, major u8, minor u8, game id u16, getTime 64-bit, three u16-length strings; the magic decides endianness (LE magic = Fallout 4 style, BE magic = Skyrim), so 'per magic' is right." |
|---|
| notes | "Game id 3 and 4 mark Fallout 76 and Starfield scripts in the reader (lines 62-67)." |
|---|
|
|
|---|