Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Game Ripper
Posts: 123
Joined: Sat Sep 02, 2017 12:56 pm

Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by Game Ripper »

Hi guys, I'd like to draw your attention to a rather hard nut to crack and I'll surely be very grateful if someone figures out this nasty format!

So in K&L2 IOI used the same or slightly changed archive type from their numerous older titles: many Hitman installments, Freedom fighters & Kane & Lynch 1. However this BMS doesn't work on any K&L2 samples and reports unknown codec. Actually most archives seem to use at least 2 different codecs: PCM (10-15%) & ADPCM (it's merely a guess), that's why it's not possible to open such files in an audio editor & try to treat them as a bunch of SFX / VO glued into a single long sound.
This is why any kind of a script, program or utility would be most useful if it's able to unpack individual sounds from those *.WAV banks. Of course it'd be perfect if that solution also supported file names found in respective *.WHD files but I can't be too picky here.

There's a ZIP for each level / map which also stores an SND file, I'm not sure it can be useful in unpacking those *.WAV archives but I still included a few samples of such assets.
I even attached some screenshots of contents of those ZIPs, probably some contained files might be of some use to us? For example those LOC store subtitles for all the languages then *.TEX & *.ANM, *.HVK & *.MAT seem to have suggestive extensions (textures & animations, Havok Physics Engine files & materials) but there're many files with unknown purpose, I can post them if anyone's interested.
Finally it looks like all the banks with this name mask - either F*_Main_LS_Default.WAV or L*_Main_LS_Default.WAV - hold a single PCM-encoded track, maybe close inspection of such example files + their companion WHDs / SNDs should be a nice start?
Ultimately this is a DL link for example files, not any cuts but complete versions of them.

Best regards!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by aluigi »

I have updated the Hitman script:
http://aluigi.org/bms/hitman_whd_wav.bms

The only problem is figuring out what's the codec because the script dumps the data in a ss2 container while this data is something else.
I'm also not really sure about how recognize what field tells the codec for distinguishing between Hitman on PS and this one on PC.

Anyway everything else is perfect, solve the mistery and let me know what I have to update :D
Game Ripper
Posts: 123
Joined: Sat Sep 02, 2017 12:56 pm

Re: Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by Game Ripper »

Hi, big thanks for help! Your BMS seems to work nicely on all but these 2 archives (QuickBMS reports incomplete files), I hope it's possible to edit the code a little & properly extract those files. If you're wondering - all the *.WHD\*.WAV pairs weren't somehow extracted, ripped from bigfiles, etc.; they can be found in folders of an installed game and I uploaded them as-is, it means that initial assets we're trying to unpack should be correct & complete.

I also noticed that it doesn't unpack any files with _LS_Default suffix, may you look into those (for example F09_Main_LS_Default & L09_Main_LS_Default) once more? It's obvious I can provide more examples whenever needed, there're 20 such archives there.

Have a nice day!

PS. I've just found out that L11_Main is reported as in incomplete file too, here it is - WAV & WHD.

PPS. Codec is IMA in the sounds which seem to be correctly extracted, frequency varies a bit but apparently they're all mono.

PPPS. I checked extraction of every single WAV/WHD pair and there're 3 more files which are reportedly (according to quickbms.exe log) incomplete. Just let me know if 3 above samples aren't enough.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by aluigi »

Since I don't know what's the field that tell us if it's psadpcm, imaadpcm or any other codec, I opted for dumping both the containers :D
Script 0.1.2
Game Ripper
Posts: 123
Joined: Sat Sep 02, 2017 12:56 pm

Re: Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by Game Ripper »

Hmm F08_Main now extracts without errors but I still get "incomplete file" report when extracting L02_Main or L11_Main (plus 3 different *.WHD\*.WAV pairs I haven't posted yet). Maybe the script can still be improved?
All the best!
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by aluigi »

Eh no this format is a total disaster.
Entries without filenames, filenames repeated without any sense and so on.

Example at offset 0x51f50:

Code: Select all

  00 cd cd cd cd cd cd cd 00 00 00 00 00 00 00 00   ................
  53 46 58 2f 41 6d 62 69 65 6e 63 65 73 2f 4c 61   SFX/Ambiences/La
  79 65 72 65 64 5f 46 4c 2f 4f 75 74 53 69 64 65   yered_FL/OutSide
  2f 48 69 67 68 77 61 79 5f 48 69 67 68 5f 4c 6f   /Highway_High_Lo
  6f 70 2e 77 61 76 00 00 00 00 00 00 00 00 00 00   op.wav..........
  53 46 58 2f 41 6d 62 69 65 6e 63 65 73 2f 4c 61   SFX/Ambiences/La
  79 65 72 65 64 5f 46 4c 2f 4f 75 74 53 69 64 65   yered_FL/OutSide
  2f 48 69 67 68 77 61 79 5f 4c 6f 77 5f 4c 6f 6f   /Highway_Low_Loo
  70 2e 77 61 76 00 00 00 00 00 00 00 00 00 00 00   p.wav...........
  53 46 58 2f 41 6d 62 69 65 6e 63 65 73 2f 4c 61   SFX/Ambiences/La
  79 65 72 65 64 5f 46 4c 2f 4f 75 74 53 69 64 65   yered_FL/OutSide
  2f 48 69 67 68 77 61 79 5f 4d 65 64 69 75 6d 5f   /Highway_Medium_
  4c 6f 6f 70 2e 77 61 76 00 00 00 00 00 00 00 00   Loop.wav........
  00 00 00 00 60 1f 05 00 00 10 80 83 ff 7c 00 00   ....`........|..
  10 00 00 00 00 26 49 00 73 ee 05 00 01 00 00 00   .....&I.s.......
  00 98 e5 46 00 00 00 00 00 93 24 00 00 00 00 00   ...F......$.....
  00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff 00   ................
  20 00 00 00 00 00 00 00 00 00 00 00 a0 1f 05 00    ...............
  00 10 80 01 ff 7c 00 00 10 00 00 00 00 26 49 00   .....|.......&I.
  73 ee 05 00 01 00 00 00 00 98 e5 46 00 00 00 00   s..........F....
  00 93 24 00 00 00 00 00 00 00 00 00 00 00 00 00   ..$.............
  c8 d0 d4 ff d4 d0 c8 00 00 00 00 00 00 00 00 00   ................
  00 00 00 00 e0 1f 05 00 00 10 80 02 ff 7c 00 00   .............|..
  10 00 00 00 00 26 49 00 73 ee 05 00 01 00 00 00   .....&I.s.......
  00 98 e5 46 00 00 00 00 00 93 24 00 00 00 00 00   ...F......$.....
  00 00 00 00 00 00 00 00 28 00 39 00 35 00 20 00   ........(.9.5. .
  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00   ................
  53 46 58 2f 43 75 74 53 63 65 6e 65 73 2f 4c 30   SFX/CutScenes/L0
  32 2f 4b 69 63 6b 41 62 6c 65 44 6f 6f 72 61 6d   2/KickAbleDooram


I tried to implement various workarounds and all failed or made it incompatible with other files.
Sorry, I will no longer work on this format.
Game Ripper
Posts: 123
Joined: Sat Sep 02, 2017 12:56 pm

Re: Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by Game Ripper »

Thanks all the same, you've still accomplished much and your work is truly appreciated!
Goodbye!

EDIT: Here you can find 3 remaining archives, maybe someone else will be able to figure them out and continue Luigi's work.
zeaofsuos
Posts: 104
Joined: Sun Jan 13, 2019 11:45 pm

ADMIN, DELETE.

Post by zeaofsuos »

ADMIN, DELETE.
Last edited by zeaofsuos on Wed Apr 14, 2021 5:40 pm, edited 2 times in total.
Game Ripper
Posts: 123
Joined: Sat Sep 02, 2017 12:56 pm

Re: Kane & Lynch II (2): Dog Days (PC) *.WHD+*.WAV

Post by Game Ripper »

And was is it doing here? It's not the place to mirror someone else's rips or a topic dedicated to original Kane and Lynch. Well the script might work on numerous titles including K&L1 but I'm not sure this should become a general "*.WHD+*.WAV format" thread.
Or does your archive contain example WHDs / WAVs from Kane & Lynch 1? If you had wanted to provide samples from that game you should have chosen a few small files or some cuts from the biggest ones, there's no need to upload entire audio folder or something.
Bye!