xenia icon indicating copy to clipboard operation
xenia copied to clipboard

LIVE containers with external data files

Open gibbed opened this issue 5 years ago • 3 comments

Apps available on the 360 apps section's base container file is split into two files:

IE, for Twitch: 334A07D1\00007000\57E8FFEC1B9DEE15ECCE39F602FBD6E333 334A07D1\00007000\57E8FFEC1B9DEE15ECCE39F602FBD6E333.data\Data0000

This has been seen on:

  • Internet Explorer
  • Twitch
  • YouTube

BlockToOffsetSTFS(0) returns 0xD000 which is larger than the main container file.

Xenia currently cannot handle containers split into multiple files like this.

There is likely a flag in the header to indicate data is present in external files instead of the main container file.

I simply appended Data0000 to the end of the main container file and then xenia-vfs-dump was able to unpack it correctly.

gibbed avatar Nov 20 '18 00:11 gibbed

Apparently #1254 addresses this, but I'll leave this open until it's resolved in master.

gibbed avatar Nov 20 '18 01:11 gibbed

I still have a bit more testing to do, but from what I understand it works as follows:

  • The 44kb file in the root path is the header. All SVOD packages have this regardless of the number of files they are comprised of. It is 0xB000 bytes long and contains a LIVE, PIRS, or CON magic.
  • Following the header is the first set of L0 and L1 hash blocks, each of length 0x1000 (hence the 0xD000 you got, 0xB000 + 0x1000 + 0x1000). L0 contains 0xCC hashes and occurs every 0x198 blocks. L1 occurs every 0xCB L0 blocks (or 0xA1C4 L0 hashes). Hashes represent two blocks each.
  • Each data file is limited to a size of 0xA290000 (0xA1C4 * 2 * 0x800 = 0xA1C4000 + hash blocks).
  • The presence of multiple files is debited in the STFSHeader's data_file_count field. For regular STFS packages, this will always be 0 as they are single-file and up to 4gb. For single file SVOD, it is 1, and it can have a max of up to 0x38 total data files. ~~The current problem with my PR is that it isn't correctly taking the block offset value of the SVOD header into account. For containers made using Iso2God, this isn't a problem, as the offset is always zero, but for digital download games from the marketplace, they seem to have an arbitrary offset that usually underflows the current code, and I haven't yet worked out the math behind it.~~

Wildenhaus avatar Nov 20 '18 03:11 Wildenhaus

#1254 was merged over 2 years ago...

Margen67 avatar Jan 24 '22 19:01 Margen67