I want to extract the audio files from the .npk of the NetEase game.

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
1000
Posts: 4
Joined: Sat Jan 15, 2022 8:14 pm

I want to extract the audio files from the .npk of the NetEase game.

Post by 1000 »

I wasn't sure if I should post this in the existing topics, but since the main topic was about models, I decided to post it separately.

As those of you who have looked into this file-related matter know, most of the tools available here and on other sites are mainly for model extraction, and voice files cannot be extracted without an update from a knowledgeable person(voice files are in particularly small demand). :(
However, as an amateur, I was able to find the voice files and listen to bits and pieces of them by comparing them to the music files I had placed with them.

The file I found this time is from Masterwork Apocalypse.
This is the hexadecimal of the .npk before it was determined to be audio.
Image

And this hex had the same description as the other wem files.
Image
Image

After forcibly transcribing the description and changing the format, I was able to play it in foobar 2000, and I knew that the voice was in this file.
Here is the audio played back.
Image

But that was as far as an amateur could go.
I don't know how much of this is one file, or how to cut out each part.
And even a quick look at the file shows "RFF#>. .WAVEfmt" and there are some parts that need to be modified.
Is there a way to write a script to solve these problems?
Quasi-Detective
Posts: 15
Joined: Fri Jan 08, 2021 1:43 pm

Re: I want to extract the audio files from the .npk of the NetEase game.

Post by Quasi-Detective »

Seeing as no one has offered an optimal solution, I will offer a somewhat suboptimal one in the hopes of inspiring someone to make an NPK extractor to get the WEM files out in a better way, or at the very least to tide you over until someone hopefully does that.

I found a BMS script a while back that tries to pull files with RIFF headers out of massive archives like this. It might not work in this case, and if it does, whatever it extracts might not be named properly. But hopefully, it will do something for you.

https://github.com/Vextil/Wwise-Unpacker/blob/master/Tools/wavescan.bms

I believe it dumps what it finds as "*.wav", so in order for foobar to load it properly, you'll probably need to batch rename everything to "*.wem". For a task like this, I suggest something like Lupas Rename 2000, but you can use any batch renaming method you prefer.

This probably isn't a great method, but I hope it helps in the meantime.
In order to boost your odds of someone who knows how to do things like this making a better script, you may want to upload a sample NPK file to a file hosting site like MEGA and link it here for people to look at. :)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: I want to extract the audio files from the .npk of the NetEase game.

Post by aluigi »

Just a tip about the ".wav" extension, you can just edit the script replacing wav with wem at line 65 'string NAME += ".wav"' -> 'string NAME += ".wem"' without using other tools.
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: I want to extract the audio files from the .npk of the NetEase game.

Post by AlphaTwentyThree »

Quasi-Detective wrote:I found a BMS script a while back that tries to pull files with RIFF headers out of massive archives like this. It might not work in this case, and if it does, whatever it extracts might not be named properly. But hopefully, it will do something for you.

https://github.com/Vextil/Wwise-Unpacker/blob/master/Tools/wavescan.bms

I believe it dumps what it finds as "*.wav", so in order for foobar to load it properly, you'll probably need to batch rename everything to "*.wem". For a task like this, I suggest something like Lupas Rename 2000, but you can use any batch renaming method you prefer.)


Cool. nice to see my script make it's rounds. :)

Looking at the main archive, I'd say you cut at the "BKHD" identifier and use my Wwise archive script from viewtopic.php?f=17&t=7982&p=68463#p35700
If you also have the xml or txt files available, you can even parse the resulting files to their original names.
1000
Posts: 4
Joined: Sat Jan 15, 2022 8:14 pm

Re: I want to extract the audio files from the .npk of the NetEase game.

Post by 1000 »

Quasi-Detective wrote:I found a BMS script a while back that tries to pull files with RIFF headers out of massive archives like this. It might not work in this case, and if it does, whatever it extracts might not be named properly. But hopefully, it will do something for you.
https://github.com/Vextil/Wwise-Unpacker/blob/master/Tools/wavescan.bms
This probably isn't a great method, but I hope it helps in the meantime.
In order to boost your odds of someone who knows how to do things like this making a better script, you may want to upload a sample NPK file to a file hosting site like MEGA and link it here for people to look at. :)

aluigi wrote:Just a tip about the ".wav" extension, you can just edit the script replacing wav with wem at line 65 'string NAME += ".wav"' -> 'string NAME += ".wem"' without using other tools.

AlphaTwentyThree wrote:Cool. nice to see my script make it's rounds. :)


I was thinking of giving up and learning a programming language from scratch when I didn't get a reply... Thank you Three Wise Men.
I'm impressed by the amount of knowledge you guys have. :cry:

The software you presented worked perfectly, it took me a long time because I had no experience with this situation, but I think I can achieve my goal.
I hope that NetEase will keep the same specifications in the future...

Thank you very much!
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Re: I want to extract the audio files from the .npk of the NetEase game.

Post by AlphaTwentyThree »

Almost forgot - if your files contain multiple sound banks, scan with my generic splitter here. Already adjusted to bkhd for you.