The Witcher 3 Wild Hunt(*.cache*.bundle)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Savage
Posts: 176
Joined: Thu Oct 02, 2014 4:58 pm

Re: The Witcher 3 Wild Hunt(*.cache*.bundle)

Post by Savage »

Hi! im trying to extract the xbm files from the textures.cache,the script works in some way i only get files like 00000.dat 0000002.dat, at the end of the .cache we have the filenames

haracters\models\monsters\endriaga\model\h_04__endriaga_a01.xbm characters\models\monsters\endriaga\model\h_04__endriaga_d01.xbm characters\models\monsters\endriaga\model\h_04__endriaga_n01.xbm characters\models\monsters\endriaga\model\h_04__endriaga_s01.xbm characters\models\monsters\endriaga\model\t_02__endriaga_spiral_a01.xbm characters\models\monsters\endriaga\model\t_02__endriaga_spiral_d01.xbm characters\models\monsters\endriaga\model\t_02__endriaga_spiral_n01.xbm characters\models\monsters\endriaga\model\t_02__endriaga_spiral_s01.xbm characters\models\secondary_npc\auberon\model\body_01_ma__auberon_a01.xbm characters\models\secondary_npc\auberon\model\body_01_ma__auberon_d01.xbm characters\models\secondary_npc\auberon\model\body_01_ma__auberon_n01.xbm characters\models\secondary_npc\auberon\model\body_01_ma__auberon_s01.xbm environment\architecture\elven\common\elven_bridge\textures\elven_bridge_a.xbm environment\architecture\elven\common\elven_bridge\textures\elven_bridge_a_n.xbm environment\architecture\elven\common\elven_bridge\textures\elven_b


I already tried this lua script (wich works -after some compilatons in Linux-, but no idea how to import the files)
https://github.com/hhrhhr/Lua-utils-for-Witcher-3 , maybe it gives some idea.

I uploaded a 81.18mb's file (textures.cache) to see if it's possible to extract the full xbm files with the folders/path
http://www27.zippyshare.com/v/qin8AnGx/file.html

And a extracted texture using the lua script (268kb's) from the example uploaded above using the lua script
http://www27.zippyshare.com/v/8XtM7Z3e/file.html

I remember we had two scripts for the Witcher 2

w2_dds2xbm.bms
open FDDE BIN 0
open FDDE DDS 1
get h_size long #size of header
append
log memory_file 4 h_size #write header
append
goto h_size
get tmp long #skip
savepos offset
get mips long #mipmaps
get tmp1 long #width
get tmp2 long #height
get tmp3 long #maxsize
get mip_size long #size of mipmap 1
set dds_offset long 0x80
#print "%offset% %dds_offset% 0 - %tmp1% %tmp2% %tmp3% %mip_size%"
append
log memory_file offset 20 #write header of mipmap 1
log memory_file dds_offset mip_size 1
append
for i = 1 < mips
math dds_offset += mip_size
savepos offset
get tmp1 long #width
get tmp2 long #height
get tmp3 long #maxsize
get mip_size long #size of mipmap %i%
#print "%offset% %dds_offset% %i% - %tmp1% %tmp2% %tmp3% %mip_size%"
append
log memory_file offset 16 #write header of mipmap %i%
log memory_file dds_offset mip_size 1
append
next i
append
set memory_file2 binary "\x00\x00\x00\x00\x00"
log memory_file 0 5 memory_file2 #write 00000
append
get size asize memory_file
get name BASENAME
string name += .xbm
log name 0 size memory_file


and
w2_xbm2dds.bms
set MEMORY_FILE binary "\x44\x44\x53\x20\x7C\x00\x00\x00\x07\x10\x0A\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x20\x00\x00\x00\x05\x00\x00\x00\x44\x58\x54\x31\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x08\x10\x40\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
set MEMORY_FILE2 binary "\x00\x00\x00\x00"
findloc c_type string "TCM_"
goto c_type
getct c_type string 0x8C
#TCM_DXTNoAlpha,TCM_Normals - DXT1
#TCM_DXTAlpha, TCM_NormalsHigh - DXT5
get name basename
if c_type == "TCM_DXTAlpha"
putvarchr MEMORY_FILE 0x57 0x35 byte #DXT5
string name + _DXT5.dds
elif c_type == "TCM_NormalsHigh"
putvarchr MEMORY_FILE 0x57 0x35 byte #DXT5
string name + _DXT5.dds
else
string name + _DXT1.dds
endif
findloc start string \x3a\x5c
goto start
get null string
getdstring null 0x06
get mips long
get width long
get height long
get MaxSize long
get size long
savepos offset
set h_size offset
math h_size -= 20
putVarChr MEMORY_FILE2 0 h_size long #size of header
append
log MEMORY_FILE2 0 offset
append
putVarChr MEMORY_FILE 0xC height long
putVarChr MEMORY_FILE 0x10 width long
append
log MEMORY_FILE offset size
append
#print "%i% - %offset%, %width%x%height%, %maxsize%, %size%"
for i = 1 < mips
math offset += size
append
log MEMORY_FILE2 offset 16
append
goto offset
get width long
get height long
get MaxSize long
get size long
#print "%i% - %offset%, %width%x%height%, %maxsize%, %size%"
savepos offset
next i
get size asize MEMORY_FILE
log name 0 size MEMORY_FILE
string name - .dds
string name + .bin
get m_size asize MEMORY_FILE2
log name 0 m_size MEMORY_FILE2


Maybe it works with textures of The Witcher 3? i have no idea..

Anyway, Thanks! :D
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: The Witcher 3 Wild Hunt(*.cache*.bundle)

Post by aluigi »

Script 0.1.3 for supporting the cache files version 2.
traderain
Posts: 12
Joined: Sat Feb 06, 2016 6:06 pm

Re: The Witcher 3 Wild Hunt(*.cache*.bundle)

Post by traderain »

Can someone please try and update this for the Witcher 3? Sadly the xbm2dds and dds2xbm does not work. I would be really gratefull if someone did this.