ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Fri Jul 20, 2018 4:29 pm

All times are UTC




Post new topic  Reply to topic  [ 46 posts ]  Go to page Previous 1 2 3 Next
Author Message
PostPosted: Tue Apr 12, 2016 4:32 pm 
Site Admin
User avatar

Joined: Wed Jul 30, 2014 9:32 pm
Posts: 8468
Just for reference, the following is the tool that I wrote many years ago and it's no longer indexed on my website:
http://aluigi.org/papers/vagguess.zip

As you can imagine there is and there will be no support from me.


Top
   
PostPosted: Tue Apr 12, 2016 5:50 pm 

Joined: Tue Feb 02, 2016 2:35 am
Posts: 1076
aluigi wrote:
the following is the tool that I wrote many years ago and it's no longer indexed on my website

No worries pal, I already got your tool.

_________________
the number one killer is time
it destroys us all


Top
   
PostPosted: Sat Apr 16, 2016 7:16 am 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
The first results are good. The tool can detect VAG streams in 99% cases. There are some false positives and false negatives depending on settings, but at least I think we'll be able to detect audio inside of archives (like in examples you uploaded here)


Top
   
PostPosted: Sat Apr 16, 2016 12:42 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
Here's the first experimental version. Works only with mono files now.

What it does:

Scan the whole file by 256-byte blocks trying to detect VAG stream analyzing its statistical data. Can detect VAGs with any alignment (even if it starts, say, from offset 0x5B07). Then read the stream until the end-of-stream flag and dump it.

No good detection for stream start yet, and no support for interleaving.


Last edited by id-daemon on Thu Apr 21, 2016 3:32 pm, edited 1 time in total.

Top
   
PostPosted: Sat Apr 16, 2016 4:52 pm 

Joined: Tue Feb 02, 2016 2:35 am
Posts: 1076
I tested your tool and although it needs some work, it was quite useful in the end. At least, with the latter archive file I provided.

This .vag file, for example, has three audio files tied together(see the attachment below).

That's just what I wanted to report though. Good luck on your tool, I guess.


Attachments:
8225.rar [3.1 MiB]
Downloaded 81 times

_________________
the number one killer is time
it destroys us all
Top
   
PostPosted: Sat Apr 16, 2016 5:32 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
Yes, there are no "end" flag in these streams. They have a "start" flag instead. Do you have correct meanings for VAG flags? Becuase I'm just guessing them.

I think this tool must have a lot of settings. In this case, for example, a block of zeroes will be used as an end of stream.


Top
   
PostPosted: Sat Apr 16, 2016 8:56 pm 

Joined: Tue Feb 02, 2016 2:35 am
Posts: 1076
id-daemon wrote:
I think this tool must have a lot of settings. In this case, for example, a block of zeroes will be used as an end of stream.

Then they are dumped as raw VAG files, correct?
And speaking of settings, how can I use them? Your tools always consisted of "drag-and-drop the original file" kind of approach.

_________________
the number one killer is time
it destroys us all


Top
   
PostPosted: Sun Apr 17, 2016 7:57 am 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
AnonBaiter wrote:
Then they are dumped as raw VAG files, correct?

I can also decode them to WAV.

AnonBaiter wrote:
Then they are dumped as raw VAG files, correct?
And speaking of settings, how can I use them? Your tools always consisted of "drag-and-drop the original file" kind of approach.

No, not always.

It can be GUI tool like Evolution engine tool viewtopic.php?f=6&t=1960
Or command line parameters, like usual. When you "drop the file" it means you have only have 1 parameter (file name), but there may be more.


Top
   
PostPosted: Mon Apr 18, 2016 11:46 am 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
What game is that 8225 file from?


Top
   
PostPosted: Mon Apr 18, 2016 2:48 pm 

Joined: Tue Feb 02, 2016 2:35 am
Posts: 1076
id-daemon wrote:
What game is that 8225 file from?

World Soccer Winning Eleven 5.

_________________
the number one killer is time
it destroys us all


Top
   
PostPosted: Mon Apr 18, 2016 5:21 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
Ok, after many tests I can confirm that universal approach for this tool can only be based on manual switching of different methods for detecting stream start, end, and interleave. There are many types, and there's no way to detect this automatically.

So for example, you will need to run scan in "mono" mode first, then stereo.

I will try and support most usual cases, and then maybe if there will be interest in this, I can expand it.

If you have more examples that you think will be interesting, send them.


Top
   
PostPosted: Mon Apr 18, 2016 7:47 pm 

Joined: Tue Feb 02, 2016 2:35 am
Posts: 1076
id-daemon wrote:
If you have more examples that you think will be interesting, send them.

I'll try my best!

_________________
the number one killer is time
it destroys us all


Top
   
PostPosted: Tue Apr 19, 2016 2:22 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
Things are going good. 2 common interleave types already implemented. Used in "the warriors" and your World Soccer Winning Eleven.

Must say that Luigi's vaguess tool didn't work right with "the warriors", and couldn't detect interleave in all cases. As a result, his tool extracts 299 files, while there are actually 349. My current tool works better and currently detects 343 files there. While the remaining 6 have size exactly divisible by its interleave, making it impossible to detect by "zero blocks".

It's possible to decode even those, but only manually.


Top
   
PostPosted: Tue Apr 19, 2016 2:54 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
For example, if we have stream with length = 0x221100, then out of all possible Warriors interleaves (from 6E00 to 8000 with step 40) we have only one exact divider, and it is 72C0. So this will be an interleave for this stream. I checked that and its working.

Image


Top
   
PostPosted: Tue Apr 19, 2016 2:58 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
Howether, for another stream of 0x2B1100 bytes, there are three dividers: 6E40, 7080 & 7A80, so I had to check them all to find the right one. It was 6E40.


Top
   
PostPosted: Tue Apr 19, 2016 4:39 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
At last, after lots of testing, I'm ready to present the first tool version that supports stereo interleaved streams. For now, it will only scan file and output raw files, that you can check. After more testing, I think I can add decoding too.

Usage:
vag_scanner [file_name] [mode]

modes:
s1 - stereo with last short block (like in soccer)
s2 - stereo with all blocks of equal size (like in warriors)
s3 - stereo with "end of stream" markers
anything else - mono mode

If you don't set [mode] parameter, it will presume mono. So if you just drag a file onto the tool, it will work mono,

Usually all streams in one game will be the same type. So you only need to find the right mode, and it will extract all stereo streams. Some games may work with two modes (for example s1 & s3). Additional run may be needed for mono files, while most stereo modes will also output mono files correctly.


Attachments:
vag_scanner.rar [3.08 KiB]
Downloaded 130 times
Top
   
PostPosted: Tue Apr 19, 2016 9:42 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
I think no need to decode them. Just make SVAG headers, and they will be playable.


Top
   
PostPosted: Wed Apr 20, 2016 6:13 am 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
So let me know, if I can leave it like this, make the tool add headers, or it would be better to decode to WAV.


Top
   
PostPosted: Wed Apr 20, 2016 2:22 pm 

Joined: Tue Feb 02, 2016 2:35 am
Posts: 1076
id-daemon wrote:
So let me know, if I can leave it like this, make the tool add headers, or it would be better to decode to WAV.

I think it would be best to leave the tool as is. The rest is up to you.

_________________
the number one killer is time
it destroys us all


Top
   
PostPosted: Wed Apr 20, 2016 5:50 pm 

Joined: Sun Mar 22, 2015 7:09 pm
Posts: 770
Ok. I already made some adjustments for better handling mode s3, I will update the tool soon. If you'll encounter any files that it can't handle, let me know, maybe I can add more modes.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 46 posts ]  Go to page Previous 1 2 3 Next

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited