Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.
Zero Tolerance for Disrespect

Apex Legends .MSTR

Featured Replies

  • Replies 127
  • Views 146
  • Created
  • Last Reply

Top Posters In This Topic

  • Author
  • Localization

Durandal217, posted Thu Feb 07, 2019 7:44 am (43235)


Two years ago Titanfall 2 released with an amazing sound designed that I fell in love with, however Respawn switched from using the built in source engine audio codecs using uncompressed headerless .wavs to using the Miles Sound System with the extension .mstr. It was very difficult to get anyone to look into it and very little progress was made. A few days ago Apex Legends drop with awesome music and a incredible sound design to boot. However the same system is used yet again...

What is known is the following: The files are compressed, and variable size. Considering the frame sizes, they did not appear to be mp3 or ogg. According to what was observed with the codec, it looks to use some form of bink audio. Because using 8-bit quantizers It can easily be seen in the stream.

That is where everything ends...

This is what the offset begins with:
Code:
52 54 53 43 02 00 FF FF 70 07 4A 05 00 00 00 00

or
Code:
RTSC..yyp.J.....


Attached is a sample file if anything else is needed please let me know. I'd love to get the sounds, plus the drop music for this incredible game. If anyone can discover, or come up with a way to extract this, it would be a breakthrough.
  • Author
  • Localization

Luriam, posted Sat Feb 09, 2019 4:53 pm (43324)


Created an account just to bump this thread
  • Author
  • Localization

happyend, posted Sun Feb 10, 2019 5:09 am (43337)


All of the large files indexed in .mstr have a similar header and start with "1FCB"
starting with 1FCB are actually Bink Audio (.binka) files
  • Author
  • Localization

Durandal217, posted Mon Feb 11, 2019 1:32 am (43357)


happyend wrote:
All of the large files indexed in .mstr have a similar header and start with "1FCB"
starting with 1FCB are actually Bink Audio (.binka) files


OK! I was able to extract a piece of audio looking for the headers and was able to convert and play successfully, the question now is, is there an automated script I can use to separate and convert all of the audio?
  • Author
  • Localization

Luriam, posted Mon Feb 11, 2019 2:15 pm (43374)


Wow! That's fantastic news :o Please keep it up, maybe this breakthrough will help us get Titanfall 2's audio files as well
  • Author
  • Localization

Durandal217, posted Mon Feb 11, 2019 8:14 pm (43384)


Upon further research I might have hit a brick wall. so .binka looks easy enough to extract, however previous extractors would use binkawin.asi and mss32.dll to aid in extract the files. These are not present in apex legends instead what we have is bink2w64, mileswin64, binkawin64 DLL's all of which common sense looks like they changed from 32 bit to 64 bit.

I'e attached a dll if anyone can have a look and see if the original decode function from mss32.dll is still present and if so how to get it to convert to wav.

As of right now the only possible way to extract any audio is to go line by line in a hex editor looking for the 1FCB header and copying that and saving it as a new file, it would be extremely painful to do it this way.

binkamatic.zip

  • Author
  • Localization

Durandal217, posted Wed Feb 13, 2019 2:52 am (43425)


So.. Here's where I'm at, I used this:
Image
to help me separate the audio, and using BinkA2Wav to convert, however the problem i'm running into is the audio keeps cutting off, I cannot figure out what i'm doing wrong or why it keeps doing that and I've run out of solutions...

Does anybody have any idea what can be done to remedy the cut off or extract this stuff with proper file names?
  • Author
  • Localization

Luriam, posted Wed Feb 13, 2019 3:54 am (43426)


Image link seems to be broken, so I can't see what you did. Also could you please upload one of the .wavs, any .wav. I want to check something. Thank you!
  • Author
  • Localization

Durandal217, posted Wed Feb 13, 2019 5:35 am (43429)


I've attached the image in question, as well as a sample wave and the file before it was converted.
  • Author
  • Localization

xyx0826, posted Sat Feb 16, 2019 10:39 pm (43570)


I put together a C# script for slicing/listing Binka files in a MSTR bank: https://gist.github.com/xyx0826/3186510 ... fe8ba7eb4f
It's crude but it works.

I've got 16589 file entries in Titanfall 2's main stream bank. Average length of the files is 5047 bytes, which is pretty small.
Some of the extracted files are broken after conversion with BinkA2Wav, those playable sound like truncated audio fragments.
  • Author
  • Localization

Durandal217, posted Mon Feb 18, 2019 7:02 am (43606)


xyx0826 wrote:
I put together a C# script for slicing/listing Binka files in a MSTR bank: https://gist.github.com/xyx0826/3186510 ... fe8ba7eb4f
It's crude but it works.

I've got 16589 file entries in Titanfall 2's main stream bank. Average length of the files is 5047 bytes, which is pretty small.
Some of the extracted files are broken after conversion with BinkA2Wav, those playable sound like truncated audio fragments.


first and foremost excellent work! amazing job. I tried your first version I'm still going through converting but I managed to get around 20,000 files, I saw you updated it today I will go back and try it out.

The question now is why is the audio truncated fragments? Could it be the archive? Or is this the way the audio was placed....
  • Author
  • Localization

xyx0826, posted Mon Feb 18, 2019 4:42 pm (43624)


Durandal217 wrote:
xyx0826 wrote:
I put together a C# script for slicing/listing Binka files in a MSTR bank: https://gist.github.com/xyx0826/3186510 ... fe8ba7eb4f
It's crude but it works.

I've got 16589 file entries in Titanfall 2's main stream bank. Average length of the files is 5047 bytes, which is pretty small.
Some of the extracted files are broken after conversion with BinkA2Wav, those playable sound like truncated audio fragments.


first and foremost excellent work! amazing job. I tried your first version I'm still going through converting but I managed to get around 20,000 files, I saw you updated it today I will go back and try it out.

The question now is why is the audio truncated fragments? Could it be the archive? Or is this the way the audio was placed....


I tested the script on smaller stream banks (patch banks). It seems like data chunks with a BinkA header only occupy a small portion of the file - The rest of the file does not contain any header. Either it is stored with a special format or it is literally a big chunk of audio.

The script struggles with big files. I'll refactor it when I have time.

Edit: the unknown data chunk can also be some sort of "descriptor" data - e.g. file size/checksum, track mixing instructions etc.
  • Author
  • Localization

xyx0826, posted Mon Feb 18, 2019 7:40 pm (43974)


The script is now rewritten to use buffered FileStream. There's a huge performance boost, and bugs are squished.

Still, all sound files extracted are fragments. I tried extracting voice banks; the fragments all sound like beginning of voice lines.

The last slice of the bank is very suspicious; it's very big, though I'm pretty sure it's not a big audio file. There is definitely other data in it.
  • Author
  • Localization

Durandal217, posted Tue Feb 19, 2019 3:22 am (45007)


xyx0826 wrote:
The script is now rewritten to use buffered FileStream. There's a huge performance boost, and bugs are squished.

Still, all sound files extracted are fragments. I tried extracting voice banks; the fragments all sound like beginning of voice lines.

The last slice of the bank is very suspicious; it's very big, though I'm pretty sure it's not a big audio file. There is definitely other data in it.


Thanks for this i'm using the updated version right now. This makes me wonder now.. The original titanfall utilized multi-channel (6 channels surround sound) uncompressed audio. I wonder if the audio for titanfall 2 and apex legends is using multi-channel audio. Which is the only other way to explain the fragmented audio.

Is there any possibility of decompressing the .mstr archive, to read the data perhaps even find out what audio goes where, (file names, etc.) How difficult does that look?
  • Author
  • Localization

xyx0826, posted Tue Feb 19, 2019 2:41 pm (45016)


You can find stringtables in mbnk, mbnk_digest and mprj files. Some of these looks like names to audio assets, while some others refer to audio qualities (occulusion, reverb etc.)

Another possibility is that the fragments are the "indices" of the audio files. The rest of the corresponding audio asset is buried in the big chunk of data at end of file.

How do you decompress the archive though?
  • Author
  • Localization

Luriam, posted Tue Feb 19, 2019 6:20 pm (45019)


Durandal217 wrote:
xyx0826 wrote:
The script is now rewritten to use buffered FileStream. There's a huge performance boost, and bugs are squished.

Still, all sound files extracted are fragments. I tried extracting voice banks; the fragments all sound like beginning of voice lines.

The last slice of the bank is very suspicious; it's very big, though I'm pretty sure it's not a big audio file. There is definitely other data in it.


Thanks for this i'm using the updated version right now. This makes me wonder now.. The original titanfall utilized multi-channel (6 channels surround sound) uncompressed audio. I wonder if the audio for titanfall 2 and apex legends is using multi-channel audio. Which is the only other way to explain the fragmented audio.

Is there any possibility of decompressing the .mstr archive, to read the data perhaps even find out what audio goes where, (file names, etc.) How difficult does that look?



You were right about them being multi-channel. That's exactly why I asked you to upload it for me. Because that very same file you uploaded above general_stream_00000256_converted has 6 channels:

Image
  • Author
  • Localization

xyx0826, posted Wed Feb 20, 2019 12:24 am (45028)


I found multiple blocks of twelve 0x00's in the tail blob. They seem like terminator blocks. Each null block is followed by two 0x99's, probably the beginning of a new data chunk.

Here is a tail blob sample. The beginning of the file should be a normal bink audio file.
  • Author
  • Localization

Durandal217, posted Wed Feb 20, 2019 12:38 am (45029)


xyx0826 wrote:
I found multiple blocks of twelve 0x00's in the tail blob. They seem like terminator blocks. Each null block is followed by two 0x99's, probably the beginning of a new data chunk.

Here is a tail blob sample. The beginning of the file should be a normal bink audio file.
tail blob sample


It is! When I converted it, it gave me a full voice line, Focus, Fight, Win. However the beginning sounded like there was another line playing at the beginning.

Here is the converted sample.
  • Author
  • Localization

xyx0826, posted Wed Feb 20, 2019 3:03 am (45030)


That's very cool! This file comes from a patch for Titanfall 2's voice bank. The exact voice line can be heard here at the beginning: https://www.youtube.com/watch?v=vT6zuy84RTo

Now here's where the fun begins. Remember the terminator blocks I found? I imagine the sample file to look like this:
Code:
|binka_header|some_audio_data|null_block|some_audio_data|null_block|some_audio_data|null_block|......|


I hexedited the file and removed data from after the first null block (0x298) until before the second null block (0x4eb). Remember
Code:
{ 0x99, 0x99 }
is the beginning of a new data block.

Voila, this modified file converts to five voice lines. Each one of them has a bit trimmed off at the beginning. I guess that's why we keep getting audio fragments at the front of the archive.

I've attached original and modified binka files with their converted wav's.


Edit: I'll see if this works on other stream banks. I haven't touched Apex Legends banks yet since they're quite big but I think they have the same format.
  • Author
  • Localization

Durandal217, posted Wed Feb 20, 2019 3:09 am (45031)


xyx0826 wrote:
That's very cool! This file comes from a patch for Titanfall 2's voice bank. The exact voice line can be heard here at the beginning: https://www.youtube.com/watch?v=vT6zuy84RTo

Now here's where the fun begins. Remember the terminator blocks I found? I imagine the sample file to look like this:
Code:
|binka_header|some_audio_data|null_block|some_audio_data|null_block|some_audio_data|null_block|......|


I hexedited the file and removed data from after the first null block (0x298) until before the second null block (0x4eb). Remember
Code:
{ 0x99, 0x99 }
is the beginning of a new data block.

Voila, this modified file converts to five voice lines. Each one of them has a bit trimmed off at the beginning. I guess that's why we keep getting audio fragments at the front of the archive.

I've attached original and modified binka files with their converted wav's.
11_compare.7z

Edit: I'll see if this works on other stream banks. I haven't touched Apex Legends banks yet since they're quite big but I think they have the same format.


Two questions: I tend to find these by hex values or offsets, is the offset always the same or it is a different offset every time? and is it possible your script could be modified to find and split and or get these to convert? Hope i worded that right.
  • Author
  • Localization

xyx0826, posted Wed Feb 20, 2019 3:27 am (45032)


Durandal217 wrote:
Two questions: I tend to find these by hex values or offsets, is the offset always the same or it is a different offset every time? and is it possible your script could be modified to find and split and or get these to convert? Hope i worded that right.

It didn't work quite well on other banks. I got a 27MB tail from another bank. Trimming off the first few blocks only yielded me 4 voice lines.

I can rewrite the script to slice the tail. The problem is simply slicing off each data chunk won't work.

So far I've found that the binka header is necessary for mss to recognize the file. However it would not work if I snap the header onto any individual data chunk - the conversion result is a 44-byte empty wav file.

Unless I know how the data chunks are grouped/organized I'm afraid slicing is pretty much useless.

E: for your first question - do you mean whether the data chunks have same size? No, their size apparently varies.
E2: According to this wav header struct https://www.isip.piconepress.com/projec ... 1_p05.html, 44 bytes is exactly the header length. That means it's a valid wav file but surely no audio data is inside.
E3: I'll still write a script for doing that anyway...
E4: I'm also doing a rewrite of the BinkA2Wav converter. When that's done it'll be possible to convert sound data directly in memory without having to save it to disk. i promise this is my last edit
  • Author
  • Localization

xyx0826, posted Wed Feb 20, 2019 9:57 pm (45061)


So apparently binka files start with "1FCB", in hex it is
Code:
{ 0x31, 0x46, 0x43, 0x42 }

Does anyone know if
Code:
{ 0x02, 0x01, 0x80, 0xbb }

is also part of the signature? I think every binka file have these 8 bytes at the beginning.

There also appears to be 4 long/ulong's following the 8 bytes in small endian.
  • Author
  • Localization

Durandal217, posted Thu Feb 21, 2019 5:52 am (45069)


I took some time to sit down and really read into and examine what you were talking about. I looked at your sample from titanfall 2 and reproduced your success. I then looked at a sample from apex legends, and noticed that the 0x00 are not present at all. However 0x99 is, hex editing the data to begin at that point yields a successful conversion of a single file unlike yours which will convert 5 in a single file.

Sadly I am not sure if that hex value you mentioned is a signature or not.
  • Author
  • Localization

xyx0826, posted Thu Feb 21, 2019 9:25 pm (45085)


Here's an idea: trim off audio blocks one by one from the beginning of file. Each time feed the remaining data into the converter and look at conversion size. If it's bigger than 44 bytes, save that to disk.

From my current understanding on the format, this "bruteforce" way may work, unless some flags in the BinkA header is messing with MSS on how it recognizes the audio chunks.

I think I've ran into a bug in Visual Studio/.NET SDK where breakpoints on MSS library functions can cause debug session to crash.

Edit: all right, downgrading .NET Framework version works
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.