Monsters vs. Aliens Streams.dat Official Thread

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

Hi! I saw a bunch of threads opened for this game but now I think it would be reasonable to open just one for all the platforms.

There is a script to extract Monsters vs. Aliens PC and Xbox 360 (aluigi you might have to edit on your page that it is not for PS3) versions Streams.dat: works on PC but not on Xbox 360.

I'm explaining: the script correctly extracts headerless IMA ADPCM nibble-interleaved soundbanks for PC but extracts corrupted headerless XMA 2 soundbanks for the Xbox 360 version.

Is there a possibility to fix the script to extract correctly the Xbox 360 sound files and also make it compatible for the other versions like Wii, PS2 and PS3?

I'm asking this because the other versions might have alternate files inside.

Samples

Wii: Wii_Streams.dat
Xbox 360: X360_Streams.dat
PS2: PS2_Streams.dat
PS3: PS3_Streams.dat

Thanks in advance!
Last edited by Warthog1336 on Sun Feb 24, 2019 3:56 pm, edited 1 time in total.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

News! I found something interesting inside the Wii version's files. Apparently, Goliath_Final.elf and main.dol have "Streams.dat" in plain text when viewing in Hex. Maybe it can help understand how to unpack the Streams.dat content.

By the way, in the same directory as Streams.dat, there are a lot of *.PAK (for PS2, Wii and PC) which hold all the data except sound and movies. I tried to view their content in Hex and found a lot of "music" texts so maybe they store the original filenames for the files inside Streams.dat, but I'm not 100% sure.

Besides, I added samples for the PS3 version of the game (edited my first post). The "data" directory where Streams.dat can be found (on PS3 and Xbox 360) is full of *.PKZ files which contain the same data as *.PAK but they use a different format. There are no plain-text filenames inside them.

Also, a "GameLogic.dll" and "GameLogic.sprx" can be found on PC/PS3.

The game executable is below.

Samples

Goliath_Final.elf and main.dol from Monsters vs. Aliens (Wii): https://mega.nz/#!fosAyYxR!L9PGFGU_vbpz ... CHlTYu2OHM

BobC1PartC.pak from Monsters vs. Aliens (Wii): https://mega.nz/#!GwsQHaTT!giNv5w25r3LZ ... 0JSRznqDzs

BobC1PartC.pak from Monsters vs. Aliens (PS2): https://mega.nz/#!rpsQGa4C!Gaqer5i8G8Rf ... jkopIdkOV8

BobC1PartC.pak from Monsters vs. Aliens (PC): https://mega.nz/#!mlVEXArC!-4YUCbW4Bcjp ... UUXJLr17Sg

GameLogic.sprx from Monsters vs. Aliens (PS3): https://mega.nz/#!bw9iwKTC!bjORvXiBYtcB ... uKtqEOaS2U

GameLogic.dll from Monsters vs. Aliens (PC): https://mega.nz/#!ug8wQCzK!rPo-x_VhONDP ... iMm6W7UhPw

Game.exe from Monsters vs. Aliens (PC): https://mega.nz/#!C4M0jQZa!ksAtNlTQS-J8 ... Njt1-vv7cQ

Thanks in advance.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by aluigi »

Script 0.1.2:
http://aluigi.org/bms/monsters_aliens_streams.bms

X360 seems ok
PS3 ok
PS2 ok
WII, not supported because it's a mess.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

I can't believe you did this, that's fantastic. Unbelievable! Thank you so much! Considering how tricky it was.
I will stop requesting things about this game because you did all your possible to help me and it's awesome.
Just one question, was I wrong about the original filenames stored in other files?
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by aluigi »

Not sure about the filenames, it's something that I didn't check since I focused only on the comparison of the 4 versions for improving the compatibility of the script.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

I'm repeating myself but thank you so much.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

I really should start writing my first BMS script one of these days, and maybe I'll choose the Wii version of Monsters vs. Aliens so that I can also help. I already tried to understand how to write a BMS script but I found this quite difficult. Now I think I need to take a new look.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by aluigi »

Start with simple formats.
If you start learning a language (and reverse engineering) for doing something very difficult, it will be difficult or even impossible.
AnonBaiter
Posts: 1125
Joined: Tue Feb 02, 2016 2:35 am

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by AnonBaiter »

i tried to tackle this Streams.dat format out of boredom
i based most of this script out of Bee Movie Game(using PC, PS2 and Xbox 360 versions, since Beenox developed the game with these targeted platforms in mind) and then i had to take a look at your samples which forced me to go out of my way to support all versions of at least two games using Streams.dat
the worst part of all this is trying to deal with Streams.dat as it appears on the PS3 and Wii formats of Monsters vs. Aliens so let me just put it out there that this format is a literal mess of epic proportions and leave it at that

do note though that this script does not support extraction stuff and i'll probably never support this in the future
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

aluigi

Hello. I really prefer when your scripts extract the files as they are in the archive, without ss2 header. How can I just extract the raw files?

I deleted these lines and the endif :

Code: Select all

if X360_MODE == 0
   callfunction DUMP_VAG 1
else


But it does not seem to extract the PS3 streams correctly, for example one of the music's length is normally 2:10 but is cutted and is 1:03 when extracted from Streams.dat PS3. It also happens on PS2 by the way.

Thank you in advance.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by aluigi »

from:

Code: Select all

    if X360_MODE == 0
        callfunction DUMP_VAG 1
    else
        string NAME + "raw"
        log NAME OFFSET SIZE
    endif
to

Code: Select all

        string NAME + "raw"
        log NAME OFFSET SIZE
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

This is what I did as well ^^
For some reason the tracks are cutted when they are extracted from PS2 and PS3.

Code: Select all

string NAME p "%08x_%d_%d." i FREQUENCY CHANNELS
endian save MYENDIAN
endian little
string NAME + "raw"
log NAME OFFSET SIZE
endian restore MYENDIAN
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

Sorry for the double post but checked in-game and it's definetely an extraction issue. I don't know why the tracks are complete on PC (another thread script) and Xbox 360 but not on PS2 and PS3? Thank you in advance.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by aluigi »

I did a simple list (quickbms -l) plus "sort" on the ps2 sample and checked the results:

Code: Select all

+ 00087000 151168     00001506_44100_1.dat
+ 00087000 151168     00001c08_44100_1.dat
+ 00087000 151168     0000230a_44100_1.dat
+ 000ac000 71216      00001507_44100_1.dat
+ 000ac000 71216      00001c09_44100_1.dat
+ 000ac000 71216      0000230b_44100_1.dat
+ 000bd800 148064     00001508_44100_1.dat
+ 000bd800 148064     00001c0a_44100_1.dat
+ 000bd800 148064     0000230c_44100_1.dat
+ 000e2000 440160     00000003_44100_2.dat
+ 000e2000 440160     00000705_44100_2.dat
+ 000e2000 440160     00000e07_44100_2.dat
+ 000e2000 440160     00001509_44100_2.dat
+ 000e2000 440160     00001c0b_44100_2.dat
+ 000e2000 440160     0000230d_44100_2.dat
+ 000e2000 440160     00002a0f_44100_2.dat
...

The offsets and size are correct since 0x00087000+151168=0x000abe80, the next offset is 0x000ac000 indeed.

What's wrong is that 3 or more different files reference the same data, but it's not a bug of the script, it's just what's written in the table.
Therefore the coverage reported by quickbms at the end is invalid, if the extraction was ok you should have obtained something like 200% or 300%.

I don't think there is unhandled data.
You can try using the -B option (with -0 so don't need to re-extract everything) and checking how big is the QUICKBMS_DEBUG_FILE generated.
Warthog1336
Posts: 140
Joined: Mon Feb 05, 2018 5:45 pm

Re: Monsters vs. Aliens Streams.dat Official Thread

Post by Warthog1336 »

In case you're interested, Nicknine wrote a script for the Wii version and it worked :D

Code: Select all

# written by Nicknine

endian big

get MAGIC long
get VERSION long
get FILES long
get LANGS long

for i = 0 < LANGS
    get IDX long
next i

get DUMMY long
get DUMMY long

get BNAME basename

for i = 0 < LANGS
    for j = 0 < FILES
        savepos HDR_OFFSET
        getdstring DUMMY 0x10
        get IDX long
        get OFFSET long
        get CH long
        get SIZE long
       
        math SIZE * CH
        string NAME p "%s_%d_%d.hdr" BNAME i j
        log NAME HDR_OFFSET 0xe4
        string NAME p "%s_%d_%d.vgmstream" BNAME i j
        log NAME OFFSET SIZE
       
        goto HDR_OFFSET
        goto 0xe4 0 SEEK_CUR
    next j
next i