Bundle (original): Difference between revisions
Content added Content deleted
(Add per-platform info and base resource info. Remove overview as the information is redundant with the main Bundle page.) |
(Updated with new information.) |
||
Line 13:
= Structures =
=== CgsResource::Bundle ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 ||
|-
| 0x4 || 0x4 || uint32_t || muVersion || Bundle version || 3 in base, 4 in V4, 5 in V5
|-
| 0x8 || 0x4 || uint32_t ||
|-
| 0xC || 0x30 || [[#rw::
|-
| 0x3C || 0x18 ||
|-
| 0x54 || 0x4 || uint32_t || mHashTableOffset || Resource IDs offset ||
|-
| 0x58 || 0x4 || uint32_t ||
|-
| 0x5C || 0x4 || uint32_t || mImportTablesOffset || Imports offset || See [[#CgsResource::Bundle::ImportTable|ImportTable]]
|-
| 0x60 || 0x4 || uint32_t ||
|-
| 0x64 || 0x4 || uint32_t || muPlatform || Platform the bundle was built for || See [[#Platform|Platform]]
Line 46 ⟶ 43:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 ||
|-
| 0x4 || 0x4 || uint32_t || muVersion || Bundle version || 3 in base, 4 in V4, 5 in V5
|-
| 0x8 || 0x4 || uint32_t ||
|-
| 0xC || 0x28 || [[#rw::
|-
| 0x34 || 0x14 ||
|-
| 0x48 || 0x4 || uint32_t || mHashTableOffset || Resource IDs offset ||
|-
| 0x4C || 0x4 || uint32_t ||
|-
| 0x50 || 0x4 || uint32_t || mImportTablesOffset || Imports offset || See [[#CgsResource::Bundle::ImportTable|ImportTable]]
|-
| 0x54 || 0x4 || uint32_t ||
|-
| 0x58 || 0x4 || uint32_t || muPlatform || Platform the bundle was built for || See [[#Platform|Platform]]
Line 71 ⟶ 68:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 ||
|-
| 0x4 || 0x4 || uint32_t || muVersion || Bundle version || 3 in base, 4 in V4, 5 in V5
|-
| 0x8 || 0x4 || uint32_t ||
|-
| 0xC || 0x20 || [[#rw::
|-
| 0x2C || 0x10 ||
|-
| 0x3C || 0x4 || uint32_t || mHashTableOffset || Resource IDs offset ||
|-
| 0x40 || 0x4 || uint32_t ||
|-
| 0x44 || 0x4 || uint32_t || mImportTablesOffset || Imports offset || See [[#CgsResource::Bundle::ImportTable|ImportTable]]
|-
| 0x48 || 0x4 || uint32_t ||
|-
| 0x4C || 0x4 || uint32_t || muPlatform || Platform the bundle was built for || See [[#Platform|Platform]]
|}
=== CgsResource::BundleV4ExtendedData ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x68 || CgsResource::BaseBundleExtendedData || Base class || || See [[#CgsResource::Bundle|Bundle]]
|-
|
|-
|
|-
| 0x70 || 0x4 || [[#rw::ResourceDescriptor|ResourceDescriptor]]* || mpUncompressedResourceDescriptors || Compression information offset ||
|}
==== Xbox 360 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x5C || CgsResource::BaseBundleExtendedData || Base class || || See [[#CgsResource::Bundle|Bundle]]
|-
| 0x5C || 0x4 || uint32_t || muFlags || Bundle flags || See [[#CgsResource::EFlags|Flags]]
|-
| 0x60 || 0x4 || uint32_t || muUncompressedDescriptorCount || Number of compressed resources ||
|-
| 0x64 || 0x4 || [[#rw::ResourceDescriptor|ResourceDescriptor]]* || mpUncompressedResourceDescriptors || Compression information offset ||
|}
==== PC ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x50 || CgsResource::BaseBundleExtendedData || Base class || || See [[#CgsResource::Bundle|Bundle]]
|-
| 0x50 || 0x4 || uint32_t || muFlags || Bundle flags || See [[#CgsResource::EFlags|Flags]]
|-
| 0x5C || 0x4 || uint32_t || muUncompressedDescriptorCount || Number of compressed resources ||
|-
| 0x60 || 0x4 || [[#rw::ResourceDescriptor|ResourceDescriptor]]* || mpUncompressedResourceDescriptors || Compression information offset ||
|}
=== CgsResource::BundleV5ExtendedData ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x74 || [[#CgsResource::BundleV4ExtendedData|BundleV4ExtendedData]] || || Base class ||
|-
| 0x74 || 0x4 || int32_t || miMainMemAlignment || ||
|-
|
|}
Line 114 ⟶ 145:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 ||
|-
|
|-
|
|}
==== PC ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x5C || [[#CgsResource::BundleV4ExtendedData|BundleV4ExtendedData]] || || Base class ||
|-
| 0x5C || 0x4 || int32_t || miMainMemAlignment || ||
|-
| 0x60 || 0x4 || int32_t || miGraphicsMemAlignment || ||
|}
=== CgsResource::Bundle::ResourceEntry ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || void* || mpResource || Resource data memory address ||
|-
| 0x4 || 0x4 || [[#CgsResource::Bundle::ImportTable|ImportTable]]* || mpImportTable || Bundle imports offset ||
|-
| 0x8 || 0x4 || CgsResource::Type* || mpType || Resource type || Type ID replaced by pointer at runtime. See [[Resource Types]]
|-
| 0xC || 0x30 || [[#rw::ResourceDescriptor|ResourceDescriptor]][6] || mSerialisedResourceDescriptor || Resource sizes in bundle<br />Compressed size if compression used ||
|-
| 0x3C || 0x30 || [[#rw::ResourceDescriptor|ResourceDescriptor]][6] || mSerialisedOffsetResourceDescriptor || Offsets in bundle || Alignment is unused (always 1)
|-
| 0x6C || 0x18 || [[#rw::Resource|Resource]][6] || mSerialisedResource || Memory addresses || Swapped endian
|}
==== Xbox 360 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 || void* || mpResource || Resource data memory address ||
|-
| 0x4 || 0x4 || [[#CgsResource::Bundle::ImportTable|ImportTable]]* || mpImportTable || Bundle imports offset ||
|-
| 0x8 || 0x4 || CgsResource::Type* || mpType || Resource type || Type ID replaced by pointer at runtime. See [[Resource Types]]
|-
| 0xC || 0x28 || [[#rw::
|-
| 0x34 || 0x28 || [[#rw::
|-
| 0x5C || 0x14 ||
|}
Line 131 ⟶ 202:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x4 ||
|-
| 0x4 || 0x4 ||
|-
| 0x8 || 0x4 ||
|-
| 0xC || 0x20 || [[#rw::
|-
| 0x2C || 0x20 || [[#rw::
|-
| 0x4C || 0x10 ||
|}
=== CgsResource::Bundle::ImportTable ===
This structure is followed by an [[#CgsResource::Bundle::ImportEntry|ImportEntry]] array.
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 ||
|-
| 0x8 || 0x4 || uint32_t ||
|}
=== CgsResource::Bundle::ImportEntry ===
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x8 || [[Resource ID|ID]] || mImportID || Resource name CRC32 ||
|-
| 0x8 || 0x4 || RwUInt32 || muOffset || ||
|-
| 0xC || 0x4 || || ||
|}
=== rw::ResourceDescriptor ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x30 || [[#rw::BaseResourceDescriptors|BaseResourceDescriptors]] || || Base class ||
|}
==== Xbox 360 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x28 || [[#rw::BaseResourceDescriptors|BaseResourceDescriptors]] || || Base class ||
|}
==== PC ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x20 || [[#rw::BaseResourceDescriptors|BaseResourceDescriptors]] || || Base class ||
|}
=== rw::BaseResourceDescriptors ===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x30 || [[#rw::BaseResourceDescriptor|BaseResourceDescriptor]][6] || m_baseResourceDescriptors || ||
|}
==== Xbox 360 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x28 || [[#rw::BaseResourceDescriptor|BaseResourceDescriptor]][5] || m_baseResourceDescriptors || ||
|}
==== PC ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 || 0x20 || [[#rw::BaseResourceDescriptor|BaseResourceDescriptor]][4] || m_baseResourceDescriptors || ||
|}
Line 168 ⟶ 291:
|}
===
====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
|
|}
==== Xbox 360 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
|
|}
==== PC ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
|
|}
===
==== PlayStation 3 ====
{| class="wikitable"
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 ||
|}
Line 192 ⟶ 325:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 ||
|}
Line 199 ⟶ 332:
! Offset !! Length !! Type !! Name !! Description !! Comments
|-
| 0x0 ||
|}
= Typedefs =
===
{| class="wikitable"
!
|-
| BaseResource || void* || 0x4 ||
|}
= Enumerations =
=== Platform ===
Three constants used by the platform field.
{| class="wikitable"
! Name !! Value !! Comments
|-
|
|-
|
|-
|
|}
===
{| class="wikitable"
! Name !! Value !! Comments
|-
| E_BUNDLEFLAG_HAS_DEBUG_DATA || 0x0 || Has a BundleImports resource.<br>This flag does not work correctly.
|-
| E_BUNDLEFLAG_COMPRESSED || 0x1 || Resources are zlib compressed
|}
= Base resource types =
Anonymous enumeration with name strings.
==== PlayStation 3 ====
{| class="wikitable"
! Name !! String !! Index
|-
| BASERESOURCE_MAINMEMORY || main memory || 0
|-
| BASERESOURCE_DISPOSABLE || disposable || 1
|-
| BASERESOURCE_UNINITIALIZED || uninitialized || 2
|-
| BASERESOURCE_DISPOSABLE_UNINITIALIZED || disposable uninitialized || 3
|-
| BASERESOURCE_GRAPHICS_SYSTEM || graphics system || 4
|-
| BASERESOURCE_GRAPHICS_LOCAL || graphics local || 5
|-
| BASERESOURCE_NUMBEROFBASERESOURCETYPES || || 6
|}
==== Xbox 360 ====
{| class="wikitable"
! Name !! String !! Index
|-
| BASERESOURCE_MAINMEMORY || main memory || 0
|-
| BASERESOURCE_DISPOSABLE || disposable || 1
|-
| BASERESOURCE_PHYSICAL? || physical || 2
|-
| BASERESOURCE_UNINITIALIZED || uninitialized || 3
|-
| BASERESOURCE_DISPOSABLE_UNINITIALIZED || disposable uninitialized || 4
|-
| BASERESOURCE_NUMBEROFBASERESOURCETYPES || || 5
|}
==== PC ====
{| class="wikitable"
! Name !! String !! Index
|-
| BASERESOURCE_MAINMEMORY || main memory || 0
|-
| BASERESOURCE_DISPOSABLE || disposable || 1
|-
| BASERESOURCE_UNINITIALIZED || uninitialized || 2
|-
| BASERESOURCE_DISPOSABLE_UNINITIALIZED || disposable uninitialized ||
|-
| BASERESOURCE_NUMBEROFBASERESOURCETYPES || || 4
|}
|