kotiq / wt-tools

War Thunder resource extraction tools
29 stars 3 forks source link

blk_unpack error #5

Closed prandleman closed 2 years ago

prandleman commented 2 years ago

2.13.0.63-dev_pe-8_m82.zip This is erroring on all four output formats, it's from dev channel. It might be broken on their end becuase it doesn't even open in blkEditor-dev.exe (Datablock Editor) which usually works whenever blk_unpack does not

kotiq commented 2 years ago

This is strange. All three files with the specified name are successfully unpacked. version=2.13.0.63

$ python -m wt_tools.vromfs_unpacker aces.vromfs.bin Unpacking files  [####################################]  100%          
[OK] /home/kotiq/tmp/aces.vromfs.bin => /home/kotiq/tmp/aces.vromfs.bin_u
$ find . -type f -name "pe-8_m82.blkx"
./aces.vromfs.bin_u/gamedata/flightmodels/performance/pe-8_m82.blkx
./aces.vromfs.bin_u/gamedata/flightmodels/fm/pe-8_m82.blkx
./aces.vromfs.bin_u/gamedata/flightmodels/pe-8_m82.blkx
$ python -m wt_tools.blk_unpack_ng_mp --format strict_blk aces.vromfs.bin_u/gamedata/flightmodels/performance/pe-8_m82.blk 
[INFO] aces.vromfs.bin_u/gamedata/flightmodels/performance/pe-8_m82.blk
[INFO] Loading NameMap from /home/kotiq/tmp/aces.vromfs.bin_u/nm
$ python -m wt_tools.blk_unpack_ng_mp --format strict_blk aces.vromfs.bin_u/gamedata/flightmodels/fm/pe-8_m82.blk 
[INFO] aces.vromfs.bin_u/gamedata/flightmodels/fm/pe-8_m82.blk
[INFO] Loading NameMap from /home/kotiq/tmp/aces.vromfs.bin_u/nm
$ python -m wt_tools.blk_unpack_ng_mp --format strict_blk aces.vromfs.bin_u/gamedata/flightmodels/pe-8_m82.blk 
[INFO] aces.vromfs.bin_u/gamedata/flightmodels/pe-8_m82.blk
[INFO] Loading NameMap from /home/kotiq/tmp/aces.vromfs.bin_u/nm
$ pip list | grep -P 'wt-tools|blk'
blk                     0.1.dev66+g8c92e35
wt-tools                0.2.2.9.dev29+ge55dd41.d20211030 /media/shared/src/games/WarThunder/wt-tools/src
prandleman commented 2 years ago

I think I figured out the problem. I'm unpacking all vromfs to same folder instead of their own seperate folders, so the nm file is being overwritten. So I will have to do the blk unpacking before merging the folders together

kotiq commented 2 years ago

This happened, on the one hand, because of the evolution of the vromfs_unpacker tool, on the other hand, because of the format of blocks with a shared names table. I think the end user should receive one of the text formats at the output by default. Blocks in binary form are for developers only, with the corresponding parameters specified. Now there are incomplete binary files in the output. The full shared names table file sometimes specifies the name of the dictionary to unpack. There is no field in a block of type slim*, for example, with a digest for the name table from which it was created. If the name table is small, we may get an IndexError. For a large table from another archive, we will get a false positive result and wrong lines in the text.