wwt+wit: Wiimms WBFS+ISO Tools

Discussion in 'Wii - Hacking' started by Wiimm, Sep 28, 2009.

  1. Wiimm
    OP

    Wiimm Developer

    Member
    2,191
    394
    Aug 11, 2009
    Germany
    Germany
    What is the advantage of an unsigned image?
    However, technical the image is always signed, by random, null, fake sign or real sign.
     
  2. SuperrSonic

    SuperrSonic GBAtemp Advanced Fan

    Member
    670
    229
    Dec 9, 2011
    Puerto Rico
    I extracted SSBB with wit extract, now I'm trying to build it again but it's only copying the game partition.

    I used "wit copy (folder) --psel -update --split RSBE01.wbfs" also tried "--psel data,ptab1" to no avail.
     
  3. piratesephiroth

    piratesephiroth I wish I could read

    Member
    3,073
    1,633
    Sep 5, 2013
    Brazil
    why did you extract it?

    you can just use:
    Code:
    wit copy --source "path_to_old_iso" --dest "path_to_new_iso" --raw --psel DATA
     
    Last edited by piratesephiroth, Sep 5, 2017
  4. SuperrSonic

    SuperrSonic GBAtemp Advanced Fan

    Member
    670
    229
    Dec 9, 2011
    Puerto Rico
    For two reasons: remove the dummy files to save space, and to add a modified dol+brsar for dual audio. I've had this setup for a long time, I just want to fix the masterpieces.
     
  5. Wiimm
    OP

    Wiimm Developer

    Member
    2,191
    394
    Aug 11, 2009
    Germany
    Germany
    try: wit copy FOLDER --split RSBE01.wbfs
    without --psel
     
  6. shadow256

    shadow256 Member

    Newcomer
    30
    7
    Sep 30, 2017
    France
    Helo,

    At first, I want to say a big thank you for this great set of very useful tools.

    I'm trying to use Wit in a batch script but I have a problem with accents. For example:

    Code:
    @echo off
    set gamepath=testé.iso
    IF EXIST "%gamepath%" wit DUMP "%gamepath%"
    pause
    
    I've tried with the --no-utf-8 option, I have tried to change the active code page with "chcp 65001" and "chcp 1252" but same error:

    Code:
    !! wit: ERROR #74 [CAN'T OPEN FILE] in SetupReadSF() @ src/lib-sf.c#447
    !!      Can't open file: "testé.iso"
    
    I'm sure that the file exist and I'm also sure that the file haven't any problem because if I try to do the same thing with the same file but renamed to "test.iso", it works.

    I'm runing it on a french Windows 7 X64.

    Thanks for your help.

    PS: This problem also appears when there are accents in a dirrectory into the path. I don't know if this problem is on the destination path because I've only test this with source path.
     
    Last edited by shadow256, Nov 17, 2017
  7. Wiimm
    OP

    Wiimm Developer

    Member
    2,191
    394
    Aug 11, 2009
    Germany
    Germany
    I know there are some issues at the Cygwin layer for exotic letters. Is the file itself UTF-8 (my first recommendation) or has it any other coding.
     
  8. shadow256

    shadow256 Member

    Newcomer
    30
    7
    Sep 30, 2017
    France
    I use the ANSI encoding file for my script but I've tried UTF-8 also to see if it's work and no, it doesn't.

    If I do something like that:

    Code:
    @echo off
    chcp 65001
    set /p gamepath=Enter the path of your game:
    IF EXIST "%gamepath%" wit DUMP "%gamepath%"
    pause
    
    If I enter "testé" in my keyboard into the path of the file, it doesn't work aloso, whatever is the encoding of the file or the chcp value. I've also tested to do this directly in the cmd:

    Code:
    chcp 65001
    wit DUMP "testé.iso"
    
    But the problem was the same, doesn't work.

    I've made some other tests:
    - Encoding the script to UTF-8: doesn't work.
    - Exporting the variable to a text file in UTF-8 and call it it to replace wit source path: doesn't work.
    - Try to change encoding of chcp: doesn't work.
    - Try to mix encoding of the script and the chcp: doesn't work.
    - Try to enter the unicode char for the "é" "é": doesn't work but the char could be converted to a real "é" if I set the chcp to 65001.
    - Differents combinations of these tests: doesn't work.
    I start to think that this is unsolvable. If you have something to suggest to me I'll listen because I have no more ideas for testing?

    Edit: I found that in a cmd console, if I try:
    Code:
    wit DUMP "testé.iso"
    
    it doesn't work but if I do that:
    Code:
    wit DUMP testé.iso
    
    it work and I don't need to enable UTF-8 with chcp. Now it's not a solution because I use a script witch require user entries and without the ("), the script will not work properly. I continue to search...
     
    Last edited by shadow256, Nov 18, 2017
  9. Wiimm
    OP

    Wiimm Developer

    Member
    2,191
    394
    Aug 11, 2009
    Germany
    Germany
    I have tested it by myself and can confirm the issues. I've found some similar Cygwin problems and description how to fix it. For the moment it simply don't work .

    Workarounds for the moment:
    - use linux
    - rename the image
     
  10. shadow256

    shadow256 Member

    Newcomer
    30
    7
    Sep 30, 2017
    France
    OK, thanks. That's what I have done in my script, I temporarily copy the image to a location without accents.
     
  11. Wiimm
    OP

    Wiimm Developer

    Member
    2,191
    394
    Aug 11, 2009
    Germany
    Germany
    [​IMG]

    WIT: Wiimms ISO Tools v3.01a - 2017-12-03
    A command line ISO+WBFS tool set for various os.

    WIT (Wiimms ISO Tools) is a set of command line tools to manipulate Wii ISO images and WBFS containers. The two main tools are called wit (Wiimms ISO Tool) and wwt (Wiimms WBFS Tool, the WBFS manager).

    Feature overview:
    Visit https://wit.wiimm.de/features.html for more details.

    Download of the current version:

    There are also some GUI available:

    Change log:

    Code:
    wit v3.01a r7464 - 2017-12-03
    
     - New option: --dsync: The option enables the usage of flag O_DSYNC when
       opening a partition at a hard drive. With activated flag, writing an image
       is some percent slower, but the progress counters are exact again.
    
    
    The source is published under the license of GPL2. Checkout the sources directly from the SVN repository or browse the source. Visit https://wit.wiimm.de/ for more information.
     
    bm123456 and markehmus like this.
  12. johnsanc

    johnsanc Member

    Newcomer
    16
    0
    Sep 27, 2016
    United States
    Maybe I’m doing something wrong... but how do you get wit MIX to create an ISO with the data partition starting at 0xf80000?
    When I use the mix function the memory maps show the data partition starts immediately after the update partition ends instead of having unused space between. I checked this by using wit DUMP on my mixed file with verbose logging.
     
    Last edited by johnsanc, Dec 10, 2017
  13. ibizaman

    ibizaman Newbie

    Newcomer
    1
    0
    Dec 26, 2017
    United States
    Just wanted to share this two-liner that allows a two-way sync between a hard drive and a folder on my laptop:
    sudo wwt LIST | head -n-3 | tail -n+4 | cut -d' ' -f1 | sudo xargs -n1 -I. wwt EXTRACT --auto --update .=/home/me/folder
    sudo wwt ADD --recurse /home/me/folder --auto
     
  14. Wiimm
    OP

    Wiimm Developer

    Member
    2,191
    394
    Aug 11, 2009
    Germany
    Germany
    Use a point "." as ID selector and your first command becomes easier:
    sudo wwt EXTRACT --auto --update -i . -d /home/me/folder --test
    Remove --test to disable test mode.
     
  15. Ebola16

    Ebola16 Newbie

    Newcomer
    9
    0
    Jun 1, 2017
    United States
    Hello,

    I'm using an unedited WBFS of Super Smash Bros Brawl (NTSC-U, dumped from USB Loader GX, split at 4GB, game partition only). I want to generate an ISO. I tried two different methods:

    Method 1
    Code:
    wit copy ssbb.wbfs ssbb.iso --raw
    I get an ISO

    Method 2
    Code:
    wit extract ssbb.wbfs ssbb --raw
    then
    Code:
    wit copy ssbb ssbb.iso --raw
    I get a non-identical ISO

    I'm dealing with a temperamental code that works with Method 1's ISO but not Method 2's ISO. Shouldn't the ISOs be identical? If not, how do I get Method 2's ISO to match Method 1's ISO? Ideally I'd like use Method 2's extract to filesystem directory then copy to ISO in the future to make mass editing easier.

    Thanks!
     
    Last edited by Ebola16, Feb 3, 2018
  16. GreyWolf

    GreyWolf GBAtemp Psycho!

    Member
    4,570
    892
    Mar 2, 2015
    United States
    If you made the wbfs with Wii Backup Manager then the partition table may be corrupted.
     
  17. Ebola16

    Ebola16 Newbie

    Newcomer
    9
    0
    Jun 1, 2017
    United States
    I can try a different method for ripping. I'll try Clean Rip. Let me know if there's a new preferred way to rip ISOs now. Otherwise I'll report back later.
     
  18. Ebola16

    Ebola16 Newbie

    Newcomer
    9
    0
    Jun 1, 2017
    United States
    There still appears to be a problem. I'm using wit-v3.00a-r7387-cygwin.

    Whole ISO generated by CleanRip's MD5: 52ce7160ced2505ad5e397477d0ea4fe

    ISO generated by Method 2
    Code:
    wit extract ssbb.iso ssbb --raw
    then
    Code:
    wit copy ssbb new.iso --raw
    Method 2's new.iso MD5: 18ab5fd6978f1b2f79c3dcf194b1ca06
    New.iso only contains partitions 0 and 1. The extracted filesystem directory appears to contain more partitions. --raw, --psel all, and --psel whole all generate ISOs of the same size. I think ignoring the other partitions is a bug.

    Shouldn't the ISOs be identical? If not, how do I get Method 2's ISO to match CleanRip? Ideally I'd like use Method 2's "extract to filesystem directory then copy to ISO" in the future to make mass editing easier.
     
  19. Wiimm
    OP

    Wiimm Developer

    Member
    2,191
    394
    Aug 11, 2009
    Germany
    Germany
    1. If you don't use the raw options, you get the same result. --raw is only important for binary copies.
    2. The composing part can only handle UPDATE, DATA and CHANNEL partitions. See https://wit.wiimm.de/info/composing.html#disc . So the extra partitions can't be handled. However a workaround is to use "wit MIX" and to tell wit about each partition. MIX was created for a special purpose years ago and I don't remember the details.
    3. I don't see any benefit to at the advertising channels to the game again.
    4. I don't see it not as bug, because I think supporting other partitions is useless.
     
  20. GreyWolf

    GreyWolf GBAtemp Psycho!

    Member
    4,570
    892
    Mar 2, 2015
    United States
    The only reason I kept the demo partition on mine is so the console doesn't crash if I accidentally click on the menu option for them. :P

    WIT handles the SSBB partition table properly. It's WBM that screws it up.