Hacking WBFUSE (WBFS for FUSE)

HaTaX

Well-Known Member
Member
Joined
Mar 4, 2007
Messages
171
Trophies
0
XP
294
Country
United States
With this package working out so well I'm surprised we don't see an overflow of GUI based apps for the X11 windowing system.... Would be a snap to put together a gui to manage a WBFS drive in linux now.
 

derek.mf

Member
Newcomer
Joined
Apr 21, 2009
Messages
5
Trophies
0
XP
7
Country
France
HaTaX said:
With this package working out so well I'm surprised we don't see an overflow of GUI based apps for the X11 windowing system.... Would be a snap to put together a gui to manage a WBFS drive in linux now.

Now that the WBFS partition can be used as any other filesystem, why linux users would need a GUI app ?
smile.gif

Actually, I was working on a Java GUI when I found this package (I was looking for C code to transfer game from one wbfs partition to another), to have a GUI working on Linux and any other OS having a JVM... But now, I think I'm gonna stop
wink.gif
 

redact

‮҉
Member
Joined
Dec 2, 2007
Messages
3,161
Trophies
0
Location
-
XP
674
Country
Mauritania
i'm probably asking way too much here but is it possible to make a version of this which is compatible with Dokan so noobs like me can use it?
(i tried yours in a live disk of kubuntu i had and it lets me read the iso files but not write to the drive)
 

derek.mf

Member
Newcomer
Joined
Apr 21, 2009
Messages
5
Trophies
0
XP
7
Country
France
derek.mf said:
Hi,

Firstly, thanks for your great work, it is very useful and so more intuitive than any "GUI" or command line tool (even if, as a Linux user, command line is not a problem
wink.gif
).

But (sorry, there is a "but"), I found a bug.

I explain you all I made and the context :

Distribution : Fedora Core 9.
WBFuse version used : "wbfuse_0_8_2b_i386"
Installation :
- All binaries are owned by root.
- I set the SUID on the binaries (root #> chmod u+s *)
-----------------------------------------------------------------------
Mount command used : ./wbfuse /dev/sdb1 $HOME/wbfs_part
Initializing WBFS Partition...
Number of files found: 2
OK
Image scrubbing enabled (all partitions).
Wii ISO found: Call of Duty (Wii) UK/FR [RVYP52].iso
Wii ISO found: Okami [ROWP08].iso
-----------------------------------------------------------------------

But when I make :

-----------------------------------------------------------------------
ls -l ~/wbfs_part
ls: ne peut accéder /home/me/wbfs_part/Call of Duty (Wii) UK/FR [RVYP52].iso: Aucun fichier ou dossier de ce type
total 0
-????????? ? ? ? ? ? Call of Duty (Wii) UK/FR [RVYP52].iso
-rw-rw-rw- 1 me me 4699979776 déc 8 2006 Okami [ROWP08].iso
-----------------------------------------------------------------------

The error message could be translated as :
ls: cannot access /home/me/wbfs_part/Call of Duty (Wii) UK/FR [RVYP52].iso: No such file or directory
The file does not appear in nautilus.

Is it due to the game name ?
I use my external hdd on my Wii with USB Loader v1.1 and this game is found and can be launched without problems.

I will try to have a look at your code but if you can try to fix this, would be great
wink.gif


One more time, thanks a lot for your work.

derek.mf

Hi,

I tried to fix the bug and it is the "/" character that causes the problem.
I made this function (it is probably bad C code but I'm a Java developer) :

CODEstatic char* replaceFuckingBadCharacters(char* a_string) {

ÂÂÂÂint str_size = strlen(a_string);
ÂÂÂÂint i;
ÂÂÂÂchar* result = malloc(sizeof(char) * str_size);
ÂÂÂÂ
ÂÂÂÂfor (i = 0; i < str_size; i++) {
ÂÂÂÂÂÂÂÂif ( a_string == '/' ) {
ÂÂÂÂÂÂÂÂÂÂÂÂresult = '\\';
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂÂÂÂÂelse {
ÂÂÂÂÂÂÂÂÂÂÂÂresult = a_string;
ÂÂÂÂÂÂÂÂ}
ÂÂÂÂ}
ÂÂÂÂ
ÂÂÂÂfprintf(stderr, "Result is : %s", result);

ÂÂÂÂreturn result;
ÂÂÂÂ
}

Then, I changed the "initFuseWbfs" function :

old code :
Code:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (!v) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(discinfo->title_filename, "%s [%s].iso", discinfo->title_name, discinfo->title_id);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ} else {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//sprintf(discinfo->title_filename, "NOTWii_%s", discinfo->title_name);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(discinfo->title_filename, "%s", discinfo->title_name);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}

new code :
Code:
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ if (!v) {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(discinfo->title_filename, "%s [%s].iso", replaceFuckingBadCharacters(discinfo->title_name), discinfo->title_id);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ} else {
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ//sprintf(discinfo->title_filename, "NOTWii_%s", discinfo->title_name);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂsprintf(discinfo->title_filename, "%s", discinfo->title_name);
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ}

It seems to work :
Code:
ll ~/wbfs_part/
total 0
-rw-rw-rw- 1 me me 4699979776 2006-12-08 01:00 Call of Duty (Wii) UK\FR [RVYP52].iso
-rw-rw-rw- 1 me me 4699979776 2006-12-08 01:00 Okami [ROWP08].iso
but I suppose it can cause problems in the "renameFile" function because, even if it is not wanted, the "/" character will be replaced by the "\". Maybe, the "renameFile" function should make the inverse conversion ("\" --> "/").
I don't want to make the test because my "replaceFuckingBadCharacters" function seems to have bug. At first, I tried to use it in the "readDirectory" function but, each time I was calling "ls -l" in the mounted directory, a new character was added to the file name :

exemple of first call :
Code:
ll ~/wbfs_part/
total 0
-rw-rw-rw- 1 me me 4699979776 2006-12-08 01:00 Call of Duty (Wii) UK\FR [RVYP52].iso
-rw-rw-rw- 1 me me 4699979776 2006-12-08 01:00 Okami [ROWP08].iso

exemple of second call :
CODEll ~/wbfs_part/
total 0
-rw-rw-rw- 1 me me 4699979776 2006-12-08 01:00 Call of Duty (Wii) UK\FR [RVYP52].isoo
-rw-rw-rw- 1 me me 4699979776 2006-12-08 01:00 Okami [ROWP08].isoo


I hope it will help you !

derek.mf
 

foobar

Member
Newcomer
Joined
Nov 13, 2006
Messages
20
Trophies
1
XP
82
Country
Yeah, that function will likely cause a memory leak. Your best option is to mangle the original string. Here's an attempt that uses the c strchr function to locate characters.

Caveat emptor: totally untested.
edit: noticed bug and fixed it. told ya, and there are probably many more.

Code:
//define replacement char here
#define GOODCHAR '.'

void replaceFuckingBadCharacters(const char* a_string) {
ÂÂchar * badchar=strchr(a_string,(int)'/');
ÂÂwhile(badchar!=NULL){
ÂÂÂÂ(*badchar)=GOODCHAR;
ÂÂÂÂbadchar=strchr(a_string,(int)'/');
ÂÂ}
}
 

wishmasterf

Well-Known Member
Member
Joined
Apr 20, 2009
Messages
167
Trophies
0
Location
Austria
Website
Visit site
XP
92
Country
Australia
First of all thanks for your realy good work!

I own a 1TB USB HDD. There is only 1 Partition with 1 TB with wbfs filesystem. I do have over 200 Wii Games on my disk, but only the first 100 are displayed
when unsing 'ls' or an Filbrowser like konqueror.

It would be nice if anyone could fix this problem.
 

dajavax

Well-Known Member
Member
Joined
Oct 29, 2008
Messages
278
Trophies
0
Age
32
Location
Monterrey
Website
www.dajavax.tk
XP
194
Country
Mexico
"Initializing WBFS Partition...
ERROR: Invalid WBFS partition."

frown.gif


maybe it's the fact i'm using an ipod as the WBFS disk... with no other partition only WBFS (i deleted the system partition)... ubuntu shows a "USB Drive" with an iPod image as an icon but when i click eject it tells me there's no media in the drive... would this be the problem?... any way to solve it?
 

derek.mf

Member
Newcomer
Joined
Apr 21, 2009
Messages
5
Trophies
0
XP
7
Country
France
dajavax said:
"Initializing WBFS Partition...
ERROR: Invalid WBFS partition."

frown.gif


maybe it's the fact i'm using an ipod as the WBFS disk... with no other partition only WBFS (i deleted the system partition)... ubuntu shows a "USB Drive" with an iPod image as an icon but when i click eject it tells me there's no media in the drive... would this be the problem?... any way to solve it?

Does it work on your Wii ?

Posts merged

foobar said:
Yeah, that function will likely cause a memory leak. Your best option is to mangle the original string. Here's an attempt that uses the c strchr function to locate characters.

Caveat emptor: totally untested.
edit: noticed bug and fixed it. told ya, and there are probably many more.

CODE//define replacement char here
#define GOODCHAR '.'

void replaceFuckingBadCharacters(const char* a_string) {
ÂÂchar * badchar=strchr(a_string,(int)'/');
ÂÂwhile(badchar!=NULL){
ÂÂÂÂ(*badchar)=GOODCHAR;
ÂÂÂÂbadchar=strchr(a_string,(int)'/');
ÂÂ}
}

Thanks for the help but.... Why a memory leak ? because of the malloc without being able to free the memory, I suppose ?
 

dajavax

Well-Known Member
Member
Joined
Oct 29, 2008
Messages
278
Trophies
0
Age
32
Location
Monterrey
Website
www.dajavax.tk
XP
194
Country
Mexico
derek.mf said:
dajavax said:
"Initializing WBFS Partition...
ERROR: Invalid WBFS partition."

frown.gif


maybe it's the fact i'm using an ipod as the WBFS disk... with no other partition only WBFS (i deleted the system partition)... ubuntu shows a "USB Drive" with an iPod image as an icon but when i click eject it tells me there's no media in the drive... would this be the problem?... any way to solve it?

Does it work on your Wii ?
yes it does... and same for every other WBFS manager... linux ones or windows ones... just found this one out and decided it was a great idea so i decided to try it but that's what happens... (i was using ubuntu intrepid btw... but just updated to jaunty so i might try again)
 

dajavax

Well-Known Member
Member
Joined
Oct 29, 2008
Messages
278
Trophies
0
Age
32
Location
Monterrey
Website
www.dajavax.tk
XP
194
Country
Mexico
just tried with jaunty... get the same result... but it doesn't appear as an ipod now though

SpAM_CAN said:
Would this work with Mac FUSE? Probably not...
biggrin.gif
yes it should
tongue.gif


EDIT: ohh another thing... it appears in fdisk as "W95 FAT32 (LBA)" in the format... maybe that could also be the issue...
 

Blue-K

No right of appeal.
Member
Joined
Jun 21, 2008
Messages
2,572
Trophies
0
Location
Helvetica
XP
209
Country
Swaziland
torito21 said:
Version 0.8 released.

Changelog:
* Minor bug fixes.
* Added an option to scrub images (-s option)
* Added an option to scrub previously written to the partition (rename to "scrub"(without quotes)).

Thanks for the bug reports.

About the mac port... I don't have a Mac xD
OSX86
tongue.gif
.

Anyways, this is exactly what I need, but unfortunately, I have some problems...It took me realy long to find out how to install the libfuse-dev package and change USE_USE_VERSION to 26, but I managed it somehow to do all this correctly (I'm using Jaunty btw)...next thing: I went to GParted, and searched for my USB-HD which has two Partitions (FAT32 & WBFS). Found the Game Partition, which turned out to be /dev/sdb2...Now I go to terminal, drag the wbfuse there, and add the lines like described...and now I fail always...
frown.gif


I tried:
$ '/wbfuse/wbfuse' /dev/sdb2 mount_point [-n]
$ '/wbfuse/wbfuse' /dev/sdb2 [-n]
$ '/wbfuse/wbfuse' /dev/sdb2 mount_point -n
$ '/wbfuse/wbfuse' /dev/sdb2 -n
$ '/wbfuse/wbfuse' /dev/sdb2 mount_point
$ '/wbfuse/wbfuse' /dev/sdb2
etc...

All I get is the Instructions Screen and/or a:

"Initializing WBFS Partition...
ERROR: Invalid WBFS partition."

What goes wrong? The Partition works perfect with the Windows-Tools and the USBLoader...Can somebody please help me
frown.gif
? I realy want this...

Thanks in Advance....
 

lexlth

Well-Known Member
Newcomer
Joined
Mar 16, 2009
Messages
95
Trophies
0
XP
29
Country
Brazil
Excelent work !!!!!

Downloaded the last version and it worked at once !

Btw... .how do I umount the partition ???
 

pepperoni

Well-Known Member
Newcomer
Joined
Apr 11, 2009
Messages
87
Trophies
0
XP
4
Country
Any chance of a version that incorporates Hermes' .ciso file extension, so you can access the 'scrubbed' iso files?
 

dajavax

Well-Known Member
Member
Joined
Oct 29, 2008
Messages
278
Trophies
0
Age
32
Location
Monterrey
Website
www.dajavax.tk
XP
194
Country
Mexico
Blue-K said:
torito21 said:
Version 0.8 released.

Changelog:
* Minor bug fixes.
* Added an option to scrub images (-s option)
* Added an option to scrub previously written to the partition (rename to "scrub"(without quotes)).

Thanks for the bug reports.

About the mac port... I don't have a Mac xD
OSX86
tongue.gif
.

Anyways, this is exactly what I need, but unfortunately, I have some problems...It took me realy long to find out how to install the libfuse-dev package and change USE_USE_VERSION to 26, but I managed it somehow to do all this correctly (I'm using Jaunty btw)...next thing: I went to GParted, and searched for my USB-HD which has two Partitions (FAT32 & WBFS). Found the Game Partition, which turned out to be /dev/sdb2...Now I go to terminal, drag the wbfuse there, and add the lines like described...and now I fail always...
frown.gif


I tried:
$ '/wbfuse/wbfuse' /dev/sdb2 mount_point [-n]
$ '/wbfuse/wbfuse' /dev/sdb2 [-n]
$ '/wbfuse/wbfuse' /dev/sdb2 mount_point -n
$ '/wbfuse/wbfuse' /dev/sdb2 -n
$ '/wbfuse/wbfuse' /dev/sdb2 mount_point
$ '/wbfuse/wbfuse' /dev/sdb2
etc...

All I get is the Instructions Screen and/or a:

"Initializing WBFS Partition...
ERROR: Invalid WBFS partition."

What goes wrong? The Partition works perfect with the Windows-Tools and the USBLoader...Can somebody please help me
frown.gif
? I realy want this...

Thanks in Advance....
exactly the description of what happens to me... kind off... and i actually put a mount point and not "mount_point"
 

tingamangal

New Member
Newbie
Joined
Apr 28, 2009
Messages
1
Trophies
0
XP
1
Country
United States
METZElmaennchen said:
Just added a little udev rule and it gets mounted on the fly when I plugin the drive.
Would you mind sharing how you did that?

I tried searching for a how-to to using udev, but it seems complicated.

Thanks.
 

dlukz

New Member
Newbie
Joined
May 1, 2009
Messages
4
Trophies
0
XP
30
Country
United States
I'm confused. I ran "wbfs add gamename.iso" and it goes through converting the game(i think) but it doesn't put it on the wbfs partition I created? is there something else I have to do? when I do "wbfs ls" it displays

# wbfs ls > temp
using /dev/sde
RBRE5G Blast Works 1.39G
RYWE01 Big Brain Academy: Wii Degree 0.92G
RNZE69 Ninja Reflex 0.42G
RBKE69 Spielberg | EA BoomBlox 1.31G
ROXE20 Order Up! 2.07G
RM8E01 Mario Party 8 1.36G
RLGE64 LEGO Star Wars 2.97G
RCPE18 KORORINPA 0.23G
RDHE78 Destroy All Humans: Big Willy Unleashed 3.60G
RRBE41 Rayman Raving Rabbids 1.50G
R3PEWR SPEED RACER 2.14G
R4QE01 Mario Strikers Charged 1.84G
ROWE08 Okami 3.56G
RHAE01 PARTY PACK for REVOLUTION 0.09G
RSXP69 SSX Wii 1.04G
RMCE01 MarioKartWii 2.59G
RBTE8P SEGA BASS FISHING 0.75G
R42E69 The Sims 2 Castaway 1.19G
RB4E08 resident evil 4 Wii edition (E) 3.97G
R8PE01 SUPER PAPER MARIO 0.40G
RHTE54 MANHUNT 2 3.36G
RWME78 Worms : A Space Oddity 0.47G
RGLE7D gwgalaxieswii 0.36G
RFBE01 ENDLESS OCEAN 0.89G
RB7E54 Bully: Scholarship Edition 3.29G
RPKE52 WSOP: ToC 1.67G
RC2E78 Cars Mater-National 3.25G
RWCE4Z RVL- RWCE 0.69G
RCDE52 COD3 US 3.62G
RK8E54 MAJOR LEAGUE BASEBALL 2K8 2.95G
RZDE01 The Legend of Zelda Twilight Princess 1.08G
RELEA4 Elebits 3.13G
RTZE08 Zack and Wiki: Quest for Barbaros' Treasure 1.95G
RWSE8P MARIO & SONIC At The OlympicGames 2.10G

I tried copying them over to the wbfs partition but i get

# ls -lsath /media/wbfuse/
total 4.0K
4.0K drwxr-xr-x 14 root root 4.0K 2009-05-01 00:14 ..
0 drw-rw-rw- 2 root root 2.4G 2006-12-07 16:00 .
0 -rw-rw-rw- 1 root root 4.4G 2006-12-07 16:00 Elebits [RELEA4].iso
0 -rw-rw-rw- 1 root root 4.4G 2006-12-07 16:00 PARTY PACK for REVOLUTION [RHAE01].iso
0 -rw-rw-rw- 1 root root 4.4G 2006-12-07 16:00 SEGA BASS FISHING [RBTE8P].iso

so it looks like it's doing something right. It automatically renames the ISO to the game name with the game code in [ ]'s, but they are still 4.3gigs
 

foobar

Member
Newcomer
Joined
Nov 13, 2006
Messages
20
Trophies
1
XP
82
Country
derek.mf said:
Thanks for the help but.... Why a memory leak ? because of the malloc without being able to free the memory, I suppose ?
Exactly. The function does return the pointer, so you'd have to call free() on the return value later. But since it is immediately passed as a function parameter, the pointer goes out of scope and there's no way to free the memory.

One solution would be to store the result to a char* and call free() on it after you're done. It'd look something like:
Code:
char* foo=replaceFuckingBadChars(string);
//call functions with foo or otherwise make use of it
free(foo);

Malloc and free are pretty slow. As long as modifying the original string doesn't break anything or actually cause the file to be renamed, it's a faster option.

I may play with this more after exams are over.

lexlth said:
Btw... .how do I umount the partition ???
I've seen issues with umount and fuse before. Possibly related to this bug: https://bugs.launchpad.net/ubuntu/+source/s...use/+bug/243298

The workaround is to use the following instead of the gui right click menu or "umount"
CODE
fusermount -u /path/to/mountpoint
 

nl255

Well-Known Member
Member
Joined
Apr 9, 2004
Messages
3,000
Trophies
2
XP
2,795
Country
pepperoni said:
Any chance of a version that incorporates Hermes' .ciso file extension, so you can access the 'scrubbed' iso files?

Won't happen unless Hermes releases his source code or other documentation on the file format. I suppose it could be reverse engineered but that will take quite a bit of time, even if no anti-reversing code is involved.
 

Slimmmmmm

GBAtemp MoNkEeE
Member
Joined
Nov 1, 2007
Messages
1,770
Trophies
0
Location
the land of lol
XP
528
Country
This looks great, I've not tried it yet and have only skimmed over the topic, I'll read up etc when I have more time. Great stuff though
biggrin.gif


I have a question....

- You can change file names and Name and IDs of the Wii images (this can be done by renaming to ID|Name, ie: R64P01|Wii Music for casual gamers).

Does this modify the title ID of the games, is that what you mean ?
If so does it also have options to set the save name etc?

I'm asking this, because I'm thinking about getting into Guitar Hero Customs and would love to be able to have this IF it would give each custom a different ID and corresponding save so no conflicts etc (yes I know I can do this with other tools). Will this app allow that ? ? ?
I'm thinking if it does it would allow me to easily make several customs with slight changes, add to HDD and test all in one sitting at the Wii
biggrin.gif


Again, nice work
wink.gif
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: lol