.XWB sample files (XBOX platform)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Savage
Posts: 176
Joined: Thu Oct 02, 2014 4:58 pm

Re: .XWB sample files (XBOX platform)

Post by Savage »

But what you really need? convert the audio to wav? use unxwb
http://aluigi.altervista.org/papers/unxwb.zip

- open file StreamingWaveBank.xwb
- the tool will try to add a header to the extracted files

length fmt freq c b filename
=====================================================================
6480 XMA 16000 1 8 00000000.wav
2988 XMA 22050 1 8 00000001.wav
452988 XMA 22050 1 8 00000002.wav
372096 XMA 22050 1 8 00000003.wav
403920 XMA 44100 2 8 00000004.wav
403200 XMA 22050 1 8 00000005.wav
9792 XMA 22050 1 8 00000006.wav
16524 XMA 22050 1 8 00000007.wav
4788 XMA 22050 1 8 00000008.wav
737230 PCM 16000 1 16 00000009.wav
642038 PCM 16000 1 16 0000000a.wav
335194 PCM 16000 1 16 0000000b.wav
674700 PCM 16000 1 16 0000000c.wav
728216 PCM 16000 1 16 0000000d.wav
802584 PCM 16000 1 16 0000000e.wav
644960 PCM 16000 1 16 0000000f.wav
349954 PCM 16000 1 16 00000010.wav
674648 PCM 16000 1 16 00000011.wav
1694232 XMA 16000 2 8 00000012.wav

- finished (19 files)


I tried some tools to convert the xma to wav but none worked

XMA_transform_2016-01-28.bms

Xma_parse 0.11
https://www.hcs64.com/files/xma_parse011.zip

Parse error: skip bits (24576) did not match previous packet overflow (0)
Last edited by Savage on Fri Jul 29, 2016 8:48 pm, edited 1 time in total.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

Dude, these "XMA" files doesn't even look like XMA at all. They didn't even exist until when Xbox 360 was released(or in development).
What's worse is that the tool itself doesn't detect the XBOX ADPCM and XWMA codecs, lest does the tool recognize them as such, so what's the point of doing all of this?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: .XWB sample files (XBOX platform)

Post by aluigi »

@Savage
Could you please put that script as attachment instead as "code"?
Savage
Posts: 176
Joined: Thu Oct 02, 2014 4:58 pm

Re: .XWB sample files (XBOX platform)

Post by Savage »

Done, attached the bms
Savage
Posts: 176
Joined: Thu Oct 02, 2014 4:58 pm

Re: .XWB sample files (XBOX platform)

Post by Savage »

AnonBaiter wrote:Dude, these "XMA" files doesn't even look like XMA at all. They didn't even exist until when Xbox 360 was released(or in development).
What's worse is that the tool itself doesn't detect the XBOX ADPCM and XWMA codecs, lest does the tool recognize them as such, so what's the point of doing all of this?

Accordig to xma_parse011 this XMA are XMA2
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

Then something's really off here.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: .XWB sample files (XBOX platform)

Post by aluigi »

To both of you: the problem is in the format of XWB <= version 3, so it's something that must be fixed in unxwb.
Now the fix is very easy (xma->adpcm) but I want to be sure at 100% that all the fields handled by unxwb are correct.
Currently it seems that it's all ok but it's difficult to understand if the frequency of small audio sounds is correct or is half or double than the original.
If for you it's ok I can just make that quick fix and then you can do all your tests with bigger and older xwb archives.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

A quick fix is fine by me! So yeah, go for it.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: .XWB sample files (XBOX platform)

Post by aluigi »

AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

Yes! Now the .xwb files as used on XBOX games works exactly as I expected with their proper codecs. If only the same could apply to those Xbox 360-era .xwb files...
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: .XWB sample files (XBOX platform)

Post by aluigi »

If only the same could apply to those Xbox 360-era .xwb files...

What you mean?
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

According to a game whose files I used to have, there was a .xwb file that used the XWMA codec.
However, I do have a .xwb file I created for myself. Do you want it?

Oh, I almost forgot: is it possible to read the names from inside the .xwb file?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: .XWB sample files (XBOX platform)

Post by aluigi »

Upload the xwb archive.

Only some archives have some sort of filenames or descriptions and they are visible with the -v option of unxwb ("description" tag where available).
99% of the archives don't store these names.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

Done.
But anyway, here's how unxwb detects .xwb files that use the XWMA codec:

Code: Select all

XWB/ZWB files unpacker 0.3.6
by Luigi Auriemma
e-mail: aluigi@autistici.org
web:    aluigi.org

- open file         E:\DXSDK_Jun10\Win\pes2006_music.xwb
- the tool will try to add a header to the extracted files
- signature         WBND
- little/intel endian values
- version           46
- segment 0         offset 0x00000034   length 96
- segment 1         offset 0x00000094   length 120
- segment 2         offset 0x0000010c   length 12372
- segment 3         offset 0x00003160   length 320
- segment 4         offset 0x00003800   length 21055488

- flags             streaming, bank+entry_names
- files             5
- bank name         pes2006_music
- entry meta size   24
- entry name size   64
- alignment         2048

  length      fmt   freq c b  filename
=====================================================================
  1822809     WMA  48000 2 8  00000000.wma
              description     movie60
  0x00003800  format          0x5717700b   flags           0x041f8000
              region offset   0x00000000   region length   0x00000000

- do you want to overwrite the file "00000000.wav"? (y/N/all): all
  4362453     WMA  48000 2 8  00000001.wma
              description     BG_MENU_01
  0x001c1000  format          0x5717700b   flags           0x09f42000
              region offset   0x00000000   region length   0x00000000

  4601398     WMA  48000 2 8  00000002.wma
              description     BG_MENU_02
  0x005ea800  format          0x5717700b   flags           0x0a7d0000
              region offset   0x00000000   region length   0x00000000

  2764935     WMA  48000 2 8  00000003.wma
              description     BG_MENU_03
  0x00a4e000  format          0x5717700b   flags           0x0651a000
              region offset   0x00000000   region length   0x00000000

  7496046     WMA  48000 2 8  00000004.wma
              description     BG_MENU_04
  0x00cf1800  format          0x5717700b   flags           0x111fa000
              region offset   0x00000000   region length   0x00000000


- finished (5 files)
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: .XWB sample files (XBOX platform)

Post by aluigi »

I see nothing wrong
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

Ehhhhhhhhh... Then why are they exported as .wav files? They even have a header like this:

Code: Select all

00000000  52 49 46 46 A9 D0 1B 00 57 41 56 45 66 6D 74 20  RIFF©Ð..WAVEfmt 
00000010  34 00 00 00 66 01 02 00 80 BB 00 00 59 D0 1B 00  4...f...€»..YÐ..
00000020  04 00 10 00 22 00 01 00 02 00 00 00 00 00 00 00  ...."...........
00000030  00 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000040  00 00 00 00 00 03 01 00 73 65 65 6B 00 00 00 00  ........seek....
00000050  64 61 74 61 59 D0 1B 00 09 00 00 03 BF 20 84 EC  dataYÐ......¿ „ì
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: .XWB sample files (XBOX platform)

Post by aluigi »

Because there is no other alternative header to use.
RIFF is better than an useless raw.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

I can't disagree with that.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: .XWB sample files (XBOX platform)

Post by AnonBaiter »

Actually, I think it's possible to build a xWMA header other than detecting a WMA codec and having its output file made as a XMA2 codec(0x165) as your tool does.

The xWMA header can be broken down to this:

Code: Select all

00000000  52 49 46 46 88 49 1D 00 58 57 4D 41 66 6D 74 20  RIFFˆI..XWMAfmt <- 0x00-0x04 RIFF SIGN, 0x05-0x08 RIFF size, 0x09-0x0c TAG, 0x0d-0x0f format
00000010  12 00 00 00 61 01 02 00 44 AC 00 00 A0 0F 00 00  ....a...D¬.. ...<- 0x10-0x13 unknown(?), 0x14-0x15 codec number, 0x16-0x17, channels, 0x18-0x1b sample rate, 0x1c-0x1f average bytes per second(?)
00000020  CD 05 10 00 00 00 64 70 64 73 24 14 00 00 00 E0  Í.....dpds$....à<- 0x20-0x21 block alignment, 0x22-0x23 bits per second, 0x24-0x25 zero, 0x26-0x29 "dpds" marker, 0x30-0x31 "dpds" chunk size, 0x32-0x144F start of actual "dpds" data
-----------------------------"dpds" chunk data-----------------------------
00001450  06 05 64 61 74 61 35 35 1D 00 09 00 00 1E FF FE  ..data55......ÿþ<- 0x1450-0x1451 unknown(?), 0x1452-0x1455 "data" sign, 0x1456-0x1459 "data" size, 0x145A-0xEOF(end of file) actual data
For instance, the .xwb archive(and assuming you still have that .xwb file I gave you, that is) which contains xWMA files references the chunk sizes of these "dpds" data each file has(although I'm afraid it might appear incorrect).

Code: Select all

00000110  30 04 00 00 30 0E 00 00 BC 18 00 00 14 1F 00 00  0...0...¼.......
00000120  0B 01 00 00                                      ....
Following that, you have the "dpds" chunks themselves.

Also by looking at the unxwb.c file, the program was intended to add a WMA header so that it could come off as .wma, but apparently it decided to assign the WMA output file as a XMA2 file and left it as is.

Code: Select all

    if(codec == WAVEBANKMINIFORMAT_TAG_WMA) {
        len = fread(buff, 1, 16, fdin);
        if(len == 16) {
            fseek(fdin, -len, SEEK_CUR);
            if(memcmp(buff, "\x30\x26\xb2\x75\x8e\x66\xcf\x11\xa6\xd9\x00\xaa\x00\x62\xce\x6c", len)) {
                codec = WAVEBANKMINIFORMAT_TAG_XMA;
                if(fname) strcpy(strrchr(fname, '.'), ".wav");
            }
        }
    }
And because you said a RIFF is better than a useless raw, then doesn't a XWMA header I just showed you count as a RIFF? After all, xWMA uses the WMAv2 codec tag(0x161) in its header so I don't see the reason why you intended to add a WMA header on that code(besides, if you look at the header of a .wma file, you'll see that there's no such thing such as a "dpds" chunk data until the end of the file, also the blocks for the rest of the .wma data are separated between empty blocks depending on the encoded bitrate used, therefore making this piece of code even more suspicious to look at since the xWMA format was built with a RIFF structure while with .wma it's not the case). So, what do you think about the idea of assigning an xWMA header on that WMA codec?
Last edited by AnonBaiter on Sun Oct 23, 2016 10:36 pm, edited 1 time in total.