Wolfenstein II The New Colossus (.resources .texdb)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Sajjad_Rahim
Posts: 64
Joined: Sat Jan 10, 2015 10:03 am

Wolfenstein II The New Colossus (.resources .texdb)

Post by Sajjad_Rahim »

Hi, here some samples from game
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

Can you provide bigger samples?
At least 10Mb and only the first cut (the one with "_0_")
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

http://aluigi.org/bms/wolfenstein2.bms

"resources" without filenames because I have not found the way how they are assigned
"texdb" very slow sorting of the big array necessary to extract the files and unknown content, all the files seem to start with 0xcc and their content is probably obsucated or I don't know.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

Script 0.2, supporting PACK that are exactly like resources (IDCL) and with possible support for filenames
Sajjad_Rahim
Posts: 64
Joined: Sat Jan 10, 2015 10:03 am

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by Sajjad_Rahim »

aluigi wrote:Script 0.2, supporting PACK that are exactly like resources (IDCL) and with possible support for filenames

Image

filenames okay, but there is problem with compress as you see.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

Can you upload the first 50 megabytes of the file?
20 are enough but it's better to be sure :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

oodle compression :)
script 0.2.1
Sajjad_Rahim
Posts: 64
Joined: Sat Jan 10, 2015 10:03 am

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by Sajjad_Rahim »

aluigi wrote:oodle compression :)
script 0.2.1

Well after extract 550 mb :shock:

Image

And i think the filenames not correct

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

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

Regarding the compression problem I can't know what algorithm is assigned to FLAG 4 because I don't have the sample but you can create one for me with this script:
log "sample.dat" 0x1624e000 0xc0f612
Upload sample.dat and I will check it.

Instead the filenames are a real problem and currently I have no solution for them.
Suggestions are welcome.
toxic72
Posts: 26
Joined: Sun Mar 20, 2016 10:25 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by toxic72 »

aluigi wrote:Regarding the compression problem I can't know what algorithm is assigned to FLAG 4 because I don't have the sample but you can create one for me with this script:
log "sample.dat" 0x1624e000 0xc0f612
Upload sample.dat and I will check it.

Instead the filenames are a real problem and currently I have no solution for them.
Suggestions are welcome.


Aight, so here's the names, but do me a favor and figure out the rest of the compression formats, way too lazy to do it myself:

Jump to (DUMMY7_OFF) and skip over 4 * DUMMY_NUM (The second, after FILES long)
Then, read:

struct DebugInfo
{
uint64_t TypeIndex;
uint64_t NameIndex;
};

* FILES count, one per entry.

Jeez these scripts are annoying af to read. Hit me up when you have the rest of the compression types.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

Well done, it works.
I will figure out the compression once I will receive the sample.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

Uhmmm apparently the TYPE/NAME index is not so clear.
The last files have TYPE "generated/swf/enigmamachine.bswf" and NAME "file" while some image files have a TYPE with tga or png extension.
Maybe do we have to swap TypeIndex and NameIndex?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

There is something wrong for sure. This is the point in which things get screwed, check "renderParm", the filename has been built with "TYPE/NAME":

Code: Select all

...
  010fe480 14         useglobalindexing/renderParm
  010ff000 132366     env/default_hdr_prefiltered.bimage/image
  0111b680 46         renderParm/maps/refmaps/rendering/probe_default/lightprobe
s/probe_default_row.bimage
  0111b6c0 17         renderParm/userenvmap
...
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

In detail:

Code: Select all

. 0000000000d0d708 get     TypeIndex  0x0000000000000000 8
. 0000000000d0d710 get     NameIndex  0x00000000000005af 8
. 00000000 getarr  STR1       "renderParm" 0:0
. 00000000 getarr  STR2       "useglobalindexing" 0:1455
. 00000000 putarr  NAME       "renderParm/useglobalindexing" 1:1453
.
. 00000000000005ae
. 0000000000d0d718 get     TypeIndex  0x0000000000000049 8
. 0000000000d0d720 get     NameIndex  0x00000000000005b0 8
. 00000000 getarr  STR1       "image" 0:73
. 00000000 getarr  STR2       "env/default_hdr_prefiltered.bimage" 0:1456
. 00000000 putarr  NAME       "image/env/default_hdr_prefiltered.bimage" 1:1454
.
. 00000000000005af
. 0000000000d0d728 get     TypeIndex  0x00000000000005b1 8
. 0000000000d0d730 get     NameIndex  0x0000000000000000 8
. 00000000 getarr  STR1       "maps/refmaps/rendering/probe_default/lightprobes/probe_default_row.bimage" 0:1457
. 00000000 getarr  STR2       "renderParm" 0:0
. 00000000 putarr  NAME       "maps/refmaps/rendering/probe_default/lightprobes/probe_default_row.bimage/renderParm" 1:1455
.
. 00000000000005b0
. 0000000000d0d738 get     TypeIndex  0x00000000000005b2 8
. 0000000000d0d740 get     NameIndex  0x0000000000000000 8
. 00000000 getarr  STR1       "userenvmap" 0:1458
. 00000000 getarr  STR2       "renderParm" 0:0
. 00000000 putarr  NAME       "userenvmap/renderParm" 1:1456

till index 1 everything is ok
index 2 is ok but now there is a new TypeIndex
index 3 is switched
index 4 is siwtched and so on

The problem is quite clear with a hex editor at around offset 0xd0d700
toxic72
Posts: 26
Joined: Sun Mar 20, 2016 10:25 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by toxic72 »

aluigi wrote:In detail:

Code: Select all

. 0000000000d0d708 get     TypeIndex  0x0000000000000000 8
. 0000000000d0d710 get     NameIndex  0x00000000000005af 8
. 00000000 getarr  STR1       "renderParm" 0:0
. 00000000 getarr  STR2       "useglobalindexing" 0:1455
. 00000000 putarr  NAME       "renderParm/useglobalindexing" 1:1453
.
. 00000000000005ae
. 0000000000d0d718 get     TypeIndex  0x0000000000000049 8
. 0000000000d0d720 get     NameIndex  0x00000000000005b0 8
. 00000000 getarr  STR1       "image" 0:73
. 00000000 getarr  STR2       "env/default_hdr_prefiltered.bimage" 0:1456
. 00000000 putarr  NAME       "image/env/default_hdr_prefiltered.bimage" 1:1454
.
. 00000000000005af
. 0000000000d0d728 get     TypeIndex  0x00000000000005b1 8
. 0000000000d0d730 get     NameIndex  0x0000000000000000 8
. 00000000 getarr  STR1       "maps/refmaps/rendering/probe_default/lightprobes/probe_default_row.bimage" 0:1457
. 00000000 getarr  STR2       "renderParm" 0:0
. 00000000 putarr  NAME       "maps/refmaps/rendering/probe_default/lightprobes/probe_default_row.bimage/renderParm" 1:1455
.
. 00000000000005b0
. 0000000000d0d738 get     TypeIndex  0x00000000000005b2 8
. 0000000000d0d740 get     NameIndex  0x0000000000000000 8
. 00000000 getarr  STR1       "userenvmap" 0:1458
. 00000000 getarr  STR2       "renderParm" 0:0
. 00000000 putarr  NAME       "userenvmap/renderParm" 1:1456

till index 1 everything is ok
index 2 is ok but now there is a new TypeIndex
index 3 is switched
index 4 is siwtched and so on

The problem is quite clear with a hex editor at around offset 0xd0d700


What file are you looking at
Sajjad_Rahim
Posts: 64
Joined: Sat Jan 10, 2015 10:03 am

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by Sajjad_Rahim »

aluigi wrote:Regarding the compression problem I can't know what algorithm is assigned to FLAG 4 because I don't have the sample but you can create one for me with this script:
log "sample.dat" 0x1624e000 0xc0f612
Upload sample.dat and I will check it.

Instead the filenames are a real problem and currently I have no solution for them.
Suggestions are welcome.


here sample as you want
https://mega.nz/#!7BshGbLZ!BMJizoLqDt4R ... TpQSthJxnw
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by aluigi »

@toxic72
The last gameresources.resources_0_697647708 sample provided by Sajjad_Rahim some posts above
toxic72
Posts: 26
Joined: Sun Mar 20, 2016 10:25 pm

Re: Wolfenstein II The New Colossus (.resources .texdb)

Post by toxic72 »

Interesting, chunk_1 works perfectly, there must be something in those initial integers.. Also, texdb entries are oodle, only issue is getting expected unpack size.