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
@tiimothy

"insn" names the inline functionality of gcc.

Please try:
Code:
XFLAGS=-fno-inline-functions make 

# you can check all flags with
XFLAGS=-fno-inline-functions make flags
 

frank01liny

Member
Newcomer
Joined
Feb 18, 2010
Messages
12
Trophies
0
XP
3
Country
United States
Wiimm said:
wwt: Wiimms WBFS Tool v0.32a - 2010-02-14
A command line WBFS tool set for various os.


Last changes:
Code:
wwt v0.32a r632 - 2010-02-14

- wwt+wit: New envrionment variable: WWT_LANG: Define a default language.
- wwt+wit: New option: --lang= : Define the working language.
- wwt FORMAT --recover: Little optimizations.
- Bug fix: Enable cache for all commands if reading from a pipe.

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

I have a question about the --recover command. If the WBFS partition size is incorrect because of corruption before using your util (larger than it should be) would it know to make it smaller without damaging adjecent partitions that arent WBFS formatted. (would it compensate for incorrect block size? would it know the correct end of the partition?)
Here's my situation: I accidently changed the size of my WBFS partition (on a drive with multiple partitions, i selected the wrong partition. the WBFS partition is the first partition on the drive, versus my second partition which isnt WBFS) and made it smaller using norton partition magic 8. I dont mind keeping the smaller size but other tools that I have been using (I havent tried your yet) they are unable to detect the WBFS partition or the data on it and I would rather just correct the WBFS header, etc without having to force copy all of my files off the WBFS partition to another drive
Can I use one of the other commands for your util instead?
Any help would be appreciated.
 

Wiimm

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

No, recover will not work for you.
The only info about the geometry comes from bytes 4-9:

Code:
typedef struct wbfs_head
{
ÂÂÂÂbe32_t magic;ÂÂÂÂ// the magic (char*)"WBFS"

ÂÂÂÂ// the 3 main parameters -> they are used to calculate the geometry

ÂÂÂÂbe32_t n_hd_sec;ÂÂÂÂ// total number of hd_sec in this partition
ÂÂÂÂu8ÂÂhd_sec_sz_s;ÂÂÂÂ// sector size in this partition
ÂÂÂÂu8ÂÂwbfs_sec_sz_s;ÂÂÂÂ// size of a wbfs sec

ÂÂÂÂ....
}

It should be possible to scan the drive and make a guess, but perhaps it is easier to make this manually.

Ideas to find the wbfs block size:
- Find the DISC magic 0x5D1C9EA3
There should be 2 series: 1.) the inodes (in the first block) 2.) the disc headers (=>WBFS block size)
 

frank01liny

Member
Newcomer
Joined
Feb 18, 2010
Messages
12
Trophies
0
XP
3
Country
United States
Wiimm said:
It should be possible to scan the drive and make a guess, but perhaps it is easier to make this manually.

Ideas to find the wbfs block size:
- Find the DISC magic 0x5D1C9EA3
There should be 2 series: 1.) the inodes (in the first block) 2.) the disc headers (=>WBFS block size)


I have more supporting info for my situation

in norton partition magic 8, my WBFS partition properties is now
First physical sector 63 cyl 0 hd 1 sect 1 (I believe this did not change)
Last physical sector 911,174,669 cyl 56717 hd 254 sect 63 (I believe this was decreased)
total physical sectors 911,174,607 = 444,909.5 mb (previously it was around 444,940.?? mb)

The properties for the second partition (NTFS) is now
first physical sector 911,174,733 cyl 56718 hd 1 sect 1

sector 63 starts with the following
57 42 46 53 36 50 66 D3 09 17 00 00 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 00 00 00 00 00 00 00 00 00 00

so what should my WBFS header be set/changed to based on the numbers above?
 

tiimothy

New Member
Newbie
Joined
Feb 17, 2010
Messages
4
Trophies
0
XP
1
Country
Wiimm said:
@tiimothy

"insn" names the inline functionality of gcc.

Please try:
Code:
XFLAGS=-fno-inline-functions make 

# you can check all flags with
XFLAGS=-fno-inline-functions make flags

Will try this when I get a moment. Thanks!

Tim.
 

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.33a - 2010-03-01
A command line WBFS tool set for various os.


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

Download:Highlights/bug fixes of this release:
  • The WBFS inode has a space of 128 bytes for additinal information. I used this to store timestamps (itime, mtime, ctime, atime) and more. The base idea is described here.

    Some details for timestamps:
    .
    • The 'itime' is the insertion time.
      The insertion time is set only after adding a game to the WBFS.
    • The 'mtime' is the last modification time.
      While adding a disc it is copied from the source. Changing title or ID in the ISO header will update mtime. When extracting a ISO the mtime of the destiantion file is set to this value.
    • The 'ctime' is the last status change time.
      The status change time is set after adding a game or changing the ID or the title.
    • The 'atime' is the last access time.
      It is set when ctime is set or when extracing is finished.
    .
  • The wit+wwt command LIST print one timestamp. The options --itime, --mtime, --ctime, --atime and --time=modelist deceide which time is used the output format.
    Extract of the docu:

    Printing of timestamps is enabled by the options --time, --itime, --mtime
    --ctime, --atime or when --long is set at least twice. --time=off disables
    time printing. All time options (not --long) supersede the previous options.
    The option --time take a comma separated list of the following keywords:

    OFF : Disable time printing. All other option enable time printing.
    ON : Enable time printing.

    I : Use itime (insertion time) for processing.
    M : Use mtime (last modicifaction time) for processing. (default)
    C : Use ctime (last staus change time) for processing.
    A : Use atime (last access time) for processing.

    DATE : Print time in format 'YYYY-MM-DD'. (default)
    TIME : Print time in format 'YYYY-MM-DD HH:MM'.
    MIN : Alternative keyword for 'TIME'.
    SEC : Print time in format 'YYYY-MM-DD HH:MM:SS'.

    *DATE : Short cut for '*,DATE'. '*' is one of 'I', 'M', 'C' or 'A'.
    *TIME : Short cut for '*,TIME'. '*' is one of 'I', 'M', 'C' or 'A'.
    *MIN : Alternative keywords for '*TIME'.
    *SEC : Short cut for '*,SEC'. '*' is one of 'I', 'M', 'C' or 'A'.

    .
  • The sort option --sort accepts the new keywords 'DATE' and 'TIME' for sorting by date and 'ascending', 'descending' or 'reverse' to controll the main sort direction.
    .
Last changes:
Code:
wwt v0.32a r632 - 2010-02-14

- wwt+wit: New environment variable: WWT_LANG: Define a default language.
- wwt+wit: New option: --lang= : Define the working language.
- wwt FORMAT --recover: Little optimizations.
- Bug fix: Enable cache for all commands if reading from a pipe.

wwt v0.33a r659 - 2010-03-01

- Support of the new extended WBFS inodes with the data records
ÂÂ 'itime', 'mtime', 'ctime', 'atime' and 'load_count'.
ÂÂÂÂ- ADD updates itime, mtime, ctime and atime. mtime is taken from source.
ÂÂÂÂ- EXTRACT updates atime. mtime is copied to destination file.
ÂÂÂÂ- RENAME+SETTILE @INODE updates ctime and atime.
ÂÂÂÂ- RENAME+SETTILE @ISO updates mtime, ctime and atime.
ÂÂÂÂ- LIST may show one of the time values (-ll, --*time, --time=mode)
ÂÂÂÂ- DUMP show all times if disc dump is enabled (--long).
- wit+wwt LIST: The new options --itime, --mtime, --ctime, --atime 
ÂÂ and --time=modelist will force output of a time stamp. The meaning
ÂÂ of --long is changed.
- Option --sort= supports new modes 'DATE', 'ASCENDING' and 'DESCENDING'.
- New wwt command: LIST-LL or LLL: Abbreviation of 'LIST -ll'.
- New wit command: LIST-LLL or LLLL: Abbreviation of 'LIST -lll'.
- Bug fix: wit LIST: The WBFS file size was listed instead the ISO size.

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

OOPMan

Active Member
Newcomer
Joined
Mar 20, 2007
Messages
39
Trophies
0
XP
75
Country
Thanks for making this tool Wimm. I was constantly irritated by the need to boot into windows running in virtualbox in order to transfer games to and from wbfs until I found your tool. Now, a short shell script later, I have all my wbfs needs covered :-)

Keep up the good work man.
 

Skeeve

Well-Known Member
Newcomer
Joined
Jan 1, 2010
Messages
75
Trophies
0
XP
146
Country
Gambia, The
Hi!

I'm trying to copy everything from my wbfs partition to a Fat32 partition:
Code:
wit copy /dev/disk6s1 -d /Volumes/WIISTUFF/wbfs/ --wbfs --split -P

Seems to work, but what puzzles me are these messages:
Code:
!! wit: ERROR #15 [READ FILE FAILED] in WrapperReadSector() @ lib-std.c#2654
!!ÂÂÂÂÂÂRead failed [F=4,200+2600]: /Volumes/WIISTUFF/wbfs/.RSPP01.wbfs.a9o2aM
!!ÂÂÂÂÂÂ-> Bad file descriptor
[...]
!! wit: ERROR #15 [READ FILE FAILED] in WrapperReadSector() @ lib-std.c#2654
!!ÂÂÂÂÂÂRead failed [F=4,200+2600]: /Volumes/WIISTUFF/wbfs/.RMCP01.wbfs.CqI42s
!!ÂÂÂÂÂÂ-> Bad file descriptor
Do I have to worry?
 

Skeeve

Well-Known Member
Newcomer
Joined
Jan 1, 2010
Messages
75
Trophies
0
XP
146
Country
Gambia, The
I copied every wbfs to the Fat32 partition.

cfg-usb-loader shows all of them.

But when I try to start a game I get "wbfs error: bad magic".

So I think something went wrong with the copy.

Fixed: I updated wwt (to copy), copied again and now it works.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
@Skeeve
It looks like an already fixed error. Which version have you used?

The error is, that libwbfs read data that is not yet available (reading behind end of file because the file is growing).
 

drh

Well-Known Member
Newcomer
Joined
Nov 14, 2009
Messages
76
Trophies
0
XP
81
Country
Hi Wiimm,
Long time no speak, still using the tools, excellent, updated to latest version at the weekend before doing a large copy, complied perfectly without any errors on macosx :-)

Out of interest, I am using the WD Passport drive which is known to work reliably on the Wii through USB Power only. I know this drive is a modified 2.5" drive too with USB directly on the drive interface, no conversion board or anything. Is the speed of this process detrimented by a number of factors like the WBFS format and USB speed etc?

This copy has taken 2 days.

Regs
D.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
I use the WD Passport too. With a small NAS (Linux, Nemiah CPU 1GHz) my copy rate is about 25 MiB/s. With WinXP and a much faster Computer the rate is about 22 MiB/s.

The WD Passport is the faster than all my other USD drives including a new 3.5" drive.
 

grrkodiak

Well-Known Member
Newcomer
Joined
Nov 14, 2009
Messages
72
Trophies
0
XP
49
Country
Canada
Something went wrong with my WBFS partition. Can someone help me with a step by step solution for computer illiterate person

Thanks
 

drh

Well-Known Member
Newcomer
Joined
Nov 14, 2009
Messages
76
Trophies
0
XP
81
Country
Wiimm said:
I use the WD Passport too. With a small NAS (Linux, Nemiah CPU 1GHz) my copy rate is about 25 MiB/s. With WinXP and a much faster Computer the rate is about 22 MiB/s.

The WD Passport is the faster than all my other USD drives including a new 3.5" drive.

Is that megabits per second, how long would that take you to do 1tb's worth of data?

I'm not very good at these things.

Let see if I make a complete mess of it :-)

So 22 MegaBits per second = 157.35 MegaBytes per Minute (according to online calculator)

1TB = 1048576 MegaBytes

1048576 MegaBytes divided by 157.35 MegaBytes per Minute = 6,664 Minutes

6,664 Minutes divided by 60 = 111 Hours

111 Hours divided by 24 = 4.6 Days
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Psionic Roshambo @ Psionic Roshambo: The Castlevania game was on the PS1 so that's cool +1