kotiq / wt-tools

War Thunder resource extraction tools
29 stars 3 forks source link

blk_unpack doesn't seem to be working #3

Closed McAwesome123 closed 2 years ago

McAwesome123 commented 2 years ago

I'm trying to use the blk_unpack file to unpack some blk files but all I get is errors from python. Trying to use python3.7 -m blk_unpack --format=strict_blk mis.vromfs.bin_u gives the following:

mis.vromfs.bin_u\gamedata\missions\sample.mission.blk
Traceback (most recent call last):
  File "D:\Desktop\Programs\kotiq-wt-tools\src\wt_tools\blk_unpack.py", line 600, in unpack_file
    decoded_data = blk.unpack(out_type, is_sorted)
  File "D:\Desktop\Programs\kotiq-wt-tools\src\wt_tools\blk_unpack.py", line 123, in unpack
    raise NotPackedBLKError("Not packed blk file")
NotPackedBLKError: Not packed blk file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Desktop\Programs\kotiq-wt-tools\src\wt_tools\blk_unpack.py", line 633, in unpack_dir
    unpack_file(subname, out_type, is_sorted)
  File "D:\Desktop\Programs\kotiq-wt-tools\src\wt_tools\blk_unpack.py", line 609, in unpack_file
    text_data = f.read()
  File "C:\Python37\lib\encodings\cp1252.py", line 23, in decode
    return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x8f in position 95: character maps to <undefined>

If I build the executables and use blk_unpack --format=strict_blk mis.vromfs.bin_u, I instead get:

mis.vromfs.bin_u\gamedata\missions\sample.mission.blk
Traceback (most recent call last):
  File "src\wt_tools\blk_unpack.py", line 600, in unpack_file
  File "src\wt_tools\blk_unpack.py", line 123, in unpack
NotPackedBLKError: Not packed blk file

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "src\wt_tools\blk_unpack.py", line 633, in unpack_dir
  File "src\wt_tools\blk_unpack.py", line 605, in unpack_file
  File "C:\Python37\lib\site-packages\lark\lark.py", line 204, in __init__
    self.grammar = load_grammar(grammar, self.source)
  File "C:\Python37\lib\site-packages\lark\load_grammar.py", line 791, in load_grammar
    g = import_grammar(grammar_path, base_paths=base_paths)
  File "C:\Python37\lib\site-packages\lark\load_grammar.py", line 567, in import_grammar
    open(grammar_path, encoding='utf8')
FileNotFoundError: [Errno 2] No such file or directory: 'common.lark'

There are more errors than this, but I doubt having basically the same thing repeated a few thousand times would be particularly useful.

Is there something that I'm missing or?

prandleman commented 2 years ago

@McAwesome123 last time I looked there were 3 blk_unpack scripts (maybe executables; not sure I use source). When it was failing for me I simply tried the next one. i think its: old format, new format, new format with multiprocessing?

McAwesome123 commented 2 years ago

Oh for the love of god. Given that in the readme it literally says "The following files are used for the current version: blk_unpack_ng and blk_unpack_ng_mp.", I feel really dumb.

Thanks.