Is there a "WiiScrubber" program for wads?

Discussion in 'Wii - Hacking' started by Awesome turtwig, Jul 1, 2009.

  1. Awesome turtwig
    OP

    Member Awesome turtwig GBAtemp Regular

    Joined:
    Sep 26, 2008
    Messages:
    286
    Location:
    USA
    Country:
    United States
    Some program that will open up a wad file... letting you extract/replace content, does this exist?
     
  2. kLiNiKaL

    Member kLiNiKaL Dr. Greenthumb

    Joined:
    May 24, 2009
    Messages:
    581
    Location:
    Los Ganjales
    Country:
    Jamaica
    yes, its not so advanced

    you can just unpack them into there folder structure and then repack and resign

    you will need more than 1 app and its abit more of a pain in the ass lol
     
  3. Awesome turtwig
    OP

    Member Awesome turtwig GBAtemp Regular

    Joined:
    Sep 26, 2008
    Messages:
    286
    Location:
    USA
    Country:
    United States
    what's it called?
     
  4. kLiNiKaL

    Member kLiNiKaL Dr. Greenthumb

    Joined:
    May 24, 2009
    Messages:
    581
    Location:
    Los Ganjales
    Country:
    Jamaica
    its not a it

    you could use wwunpacker to unpack the .wad

    the other tools would depend on what you want to change.
     
  5. Matt93

    Member Matt93 GBAtemp Fan

    Joined:
    Nov 14, 2008
    Messages:
    469
    Country:
    United States
    A universal wiiscrubber-like program sure would be nice for wads.
     
  6. kLiNiKaL

    Member kLiNiKaL Dr. Greenthumb

    Joined:
    May 24, 2009
    Messages:
    581
    Location:
    Los Ganjales
    Country:
    Jamaica
    you cant "scrub" a wad
     
  7. TheWiiNinja

    Member TheWiiNinja GBAtemp Regular

    Joined:
    Mar 14, 2009
    Messages:
    112
    Location:
    Texas
    Country:
    United States
    I think people want one just as a easy way to inside the wad and see the file contents.
     
  8. sl33p

    Member sl33p GBAtemp Regular

    Joined:
    Dec 7, 2008
    Messages:
    191
    Country:
    United States
    There is no reason to "scrub" a wad as you would a disc.

    Garbage data ) is what is "scrubbed" or removed from a disc image. This data is added to a DVD image in order to physically shift the actual game data to the outer portions of the physical DVD in order to speed up loading issues. This garbage data is why every Wii ISO is about 4GB+ in size (Except SSBB which is dual layer). When games are "scrubbed" this psuedo-random garbage data is essentially converted to something predictable (all 0s or something similar) which can be compressed to very little space. Thus, several GBs of data that is there only for padding purposes can be reduced to mere KB.

    WADS are not distributed on DVD and therefore they have no need for a dummy file to put the game data to a more optimal location on the actual DVD. Since WADS don't ship with this data, there isn't anything to scrub.
     
  9. bdr9

    Member bdr9 GBAtemp Advanced Fan

    Joined:
    Jul 21, 2008
    Messages:
    558
    Country:
    United States
    He was referring to WiiScrubber's feature to replace individual files in an ISO.
     
  10. sl33p

    Member sl33p GBAtemp Regular

    Joined:
    Dec 7, 2008
    Messages:
    191
    Country:
    United States
    Ah geez, yeah that is a totaly different issue.... I Googled around a bit and honestly I haen't seen very much promising info.

    This is the only thing that seems decent but perhaps not very useful if the wad uses its own proprietary file format beyond the wad container. But this can at least get you started.. And the code all belongs the guy in the link. Maybe give him a message to see if he's progressed.


    CODE#!/usr/bin/perl
    #
    # Filename: u8extract.pl
    #
    # Desc:
    #ÂÂÂÂUsed to extract files from Wii U8 archives.
    # Last updated:
    #ÂÂÂÂ08/14/2008
    # Usage:
    #ÂÂÂÂu8archive.pl archivename
    # Note:
    #ÂÂÂÂCreates "u8out" directory for output.
    #
    # - FyberOptic
    # http://www.fybertech.com
    #


    my $u8filename = $ARGV[0];

    if (!length($u8filename) || !-e $u8filename) { print "Please specify a U8 archive to extract\n"; exit; }

    # Open archive
    open(U8FILE, $u8filename);
    binmode(u8FILE);

    #struct U8_archive_header
    #{
    #ÂÂu32 tag; // 0x55AA382D "U.8-"
    #ÂÂu32 rootnode_offset; // offset to root_node, always 0x20.
    #ÂÂu32 header_size; // size of header from root_node to end of string table.
    #ÂÂu32 data_offset; // offset to data -- this is rootnode_offset + header_size, aligned to 0x40.
    #ÂÂu8 zeroes[16];
    #};

    my $filedata;

    # Read archive header
    read(U8FILE, $filedata, 16);
    my ($header_tag,$rootname_offset,$header_size,$data_offset) = unpack("N N N N",$filedata);

    # Check for U8 header tag
    if ($header_tag != 0x55AA382D) { print "Invalid U8 archive\n"; exit; }

    #print "HEADER: $header_tag $rootname_offset $header_size $data_offset\n";

    #Read 16 unknown bytes
    read(U8FILE, $filedata, 16);


    #struct U8_node
    #{
    #ÂÂu16 type;
    #ÂÂu16 name_offset;
    #ÂÂu32 data_offset;
    #ÂÂu32 size;
    #};


    # Read first node
    read(U8FILE, $filedata, 12);
    my ($node_type, $node_nameoffset, $node_dataoffset, $node_size) = unpack("n n N N",$filedata);

    #print "FIRST NODE: $node_type, $node_nameoffset, $node_dataoffset, $node_size\n";

    # Number of nodes = First node's size
    my $totalnodes = $node_size;

    # Used to store remaining nodes' hash tables
    my @nodes;

    # Read nodes (minus one, since we read one already)
    for ($n = 0; $n < $totalnodes-1; $n++)
    {
    ÂÂÂÂread(U8FILE, $filedata, 12);ÂÂÂÂ
    ÂÂÂÂmy ($node_type, $node_nameoffset, $node_dataoffset, $node_size) = unpack("n n N N",$filedata);
    ÂÂÂÂ#print "NODE $n: $node_type, $node_nameoffset, $node_dataoffset, $node_size\n";
    ÂÂÂÂ
    ÂÂÂÂmy %currentnode = ('type',$node_type,'nameoffset',$node_nameoffset,'dataoffset',$node_dataoffset, 'size',$node_size);
    ÂÂÂÂpush @nodes,\%currentnode;
    }

    #print "STRINGS SIZE: " . ($header_size - tell(U8FILE) + 32) . "\n";

    # Read string table
    my $stringtabledata;
    read(U8FILE, $stringtabledata, $header_size - tell(U8FILE) + 32);

    # Split string table into array
    my @stringtable = split("",$stringtabledata);

    # Create directory to store output files
    mkdir("u8out");

    # Extract files
    foreach (0..@nodes-1)
    {
    ÂÂÂÂmy %thisnode = %{$nodes[$_]};
    ÂÂÂÂ#print "NODE $_: $thisnode{type}, $thisnode{nameoffset}, $thisnode{dataoffset}, $thisnode{size}\n";
    ÂÂÂÂ#print "FILENAME: $stringtable[$_+1]\n\n";
    ÂÂÂÂif ($thisnode{'type'} != 0) { next; }
    ÂÂÂÂ
    ÂÂÂÂprint "Extracting $stringtable[$_+1]...\n";
    ÂÂÂÂ
    ÂÂÂÂmy $filebuffer;
    ÂÂÂÂseek(U8FILE, $thisnode{'dataoffset'}, 0);
    ÂÂÂÂread(U8FILE, $filebuffer, $thisnode{'size'});ÂÂÂÂ
    ÂÂÂÂ
    ÂÂÂÂopen(OUTFILE, "> u8out/$stringtable[$_+1]");
    ÂÂÂÂbinmode(OUTFILE);
    ÂÂÂÂprint OUTFILE $filebuffer;
    ÂÂÂÂclose(OUTFILE);
    }

    close(U8FILE);

    Link



    EDIT: Seems this is the process for unpacking wads

     

Share This Page