wt-tools icon indicating copy to clipboard operation
wt-tools copied to clipboard

wrpl unpacker doesn't work with replays that have a nuclear explosion

Open Yay5379 opened this issue 2 years ago • 14 comments

If you try to unpack a replay with a nuclear explosion it will output this error: construct.core.ConstError: parsing expected b'\x00BBF' but parsed b'kill'. This only happens to me when I try to unpack a replay that has a nuclear explosion.

Yay5379 avatar Jan 09 '23 00:01 Yay5379

Hi, do you know what you can do with the .bin after extraction ? I'm trying to use the replays but the bin is unreadable.

OshidaBCF avatar Jan 14 '23 08:01 OshidaBCF

If you use zlib to decompress the bin file there should be more human readable text in the new decompressed bin file.

Yay5379 avatar Jan 16 '23 17:01 Yay5379

ohhhhhh

Elaborate, this is getting interesting

I don't really know how to "use" zlib, any help appreciated

OshidaBCF avatar Jan 16 '23 18:01 OshidaBCF

Basically I used This program to decompress the wrplu.bin. You basically change the name of the wrplu.bin to wrplu.zlib and then drag and drop it onto the program. I attached a few examples of what the file might look like after decompression. Wrplu Examples.zip

Yay5379 avatar Jan 16 '23 18:01 Yay5379

"invalid or incomplete deflate data" Both for mine or yours files

OshidaBCF avatar Jan 16 '23 18:01 OshidaBCF

My files are already decompressed. It worked for me but it could be because i used a different version of wt tools.

Yay5379 avatar Jan 16 '23 18:01 Yay5379

i see... i used the last tools i have/modified from kotiq

it can uncompress the whole replay file but not the bin one

OshidaBCF avatar Jan 16 '23 18:01 OshidaBCF

Wait no... The bin is already what i get from the tools...

ah

OshidaBCF avatar Jan 16 '23 18:01 OshidaBCF

i thought you had a tool that would make that bin even more readable

OshidaBCF avatar Jan 16 '23 18:01 OshidaBCF

Try to decompress the bin file you get after using the tools. (remember to change the .bin to .zlib) It will make some data readable but there will still be a whole bunch of unreadable text. I also used Keksilton's WT tools on the replays before I decompressed the wrplu.bin.

Yay5379 avatar Jan 16 '23 19:01 Yay5379

@Yay5379 do you have any stuctures to share that would help to parse that .bin file?

TaLajans avatar Jan 24 '23 18:01 TaLajans

I don't have any structures but I have a hexdump file that might contain some useful information such as patterns. I also think part of the file might be encrypted but I am not 100% sure. The main things that I noticed when looking at the file in a hex editor is that most sections with readable strings end with 02 58 39 D0 01 00. I also noticed that a big chink of the readable strings are just mission parameters that you would find in a mission editor blk file.

Yay5379 avatar Jan 25 '23 01:01 Yay5379

@Yay5379 Regarding an issue parsing replays in my web ui: I believe the issue is in the way mres.blk is being extracted from replay file, looks like it has 2 extra bytes in the beginning. There is also an issue with NameMap is being parsed from mres.blk, it promises 35 strings, but in reality it only has 34. At least that's what I have been able to find atm. I will try to have a look during the weekend.

Keksilton avatar Jan 25 '23 12:01 Keksilton

@Keksilton If you decompress the wrplu.bin file you get after using the wrpl unpacker with some sort of zlib decompression program there will be more readable strings in the new decompressed file with most referring to mission data that you would see in a war thunder cdk mission blk (capture zones, respawn points, etc.). I attached some examples of what the wrplu files might look like after decompression so they can be analyzed. I have no idea if this is enough information to get a rough idea on how the wrplu files are structured but I hope that this is enough for a starting point. I am not 100% sure what to look for when analyzing binary files so I can't really help with anything besides providing these decompressed files as a starting point. decompressed wrplus.zip

Yay5379 avatar Jan 29 '23 18:01 Yay5379