Incompatiblilty with Xbox360 Skyrim Textures.bsa
selyb opened this issue · 11 comments
When I unpack Textures.bsa, the file path of each file is prepended to the binary data. I have not noticed this issue with the other archives. Interface.bsa contains .ddx files, yet these are unpacked correctly. If I unpack using BSAopt, manually remove the extra data from all files, repack using Archive.exe from the creation kit, then unpack the new archive with BSAopt, the files contain the extra data again.
It would be great if BSAopt could repack X360 archives as well :-D I would assume that the only difference is endianness.
The issue is a missing bit in the BSA-header, tools can suggest that the file-name prepends the data, and BSAopt quits them if the bit is set. You also switched the game-mode to Skyrim? Because Oblivion BSAs can not have that flag set.
I experience the same problem when game-mode set to Skyrim. Which bit are you referring to in the header? I could change it manually before I use BSAOpt to extract.
** The header version numbers (these can have prefixed names, if it's 0x67 it's invalid):
#define F3_BSAHEADER_VERSION 0x68 //!< Version number of a Fallout 3 BSA
#define SK_BSAHEADER_VERSION 0x68 //!< Version number of a Skyrim BSA
** These are the bits to specify prefixed paths/names:
#define F3_BSAARCHIVE_PREFIXFULLFILENAMES 0x0100 //!< Whether the name is prefixed to the data?
#define SK_BSAARCHIVE_PREFIXFULLFILENAMES 0x0100 //!< Whether the name is prefixed to the data?
** And this is the check for it:
/* prefixed name */
if ((version == SK_BSAHEADER_VERSION) &&
(header.ArchiveFlags & SK_BSAARCHIVE_PREFIXFULLFILENAMES)) {
** The header is like this:
unsigned int magic;
unsigned int version;
unsigned int FolderRecordOffset; //!< Offset of beginning of folder records
unsigned int ArchiveFlags; //!< Archive flags
So in your case, when the BSA has 0x01 missing at byte 14, it's an invalid BSA by definition of the what we know. The BSAs of Skyrim PC does have the flag set. Maybe it's a bug (of wrong definition) in the Bethesda archiver then.
For example "Skyrim - Textures.bsa" is like this:
42.53.41.00.68.00.00.00.24.00.00.00.07.01.00.00 ...
See the 07.01.00.00, that's 0x00000107, so 0x100 is set.
Thank you for spelling it all out for me. It looks like maybe BSAOpt does have a bug. This is the header from the Xbox Textures BSA.
42.53.41.00.68.00.00.00.24.00.00.00.43.01.00.00
8B.01.00.00.72.48.00.00.9D.2C.00.00.3D.98.05.00
02.00.00.00
Which version are you using?
BSAopt-247-1-6-2 downloaded from Nexus. I've been using the x64 version, I'll report back if the x86 is different.
Can you test the version in "Downloads" and report, thanks.
It looks fixed :)
I only extracted a few files and they look good. I'll do the entire archive and run my script on it to see if it finds any but I'm sure if one is right, the rest are as well.
Okay, so the bug was that BSAopt only stripped the path from compressed files, not from not compressed ones (blush), I guess(ed) your special "ddx" where uncompressed.
I see. Nice find :)