Skyrim supports version 3.0 to 3.1 compiled script files.
The format appears to be stored in big-endian regardless of platform (Windows & PS3 both observed as big-endian).
Header
Name | Type/Size | Info |
---|---|---|
magic | uint32 | 0xFA57C0DE (FASTCODE?) |
majorVersion | uint8 | 3 |
minorVersion | uint8 | 1 |
gameId | uint16 | 1 = Skyrim? |
unknown3 | uint64 | Probably compile time? |
sourceFileName | String | Name of the source file this file was compiled from (.psc extension). |
unknown5 | String | Name of the compile build directory? |
unknown6 | String | Name of the server/machine this script was compiled on? |
stringTable | String Table | |
debugInfo | Debug Info | |
userFlags | User Flags | |
objects | Objects |
General
String
Name | Type/Size | Info |
---|---|---|
length | ushort | Length of string. |
data | char[length] | String data, not null terminated. |
Sections
String Table
Name | Type/Size | Info |
---|---|---|
count | uint16 | |
strings | String[count] |
Debug Info
Name | Type/Size | Info |
---|---|---|
unknown0 | uint8 | flag? |
modificationTime | uint64 | |
functionCount | uint16 | |
functions | Debug Function[functionCount] |
Debug Function
Name | Type/Size | Info |
---|---|---|
objectNameIndex | uint16 | Index into string table. |
stateNameIndex | uint16 | Index into string table. |
functionNameIndex | uint16 | Index into string table. |
functionType | uint8 | valid values is >= 0 && <= 3? |
instructionCount | uint16 | |
lineNumbers | uint16[instructionCount] |
User Flags
Name | Type/Size | Info |
---|---|---|
count | uint16 | |
userFlags | User Flag[count] |
User Flag
Name | Type/Size | Info |
---|---|---|
nameIndex | uint16 | Index into string table. |
flagIndex | uint8 | ? |
Objects
Name | Type/Size | Info |
---|---|---|
count | uint16 | |
objects | Object[count] |
Object
Name | Type/Size | Info |
---|---|---|
nameIndex | uint16 | Index into string table. |
size | uint32 | |
data | uint8[size-4] | (size includes itself for some reason, hence size-4) |