GeneSys Type
In a GeneSys v2 database, types are data type definitions imported by objects. These imports are used to define the structure of objects. All types can be broken down into base data types (e.g., uint32_t) which correspond to native types.
Structures
Types
Genesys::Type
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x1 | uint8_t | muGenesysVersion | GeneSys version. This should always be 2. |
See EVersion |
0x1 | 0x1 | uint8_t | meNativeType | Corresponding native data type | See ENativeType |
0x2 | 0x2 | uint16_t | muPropertyCount | Number of properties (columns) | |
0x4 | 0x4 | Type* | mpBaseType | Type being derived from | Imported. Null if this type is not derived |
0x8 | 0x4 | uint32_t | muBaseTypeVersion | Version hash of the type being derived from | Null if this type is not derived |
0xC | 0x4 | Property* | mpaProperties | Property (column) definitions | Null if no properties |
0x10 | 0x4 | uint32_t | muVersion | Version hash for this type | Unique for each type. Likely timestamp hash or similar |
0x14 | 0x4 | uint32_t | muID | Unique ID for this type | If game changer, this matches the resource ID. Otherwise, it is a CRC32 hash of the type name. See hash tool |
0x18 | 0x4 | uint32_t | muSize | Length of the data type in bytes | |
0x1C | 0x3 | uint8_t[3] | maReserved | Padding | |
0x1F | 0x1 | uint8_t | muAlignment | Alignment of this type | Alignment = 1 << (Value & 0x3F) |
0x20 | 0x4 | TypeInformation* | mpTypeInfo | Type and property names |
Genesys::TypeInformation
Information is from 2012-09-14, but is expected to match retail.
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | char* | mpName | Name of this type | Can be null (no name included) |
0x4 | 0x4 | char** | mpaPropertyNames | Names of this type's properties | Can be null (no names included) |
Properties
Genesys::Property
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x4 | Type* | mpType | This property's type | Imported |
0x4 | 0x4 | uint32_t | muTypeVersion | Version hash of this property's type | Copied from type |
0x8 | 0x4 | Property* | mpArrayCountProperty | Separate property for array element count | Null if this property is not an array |
0xC | 0x4 | uint32_t | muID | Unique ID for this property | Hash of property name. See hash tool |
0x10 | 0x4 | uint32_t | muTypeSize | Size of this type's data in bytes. If array, also size of each element. |
|
0x14 | 0x4 | uint32_t | muOffset | Location of the property relative to type start | |
0x18 | 0x2 | uint16_t | muCount | Number of elements | Only applicable if type is array. Not to be confused with mpArrayCountProperty
|
0x1A | 0x1 | uint8_t | muTypeAlignment | Alignment of this type | Alignment = 1 << (Value & 0x3F) Copied from type |
0x1B | 0x1 | ValueType | mValueType | Value type/flags |
Genesys::ValueType
This gives the game an accurate understanding of how to access a property's value(s). Every 2 bits is checked in sequence, from least to most significant, until they are 0 (E_VALUETYPE_VALUE
), which they are guaranteed to be after a maximum of 4 redirections due to the field being 8 bits wide.
The behavior when a value type is encountered is:
E_VALUETYPE_VALUE
: The value is read directly, without any redirection.E_VALUETYPE_POINTER
: The value is interpreted as a pointer and dereferenced. The new value is interpreted using the next 2 bits.E_VALUETYPE_ARRAY
: The current location is interpreted as an array's location and each of its values are interpreted using the next 2 bits. This is typically preceded by a pointer value type.E_VALUETYPE_OFFSET
: The value is added to the current address and the value at the new address is interpreted using the next 2 bits.
This results in, for example:
- 0x01 (binary
00000001
) being a pointer to a value - 0x09 (binary
00001001
) being a pointer to an array of values - 0x19 (binary
00011001
) being a pointer to an array of pointers to values
Offset | Length | Type | Name | Description | Comments |
---|---|---|---|---|---|
0x0 | 0x1 | ValueFlags | mxFlags | Value type/flags | See EValueType |
Typedefs
Genesys::ValueType::ValueFlags
Name | Type | Length | Comments |
---|---|---|---|
ValueFlags | uint8_t | 0x1 |
Enumerations
Genesys::EVersion
Name | Value | Comments |
---|---|---|
E_VERSION | 2 |
Genesys::ENativeType
Name | Value | Comments |
---|---|---|
E_NATIVETYPE_INTEGER | 0 | |
E_NATIVETYPE_UNSIGNED_INTEGER | 1 | |
E_NATIVETYPE_FLOAT | 2 | |
E_NATIVETYPE_BOOLEAN | 3 | |
E_NATIVETYPE_CHAR | 4 | |
E_NATIVETYPE_ENUMERATION | 5 | |
E_NATIVETYPE_OBJECT | 6 | |
E_NATIVETYPE_GENESYSOBJECT | 7 | |
E_NATIVETYPE_RESOURCE_HANDLE | 8 | |
E_NATIVETYPE_RESOURCE_ID | 9 | |
E_NATIVETYPE_COUNT | 10 |
Genesys::EValueType
Name | Value | Comments |
---|---|---|
E_VALUETYPE_VALUE | 0 | |
E_VALUETYPE_POINTER | 1 | |
E_VALUETYPE_ARRAY | 2 | |
E_VALUETYPE_OFFSET | 3 | |
E_VALUETYPE_COUNT | 4 |
Hash tool
Sources
All information is from the first listed source unless otherwise stated.
- Debugging symbols, 2012-09-26 "Marketing Alpha" build,
EBOOT.BIN
. - Debugging symbols, 2012-09-14 "Hawaii_MAIN_AutoTest" build,
HAWAII_PS3_INTERNAL_UNITY.SELF
.