Editing ISOs (Namco Bandai / CRIWARE / AFS Archive)

Discussion in 'Wii - Hacking' started by Deicard, Mar 20, 2010.

  1. Deicard

    Deicard Newbie

    Apr 19, 2009
    United States
    First off I'd like to apologize to anyone which feels I created a thread in the wrong category; if I have please feel free to change it to the relative forum.

    With that out of the way lets get down the what I would like to ask; I have a few questions related to ISO extraction and file types. Also any suggestions and thoughts would be gladly welcomed; thank you for your time in advance. Some background information Namco Bandai uses CRIWARE. Thus when editing expect to see things related to ADX, Sofdec and the likes. Currently, using WIIScrubber we are able to determine a good amount of information related to the ISO/Partition. The problem is normally the ISO has more other than an AFS.

    - Partition: 0 - DATA (0) (SDGUNDAM GGENERATION WARS)
    +- partiton.bin
    ÂÂ |- tmd.bin
    ÂÂ |- cert.bin
    ÂÂ |- h3.bin
    ÂÂ |- ticket.bin
    |- boot.bin
    |- bi2.bin
    |- apploader.img
    |- main.dol
    |- fst.bin
    +- afs
    ÂÂ |- afs0.afs
    ÂÂ |- afs1.afs
    ÂÂ |- afs2.afs
    ÂÂ |- afs3.afs
    ÂÂ |- infohash.bin
    +- strap
    ÂÂ |- strap_cn.zip
    ÂÂ |- strap_eu.zip
    ÂÂ |- strap_jp.zip
    ÂÂ |- strap_kr.zip
    ÂÂ |- strap_tw.zip
    ÂÂ |- strap_us.zip
    Ignore everything other then AFS since that is what contains the bulk of the information. Extracting the AFS it is able to be opened in an AFS viewer, however attempting to open this way is problematic. The ASF file system has inconsistencies with the viewer and must be updated; which means more inconsistencies are being created and the WII may not even read the fix/replacement. This has not been tested that far, getting around to it.

    Out of the AFS, TXD are able to be pulled out along with ESM files. None of the TXD files can be view using TXD viewers most likely due to being CRIWARE. Just most of the files in the AFS use PKzip compression, so these files can be uncompressed using WinRAR or the likes. Real problems right now is there is no easy way to figuring out a file structure for the AFS. The AFS is split into pieces and it is going to make it really hard to find any char script/text script for the game and then inject it back in.

    Being that the TXD files are not viewable does not really matter, unless the char script is an image.

    The ISO seems to be normal Wii ISO for the most part; the problem we are having is using an explorer to look within the AFS archive and the fact that it is not viewed correctly, making editing extremely hard. Everything has to be exported, logged, and then possibly uncompressed to be edited. Logged meaning, each AFS part has tons of files named "m" at different byte lengths, so there needs to be a conventional naming of each during exporting.

    While the 'files', that seem to have 'nothing' inside of them to uncompress, still have byte length and addresses, thus we end up opening them up in a hex editor to figure out what they relate too. Most of the time they list uncompressed files we have not found or establish a location for.

    Another problem is we are not able to load the different afs.afs0x files as a multi-archive. Thus we are unable to tell if some files from the end of the prior AFS relate to the next. This may include more then the exact end, since some seem to have a block length.
  2. NickW

    NickW Newbie

    May 19, 2008
    United States
    Use this to open the AFS archive:

    That should be able to view the AFS archives fine. AFS Explorer seems to give a lot of problems with newer games.
    DarthDub and Gameboy Color like this.
  3. Deicard

    Deicard Newbie

    Apr 19, 2009
    United States
    NickW, thanks for the AFS archive tool. Wonderful, including it has a nice add a number extension to each file!

    After digging into the first AFS (AFS.AFS0) we ended up finding a ton of compressed TXD files, EXS and DAT. TXD seem to not open with the relevant TXD viewers. With the TXD file there will be a normally three different TXD files, and a DAT which relates to each of the three TXD files. While with the EXS files another DAT file.. While there are a ton of 'shadow.EXS'.

    Example with the TXD
    +- afs\afs0\b_10668
    ÂÂ| - 0702_atk_b1.dat
    ÂÂ| - 0702_at3_b1v1c1_1.txd
    ÂÂ| - 0702_at1_b2v1c1_2.txd
    ÂÂ| - 0702_at1_b2v1c1_3.txd
    Using this example might be bad since we assumed that this exact txd/txd set is an attack animation. Which is completely not what we are looking for. Maybe we'll get somewhere with the next AFS archive, AFS1.
  4. referencer

    referencer GBAtemp Regular

    Aug 9, 2008
    United States
    Is the AFS filestructure supposed to be this stupid or is this some kind of error?
  5. Deicard

    Deicard Newbie

    Apr 19, 2009
    United States
    referencer; I think that is actually that stupid.

    afs0 >
    - m [about 10 of these]
    - b [rest of the afs is b]
    Most of the 'b' containers are compressed TXD, EXS files and the likes. The M has a sound stream 1, and then a sound stream 2.

    afs1 >
    - b [About 4000 some odd files]
    - c [Small amount, compression; mostly TXD files alone]
    - g [Small amount, compression; TXD files with actual names like gallery]
    - h [Small amount, compression; Has to deal with 'home button']
    - i [Large amount, possible compression; SSHT TXD]
    - m [Small amount; either SSHT/SSHF or compressed AFS archive!!!] - wtf...
    - o [Large amount; possible compression; TXD files alone.]
    - s [Med amount; possible compression; TXD with SSA files. Compressed AFS archive also]
    - t [Med amount; possible compression; TXD with SSA and DAT files. Compressed AFS archive also]
    afs2 >
    - t [ALL, compression, mostly TXD files alone]

    afs3 >
    Nothing, its zero bytes.

    Attempting to decode doesn't do much using Puyo Tools and attempting to view them using viewers and the likes. Trying to view TXD files and the likes normally doesn't work. One of the AFS partitions in Puyo Tools doesn't show any folders, while in the AFS viewer you can see some folders in one of them which contains loads of character voices.