Borderlands 2 .xxx decompression (Xbox360 Version)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Echelo
Posts: 11
Joined: Fri Aug 08, 2014 4:18 pm

Borderlands 2 .xxx decompression (Xbox360 Version)

Post by Echelo »

Hi aluigi, I've been trying to unpack some XMem compressed blocks with quickbms. The first few blocks of these files do decompress, but at the 4th block, XMemDecompress is no longer working. I was wondering if you had time, if you would take a look at a few of the files for me.

The beginning of the file looks like it has a CRC, decompressed chunk size, full compressed size, and full decompressed size.
After that it looks like it has a table of the compressed chunk sizes and decompressed chunk sizes.
The compressed data starts at the end of that table at address 0x300.

This is the script that is producing the error on the 4th compressed block of the file.

Code: Select all

ImpType Standard
Log MEMORY_FILE 0 0
Append
GoTo 0

ComType XMemDecompress
CLog MEMORY_FILE 768 31290 131072
Append
Log output.uc 0 131072 MEMORY_FILE

ComType XMemDecompress
CLog MEMORY_FILE 32058 30102 131072
Append
Log output.uc 0 131072 MEMORY_FILE

ComType XMemDecompress
CLog MEMORY_FILE 62160 27104 131072
Append
Log output.uc 0 131072 MEMORY_FILE

ComType XMemDecompress
CLog MEMORY_FILE 88496 30056 131072
Append
Log output.uc 0 131072 MEMORY_FILE

aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Borderlands 2 .xxx decompression (Xbox360 Version)

Post by aluigi »

Well, for sure there is a math error because 62160 + 27104 is not 88496 :)
But even after fixing it the decompression fails.
I tried to set some parameters of XMemDecompress but still the same:

Code: Select all

ComType XMemDecompress
Append
CLog output.uc 768 31290 131072
CLog output.uc 32058 30102 131072
CLog output.uc 62160 27104 131072
CLog output.uc 89264 30056 131072   #CLog output.uc 88496 30056 131072

/*test
endian big
comtype xmemdecompress 131072
goto 0x10
math OFFSET = 0x300
for i = 0
    get ZSIZE long
    get SIZE long
    clog "" OFFSET ZSIZE SIZE
    math OFFSET + ZSIZE
next i
*/
Just curious, why don't you use the tool of Gildor? This is a game based on the Unreal engine.
Echelo
Posts: 11
Joined: Fri Aug 08, 2014 4:18 pm

Re: Borderlands 2 .xxx decompression (Xbox360 Version)

Post by Echelo »

I tried gildor's decompress.exe and extract.exe, they did not work either, just errors on the same block.

Code: Select all

decompress.exe
Loading package: WillowGame.xxx Ver: 832/46 Engine: 1712559 [FullComp] Names: 32241 Exports: 52787 Imports: 3983 Game: 8016
******** WillowGame.xxx ********
*** ERROR: lzxd_decompress(30056,131072) returned 11
appDecompressLZX <- appDecompress:CompSize=30056 UncompSize=131072 Flags=0x4 <- DecompressBlock:block=15CB0+7568 <- FUE3ArchiveReader::PrepareBuffer <- FUE3ArchiveReader::Serialize <- FString<< <- Name:11944 <- UnPackage::LoadNameTable <- UnPackage::UnPackage:WillowGame.xxx, ver=832/46, game=8016 <- UnPackage::LoadPackage:WillowGame.xxx <- Main

extract.exe
Loading package: WillowGame.xxx Ver: 832/46 Engine: 1712559 [FullComp] Names: 32241 Exports: 52787 Imports: 3983 Game: 8016
******** WillowGame.xxx ********
*** ERROR: lzxd_decompress(30056,131072) returned 11
appDecompressLZX <- appDecompress:CompSize=30056 UncompSize=131072 Flags=0x4 <- DecompressBlock:block=15CB0+7568 <- FUE3ArchiveReader::PrepareBuffer <- FUE3ArchiveReader::Serialize <- FString<< <- Name:11944 <- UnPackage::LoadNameTable <- UnPackage::UnPackage:WillowGame.xxx, ver=832/46, game=8016 <- UnPackage::LoadPackage:WillowGame.xxx <- Main
Echelo
Posts: 11
Joined: Fri Aug 08, 2014 4:18 pm

Re: Borderlands 2 .xxx decompression (Xbox360 Version)

Post by Echelo »

The file I had was corrupt thanks to the ftpd :/ It works now. :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Borderlands 2 .xxx decompression (Xbox360 Version)

Post by aluigi »

Eh it happens :)