Difference between revisions of "Sims 3:0x06B981ED"
Line 1: | Line 1: | ||
OBJS - Serialized script objects | OBJS - Serialized script objects | ||
− | By Tiger | + | <br>By Tiger |
The data is divided into four sections | The data is divided into four sections |
Revision as of 22:25, 18 June 2009
OBJS - Serialized script objects
By Tiger
The data is divided into four sections
Contents |
Data sections
Header (28 bytes)
DWORD version? - currently 0x00000500 DWORD magic value ("OBJS") DWORD count1 - Count of defined object types) DWORD count2 - Count of number of saved instances DWORD - Offset from the start of the data of the type definitions DWORD - Offset from the start of the data to the instance pointer table DWORD - Offset from the start of the data to a TGI index
Instances
count2 entries of varying lenght, indexed by the following section BYTE - Data type varying amounts of data See below for the types of data and the format of the data Most common here are 0x10 and 0x11, but boxed value types can appear here as well, for example when a number or enum is addad to a System.List<System.Object> collection.
Instance index
count2 repeats of DWORD - Pointer to the start of the serialized instance data This index is 1 based, with the first entry referenced as entry 1. 0 is reserved to indicate null references
Type definitions
Very loosely structured data, with lots of flags and optional values count1 repeats of class definitions Bytes null terminated indicating generic parameters or duplicate type definitions optional generic type parameters potentially nested generic parameter definitions 0x7f indicates an Interface definition, with no further type processing length + string - type name count4 of type members count4 repeats of length + string member name primitive data type
TGI
DWORD count5 - count of TGI entries TGI entries, in standard order
Primitive Types
Byte | Type of data | Data format | Notes |
---|---|---|---|
0x01 | Reference | DWORD of instance ID | |
0x02 | Boolean | BYTE | 0 for false, 1 for true |
0x03 | Byte | BYTE | (Need to figure out which byte is signed) |
0x05 | DateTime | QWORD | System.DateTime FromBinary() and ToBinary() format |
0x08 | Short | WORD | |
0x09 | Int | DWORD | |
0x0A | Long | QWORD | |
0x0B | Byte | BYTE | Need to determine which byte is SBYTE... This byte form is far more common |
0x0C | Float | FLOAT | Single precision floating point number |
0x0D | Ushort | WORD | Unsigned |
0x0E | Uint | DWORD | Unsigned |
0x0F | Ulong | QWORD | Unsigned |
0x10 | Struct | DWORD type
Various data |
Type references a defined structure, with the fields for that object immediately following
Usually appears as the type of an instance, but it can appear in the middle of formatted data to represent a non-system defined value type (IE a struct) |
0x10 | Object reference | DWORD type
Count * DWORD instance reference |
When in the context of an array (Type 0x11) |
0x11 | Array | DWORD Length
BYTE Primitive type Length * format appropriate for data type Data type 0x10 is treated as an object reference rather than the direct formatted data |
Referenced by most single member collection classes as well (List, ArrayList, Queue, Stack, etc) |
0x16 | Binary data | BYTE length
BYTE * length data |
Length may be encoded as variable 7 bit variable length numerical value
Not sure what IL type this corresponds with |
0x17 | Enum | BYTE+ Type of enum
(BYTES) optional additional as needed for the size of the type ID BYTE Numerical primitive type (3, 8, 9, 10, etc) BYTE/WORD/DWORD/QWORD Enum value |
The length is encoded as 7 bits, with the high bit indicating the value continues to further bytes. The value is in MSB order (Opposite normal byte order) |
0x19 | TGI index | DWORD | Index into the TGI table |
0x1A | Variable length encoded byte | BYTE+
(BYTE)s as needed for the size of the number |
Same format used for Enum definition
For example, 0x82 0x0A would encode the value 266. Not sure what IL type this corresponds to. |