Hacking wwt+wit: Wiimms WBFS+ISO Tools

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
frailimbnursry said:
Wiimm - When using "wit copy -B -s [source path] -d [destination path]", is it set to split the .wbfs file (2GB or 4GB) automatically? I know in the documentation a 2GB default is given and I believe in one of the changelogs it was set to 4GB but in reality, wit did not split the wbfs file anywhere. I didn't set a specific size thinking it was a default parameter.

The default split size id 4gb (changed in the docu now). To enable splitting use --split or the short option -z. With --split-size=size you can set other split sizes.

Only iso2wbfs has enabled the splitting by default.

QUOTE(frailimbnursry @ Dec 9 2009, 07:33 PM) Also, I asked this earlier and I hate to ask it again less than a page later but I wondered your personal opinion. Which do you think is a more reliable (file integrity / speed) option: WBFS or FAT32 w/ .wbfs file? Does it even matter anymore this far into development of both?
I have no experience with FAT/WBFS yet. Pure WBFS works fine for me and changing to FAT needs time.
 

wedsxcrfv

New Member
Newbie
Joined
Nov 14, 2009
Messages
2
Trophies
0
XP
12
Country
Netherlands
Thanks for this set of tools! It is great

I do think you shoud add some usage examples or something, because it is a little bit hard to get started (even if you read the docs).
 

mousex

Well-Known Member
Member
Joined
Jan 23, 2009
Messages
986
Trophies
0
XP
115
Country
United States
What examples are missing for you?
Wiimm can't add examples for everything, the tool can do too much for this but if you ask he (and maybe I) can give you the examples.
 

drh

Well-Known Member
Newcomer
Joined
Nov 14, 2009
Messages
76
Trophies
0
XP
81
Country
I can see where he's coming from, I've been using the tool for a while now and I use the same commands a lot, but the minute I try to do something new, I still find I have to experiment to get a result.

for example, the majority of the time I am simply adding or extracting files so I am using:

To Extract a disc from the USB Drive to the current local folder:

wwt -p {devicename} extract {nintendoID}

wwt -p /dev/disk1s1 extract RABCDE

To add a disc from the current local folder to the USB Drive:

wwt -p {devicename} add {nintendoID}

wwt -p /dev/disk1s1 add RABCDE

To add all new files in current local folder:

wwt -p /dev/disk1s1 add *

{I use the above command a lot, because wwt will only add files that do not already exist in the drive, so its safe to always use this even if only adding a few new files amongst hundreds of existing ones!}

however, I have a local storage of my WDF files and I wondered if I could use the ST command to settitle of the files locally? or does wwt and wit only work with the USB wbfs partition exclusively?
 

wedsxcrfv

New Member
Newbie
Joined
Nov 14, 2009
Messages
2
Trophies
0
XP
12
Country
Netherlands
drh said:
To Extract a disc from the USB Drive to the current local folder:

wwt -p {devicename} extract {nintendoID}

wwt -p /dev/disk1s1 extract RABCDE

To add a disc from the current local folder to the USB Drive:

wwt -p {devicename} add {nintendoID}

wwt -p /dev/disk1s1 add RABCDE

To add all new files in current local folder:

wwt -p /dev/disk1s1 add *
Yeah, something like these would be useful for new users
 

tomhead

Member
Newcomer
Joined
Dec 12, 2009
Messages
8
Trophies
0
XP
1
Country
Italy
blink.gif


I've the same problem.
I've brought Samsung S2 Portable 500Gb, and could't format my hd
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
Formating tips:

1.) try "wwt find -l" to see all partitions
2.) select the right partition
3.) use "wwt init /dev/the_right_one --force" for formatting

add game with one of:
Code:
# add all games of 1 directory
wwt -a add source_dir

# add all games of current directory
wwt -a add .

# add all games of an other wbfs partition
wwt -p /dev/dest_wbfs add /dev/source_wbfs

# add a specific game of an other wbfs partition
wwt -p /dev/dest_wbfs add /dev/source_wbfs/ID6

Use "update" instead of "add" to avoid warnings about existing games.

Use "--verbose --verbose" or "-vv" if you want a progress counter.

Define a environment variable "WWT_OPT" with "-vv" if you always wants verbose output.

List WBFS:
Code:
# list the one and only wbfs drive
wwt ll

# list and don't use the title database -> show the internal names
wwt ll -T0

# dump the WBFS data structure completely
wwt dump -ll
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
drh said:
however, I have a local storage of my WDF files and I wondered if I could use the ST command to settitle of the files locally? or does wwt and wit only work with the USB wbfs partition exclusively?
To modify iso images try "wit settitle -s file id6=new_title"

wwt+wit prints always the title of the title database. Try option -T0 to disable the title database.
The command "wwt dump -ll" gives you all infos about the WBFS.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
wwt: Wiimms WBFS Tool v0.21b - 2009-12-13
A command line WBFS tool set for various os.


I have updated the tool. The first post with more details is updated too.

Download:Last changes:
Code:
wwt v0.21a r520 - 2009-12-09

- New command: wwt PHANTOM: add a phantom discs (fast, for tests only).
- libwbfs: I have implemented a little ID6 cache for faster disc access and
ÂÂ less IO when searching discs.
- CYGWIN bug fix: Using mixed reading and writing on files opened with open()
ÂÂ fails and write sometimes to wrong file positions (reproducible).
ÂÂ Switching to fopen() based IO works fine.
- Docu of wwt+wit RENAME+SETTITLE.

wwt v0.21b r524 - 2009-12-13
- Corrections of inline and offline docu.
- New: FAQ.txt (first steps)

Sources comes with GPL2. Checkout the sources directly from the SVN repository or browse the source.

FAQ:
CODE
*******************************************************************************
*******ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ ToolsÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ *********
*******************************************************************************

* What is "WWT"?

ÂÂÂÂ'WWT' is an abbreviation of "Wiimms WBFS Tools". It is a collection of
ÂÂÂÂtools to manipulate and convert WBFS and ISO files.
ÂÂÂÂ

* What is "wwt"?

ÂÂÂÂ'wwt' is an abbreviation of "Wiimms WBFS Tool" (not 'tools'). 'wwt' was the
ÂÂÂÂfirst tool of this tool set. It is developed for manipulationg WBFS files.
ÂÂÂÂThe general syntax is: wwt ... ...
ÂÂÂÂThe importand commands are:
ÂÂÂÂINIT, CHECK, LIST, REPAIR, DUMP, ADD, UPDATE, EXTRACT, RENAME, SETTITLE


* What is "wit"?

ÂÂÂÂ'wit' is an abbreviation of "Wiimms ISO Tool". 'wit' was the main tool for
ÂÂÂÂmanipulating and converting ISO images.
ÂÂÂÂThe general syntax is: wit ... ...
ÂÂÂÂThe importand commands are:
ÂÂÂÂDUMP, LIST, DIFF, COPY, SCRUB, MOVE, RENAME, SETTTILE


* What are 'iso2wdf', 'wdf2iso' and 'iso2wbfs'

ÂÂÂÂThese 2 tools convert ISO and WBFS files to other formats. They have been
ÂÂÂÂdevolped before 'wit' and have an easyer interface. 'wit COPY' can do all
ÂÂÂÂjobs of this three tools too.


* What are 'wdf-cat' and 'wdf-dump'?

ÂÂÂÂ'wdf-cat' and 'wdf-dump' are tools to confirm the WDF-Conversion (see file
ÂÂÂÂ'WDF.txt' for details). 'wdf-cat' copy any files to stdout. WDF files are
ÂÂÂÂconverted. 'wdf-dump' shows the internal data structure of WDF files.


*******************************************************************************
*******ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂGeneral InformationsÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ *********
*******************************************************************************

'wwt' and 'wit' support different commands. Some commands are "read only" and
the other commands modify files and devices.

The "read only" commands of 'wit' scan automatically for partitions. The
"modify" commands needs an explizit subject (WBFS) to change. This subject can
be given with "--part partition" (short: -p) or by enabling the auto search
with option --auto (short: -a). See section "Processing partitions" in file
"wwt.txt" for more information.

All "modify" commands of 'wwt' and 'wit' knows the option --test (short: -t).
If set the programs tells you what they would do.

'wwt' and 'wit' work silently. The option --quiet (short: -q) make them more
quiet. The option --verbose (short: -v) enables more verbose output. You can
use --verbose multiple times for more verbose outputs. Using --verbose at
least 2 times will enable a progress counter.

The environment variables 'WWT_OPT' and 'WIT_OPT' can be used to predifine
options like "-vv". Under Unix decalre them in you local script init file.
Under Windows go to "Setting | Systems Settings | Extended | Environment".


*******************************************************************************
*******ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂFormatting a driveÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ *********
*******************************************************************************

* How do I find the device name of my WBFS?

ÂÂÂÂtry: wwt find -l
ÂÂÂÂIt will print a list of all drives found with additional infos.

* How do I format a device?

ÂÂÂÂFirst: Find aut your drive with: wwt find -l
ÂÂÂÂSecond: Type: wwt format /dev/your_device --force


*******************************************************************************
*******ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂAdding gamesÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ *********
*******************************************************************************

All command are based on the assumption that exact 1 WBFS drive isa connected
to the computer. Only then you can use the option --auto (short: -a). If you
have more than 1 WBFS drive you have to select the subject of change with
tpr option "--part drive". Alternativly you can use the option --all to use
all partitions as subject.

For experiments use the --test option for a dry run wirhout modifications

* How do I add games to a WBFS?

ÂÂÂÂThis command adds the given files to then WBFS. The files can be ISO,
ÂÂÂÂWDF-ISO or other WBFS:
ÂÂÂÂ> wwt -a ADD game_file...

* How can I add all games of a directory?

ÂÂÂÂUse the directory path (or '.' for the current directory) as source
ÂÂÂÂ> wwt -a ADD directory

* How can I add all games of a directory and its subdirectories?

ÂÂÂÂUse the path of the base directory as parameter of the option --recurse
ÂÂÂÂ(short: -r):
ÂÂÂÂ> wwt -a ADD --recurse base_directory

* I get warnings about already existings discs in the WBFS. Can I disable this
ÂÂwarings?

ÂÂÂÂYes, use option --update.
ÂÂÂÂOr use the comamnd 'UPDATE' instead of 'ADD --update'.

* I want to copy all games of a WBFS to an other. Is there a special command?

ÂÂÂÂUse the ADD/UPDATE comamnds in the usual way and give the name of the
ÂÂÂÂsource WBFS as parameter:
ÂÂÂÂ> wwt UPDATE -p dest_wbfs source_wbfs

* I have 2 WBFS drivers. I want to copy all games of WBFS1 to WBFS2 and visa
ÂÂverse. Is this possible?

ÂÂÂÂYes: use both device names as source and destination
ÂÂÂÂ> wwt -p wbfs1 -p wbfs2 UPDATE wbfs1 wbfs2

* I have a directory with games. All games of that directory should be copied
ÂÂto the WBFS. All discs not on that directory should be deleted. Can this
ÂÂbe done with 1 command?

ÂÂÂÂYes: Use the --sync option of add or the comamnd "SYNC":
ÂÂÂÂ> wwt -a SYNC dirctory
 

tomhead

Member
Newcomer
Joined
Dec 12, 2009
Messages
8
Trophies
0
XP
1
Country
Italy
there are my command and the results, i have a Samsung S2 Portable 500Gb

Code:
wwt find -l

typeÂÂwbfs d.usageÂÂÂÂsizeÂÂfile (sizes in MiB)
-----------------------------------------------
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ 57232ÂÂ/dev/sda
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ 57232ÂÂ/dev/sda1
BLOCK WBFSÂÂÂÂÂÂ 0ÂÂ476940ÂÂ/dev/sdb



Code:
wwt init /dev/sdb --force
*****ÂÂwwt: Wiimms WBFS Tool v0.21b r524 cygwin - Dirk Clemens - 2009-12-13ÂÂ***
**
FORMAT BLOCK DEVICE /dev/sdb [466 GiB, sector size 512]
!! wwt: ERROR #16 [WRITE FILE FAILED] in WrapperWriteSector() @ lib-std.c#2690
!!ÂÂÂÂÂÂSeek failed [S=3,7fe200]: /dev/sdb
!!ÂÂÂÂÂÂ-> No space left on device
** 1 file formatted.

Anyone can i help me?
Thanks
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
The problem could be that your drive have no logical partitions. Not Problem for linux, but perhaps a problem for Windows (and for USB loaders)

Possible solution:
1.) Format the drive with ntfs/fat
2.) format the new logical partition (/dev/sdb1) as WBFS

-- OR --

No write access to /dev/sdb


EDIT:
It seems that libwbfs did not tell the caller about the write error while formatting. A next little bug.
 

drh

Well-Known Member
Newcomer
Joined
Nov 14, 2009
Messages
76
Trophies
0
XP
81
Country
Awesome Wiimm.

By the way the wit settitle command worked great, it confused me because with wwt I use ST to change the name of the (remote) file on the device by just defining the ID="name" where-as with wit, I have to use that also prceeded by the actual local file name.

Everytime I got a disc with a strange name or all in capitals etc, I added a wwt st command line to a script file I ran against the drive (to correct all the names). I no longer need to do this now I have physically changed the source file :-)
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
@drh:
Have you ever testet:

Code:
wit -s dir settitle +=%t --test
or after adding to WBFS:

Code:
wwt -a settitle --wbfs +=%t --test
The later one do not modify the iso images but only WBFS header.
 

tomhead

Member
Newcomer
Joined
Dec 12, 2009
Messages
8
Trophies
0
XP
1
Country
Italy
Wiimm said:
The problem could be that your drive have no logical partitions. Not Problem for linux, but perhaps a problem for Windows (and for USB loaders)

Possible solution:
1.) Format the drive with ntfs/fat
2.) format the new logical partition (/dev/sdb1) as WBFS

-- OR --

No write access to /dev/sdb


EDIT:
It seems that libwbfs did not tell the caller about the write error while formatting. A next little bug.

it's the same:

CODEwwt find -l

typeÂÂwbfs d.usageÂÂÂÂsizeÂÂfile (sizes in MiB)
-----------------------------------------------
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ152628ÂÂ/dev/sda
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ152617ÂÂ/dev/sda1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ476940ÂÂ/dev/sdb
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ249996ÂÂ/dev/sdb1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ226934ÂÂ/dev/sdb2


wwt init /dev/sdb1 --force

*****ÂÂwwt: Wiimms WBFS Tool v0.21b r524 cygwin - Dirk Clemens - 2009-12-13ÂÂ***
**
FORMAT BLOCK DEVICE /dev/sdb1 [244 GiB, sector size 512]
!! wwt: ERROR #16 [WRITE FILE FAILED] in WrapperWriteSector() @ lib-std.c#2690
!!ÂÂÂÂÂÂSeek failed [S=3,3fe000]: /dev/sdb1
!!ÂÂÂÂÂÂ-> No space left on device
** 1 file formatted.
 

drh

Well-Known Member
Newcomer
Joined
Nov 14, 2009
Messages
76
Trophies
0
XP
81
Country
Wow, I wish I knew about that command before, that would have saved a lot of time!

I would have only needed to do a small amount of work to fix the titles after that.
e.g.
- WOULD Modify [RFFPGD] ./Final Fantasy Echos of Time [RFFPGD].wdf
- WOULD Set title to `FFCC EOT'
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
tomhead said:
it's the same:

Code:
wwt find -l

typeÂÂwbfs d.usageÂÂÂÂsizeÂÂfile (sizes in MiB)
-----------------------------------------------
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ152628ÂÂ/dev/sda
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ152617ÂÂ/dev/sda1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ476940ÂÂ/dev/sdb
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ249996ÂÂ/dev/sdb1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ226934ÂÂ/dev/sdb2


wwt init /dev/sdb1 --force

*****ÂÂwwt: Wiimms WBFS Tool v0.21b r524 cygwin - Dirk Clemens - 2009-12-13ÂÂ***
**
FORMAT BLOCK DEVICE /dev/sdb1 [244 GiB, sector size 512]
!! wwt: ERROR #16 [WRITE FILE FAILED] in WrapperWriteSector() @ lib-std.c#2690
!!ÂÂÂÂÂÂSeek failed [S=3,3fe000]: /dev/sdb1
!!ÂÂÂÂÂÂ-> No space left on device
** 1 file formatted.
After writing the WBFS header (offset=0) the programm seeks to offset 3fe000 to write the free blocks table. And this seek fails, I don't know why ???

Have you run wwt in admin mode?
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
drh said:
Wow, I wish I knew about that command before, that would have saved a lot of time!

I would have only needed to do a small amount of work to fix the titles after that.
e.g.
- WOULD Modify [RFFPGD] ./Final Fantasy Echos of Time [RFFPGD].wdf
- WOULD Set title to `FFCC EOT'
There are more escape sequences. See doc for command SETTITLE for details.
 

tomhead

Member
Newcomer
Joined
Dec 12, 2009
Messages
8
Trophies
0
XP
1
Country
Italy
Wiimm said:
tomhead said:
it's the same:

Code:
wwt find -l

typeÂÂwbfs d.usageÂÂÂÂsizeÂÂfile (sizes in MiB)
-----------------------------------------------
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ152628ÂÂ/dev/sda
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ152617ÂÂ/dev/sda1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ476940ÂÂ/dev/sdb
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ249996ÂÂ/dev/sdb1
BLOCKÂÂ--ÂÂÂÂÂÂÂÂ0ÂÂ226934ÂÂ/dev/sdb2


wwt init /dev/sdb1 --force

*****ÂÂwwt: Wiimms WBFS Tool v0.21b r524 cygwin - Dirk Clemens - 2009-12-13ÂÂ***
**
FORMAT BLOCK DEVICE /dev/sdb1 [244 GiB, sector size 512]
!! wwt: ERROR #16 [WRITE FILE FAILED] in WrapperWriteSector() @ lib-std.c#2690
!!ÂÂÂÂÂÂSeek failed [S=3,3fe000]: /dev/sdb1
!!ÂÂÂÂÂÂ-> No space left on device
** 1 file formatted.
After writing the WBFS header (offset=0) the programm seeks to offset 3fe000 to write the free blocks table. And this seek fails, I don't know why ???

Have you run wwt in admin mode?

yes, i have run in admin mode
 

mousex

Well-Known Member
Member
Joined
Jan 23, 2009
Messages
986
Trophies
0
XP
115
Country
United States
I used your wit to create sparse Isos for my ntfs drive and it worked well from a NTFS formatted SD card in card reader in cfg loader (only tested smaller games yet, I'll check the fragmentation when the other/big games finished). I hope it doesn't fragment sparse files as much as wbfs_file.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
mousex said:
I used your wit to create sparse Isos for my ntfs drive and it worked well from a NTFS formatted SD card in card reader in cfg loader (only tested smaller games yet, I'll check the fragmentation when the other/big games finished). I hope it doesn't fragment sparse files as much as wbfs_file.
"wit copy" writes the iso output files (wdf and plain iso) linear. Only the header of a wdf is rewritten.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Sonic Angel Knight @ Sonic Angel Knight: :blink: