Page 1 of 1

[XBOX] The Godfather .viv archives

Posted: Mon Feb 08, 2016 7:02 am
by stuntpenguin
I'm trying to figure out how to extract the contents of .viv archive for the game "The Godfather". The game contains all of it's files other that the executable in these archives names "godfath0.viv" through "godfath4.viv". It seems like some variant of BIGF. Each one starts with the "ÂIGH" or "C2 49 47 48" in hex. The next four bytes indicate the size of the archive. After that I'd assume to see the offset of the first file, but the next four bytes don't really point anywhere useful.

I'm able to find a few SCHl .str sound files in the archives. I've tried taking the address of where those files are found in an effort to search for their offset in hopes of finding some kind of file table but I'm having no luck there either.

I'm willing to bet that the PS2 and PC versions of this game have the same types of archives.

Has anyone encountered this type of archive before?

Re: [XBOX] The Godfather .viv archives

Posted: Mon Feb 08, 2016 10:20 pm
by WRS
Post a sample, or a chunk of the first few mb and we can take a look (:

Re: [XBOX] The Godfather .viv archives

Posted: Wed Mar 09, 2016 12:03 am
by stuntpenguin
I think I'm on the right track. The viv file contains a list of entries in a "file table". Each entry is three words long. The words represent: size, offset, and filename hash. The first few file names (whole path eg "frontend/frontend.str") are hard coded into the xbox executable.

The game starts by hashing the hardcoded string "frontend/frontend.str" and looking for the matching hash in the viv archive file table.

Here is where I'm starting to get stumped. I believe that once frontend.str has been loaded, it looks for the next file path to load from somewhere within frontend.str. I've done some debugging and found that the file that loads after frontend.str is frontend_global.str. If you look at 0x53 in frontend.str, you'll see "frontend_global".

In frontend_global.str at about 0x800 there is a "StreamTOC". This area of the file lists the directory paths of several other files. Unfortunately, not all StreamTOC's are as clear. For example, the StreamTOC in a file called "wb_mobface_final_global.str" is seemingly filled with random bytes and occasionally the broken remnants of a file directory.

Here's an example of a file directory remnant:
Folder\n.%pcådels\nm_newsstandowner_0..0˜.2â

From my experience debugging this game, I know that it should probably be something like:
GlobalFolder\npc_models\nm_newsstandowner_00_model.str

Do you guys think the StreamTOC's could be compressed or encoded in some way?

Here are a few .str files to look at:
https://mega.nz/#!7MpzDAbK!NoZcvFabxy-W ... 7dWU1sy4LY

Thanks!

Re: [XBOX] The Godfather .viv archives

Posted: Wed Mar 09, 2016 11:30 am
by Gh0stBlade
I discussed this format with someone on another forum very recently. I know how the .VIV format works, however the problem is the file names are hashed so there's no point in extracting them unless the location for the filenames are found. A quick way of dumping the names would be to set a breakpoint on the hashing algorithm then dump the string.

Re: [XBOX] The Godfather .viv archives

Posted: Thu Mar 10, 2016 1:38 am
by WRS
how are you debugging this on xbox? is this 360 (so xenia?)

Re: [XBOX] The Godfather .viv archives

Posted: Thu Mar 10, 2016 2:01 am
by stuntpenguin
I'm debugging it on an (original not 360) DVT4 xbox development kit through visual studio 2003. I have the symbols so it's relatively easy for me to find functions and put breakpoints at them.

I could just make a hook to dump out the file names when they pass through the hashing function, however, I'd like to figure out how this format actually works. Filenames only pass through the hash function when they are needed, so I'd have to adventure every part of the game and hope I've collected all of the directories.

Think I'm making a little progress by debugging this function
Framework.StreamTOC.InplaceFixup()

Could be searching in the wrong places but I guess I'll find out eventually.

Re: [XBOX] The Godfather .viv archives

Posted: Thu Mar 10, 2016 9:39 pm
by daemon1
You are wasting your time. This is Visceral Games formats, and these were all reversed long time ago for Dead space 1/2/3. RickVisceral tools are available with source codes included. I bet all the names can also be found with the techniques used for Dead Space. You don't have to play the whole game to do it, you don't have to debug it either.

p.s. yes, some files are compressed.

Re: [XBOX] The Godfather .viv archives

Posted: Fri Mar 11, 2016 5:38 pm
by daemon1
Full filelist, if you need it.

Re: [XBOX] The Godfather .viv archives

Posted: Tue Mar 15, 2016 5:52 pm
by daemon1
So was it helpful? Do you need any more info on this game or engine format?