Hacking wbfs2fat.py

D34DL1N3R

Nephilim
Member
Joined
Dec 6, 2008
Messages
3,670
Trophies
1
XP
3,220
Country
United States
Used this today and now there is no text list for my games in USB Loader GX. I guess I should say it's there, but the text for the game list is invisible. Any idea on how to fix it?

Edit: Figured it out. Loaded the drive in WiiBackupManager and used the "Update storage convention" option.
 

PsyBlade

Snake Charmer
OP
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
hmm thats strange
wbfs2fat uses the oldest storage convention: x:\wbfs\ID6.wbfs
it should be supported by all loaders that support fat

I will see what I can do about it
but probably not much
there will always be some tool that expects a different name

I the meantime WBMs renaming is probably the best option
 

bm123456

Well-Known Member
Member
Joined
Jun 7, 2011
Messages
576
Trophies
1
Age
46
Location
Houston
XP
1,312
Country
United States
Hi PsyBlade , this program is great , is there an option that will automatically make "sub folders " for your games on the conversion ? Just asking , i used WBM to do this for me . If this option was there i missed it .. Thanks again this program worked great and very fast !!!!
 

PsyBlade

Snake Charmer
OP
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
no atm there is no such option
but I might include one in a future version if I figure out a good way to do it

the title data in the game itself is often different from the actual name
and I don't know how to extract it anyway

a included database will be outdated fast

I don't want to download (and parse) a db each time

edit:
I think I will just use the data from the game
does someone know the prefered replacement table for the illegal chars?
 

PsyBlade

Snake Charmer
OP
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
Thanks for the application. Just used it to switch my drive and everything worked great except for a got a weird windows exception but all it did was not rename the files. all works after renming and moving the files thanks again for the extremely helpful application.
Not all chars can be used in filenames (eg "?"). I most likely forgot one in filtering the title.
Do you have more details?
Like the text of the exception? The name of the game?
I would like to fix this for everyone.
 

clonesniper666

KRII LUN AUS
Member
Joined
Jul 31, 2007
Messages
917
Trophies
1
Age
33
Location
The Great Underworld Warzone
Website
Visit site
XP
1,447
Country
United States
It only sad error windows exception and the only games that had had a folder and was not complete was Super Smash Bros Brawl. It could just be a problem with windows 7 since it still has its bugs but overall everything worked great, I just had to rename the games manually.

Again thanks for the awesome support of the application.
 

pepxl

GFX W!Z4RD
Member
Joined
Jun 19, 2009
Messages
3,263
Trophies
1
XP
328
Country
Great lil tool you have here just one problem for me...

woop, any idea whats going on here

W2F: checking for WBFS
W2F: analysing WBFS
W2F: creating FAT filesystem
W2F: creating placeholder Files
W2F: linking used Blocks to Files
W2F: creating Backup of overlap
WARNING: start of dangerous part
W2F: creating WBFS File Headers
W2F: relocating overlaping Blocks
W2F: writing FAT to Disk
W2F: end of dangerous part
W2F: moving Files to destination
ERROR

EDIT

Checked the drive contents and this is what it looks like, like the last few posts the files dont seam to get renamed

capturenyk.png



EDIT

Managed to rename and fix all the game names using "Advanced Renamer" by changing "*.0" extentions with ".wbfs" and ".1" extentions with ".wbf1", then copying the files to the wbfs folder, opened the HDD up in WBM and updated the "Storage Convention".

The whole process to about 30-40 seconds just incase anyone else had the same problems.

Thanks for the great tool saved me alot of time updating from WBFS to FAT32.
 

PsyBlade

Snake Charmer
OP
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
Yes renaming the games will fix it.
I know it is bugged but sadly I can't fix it without someone telling me the Name or ID of the game that can't be renamed
 

pepxl

GFX W!Z4RD
Member
Joined
Jun 19, 2009
Messages
3,263
Trophies
1
XP
328
Country
i dont think its game specific but charater specific, Windows doesnt allow certain characters in folder or file names like " \ / : * ? " < > | ", so if a game title has been named/renamed with these characters then when creating the folders for them during conversion may error out and unfinish correctly.

Example, When coverting to FAT automatically rename folders to substitue : for -

"Call Of Duty: Black Ops"
"Need For Speed: Carbon"

would then be

"Call Of Duty- Black Ops"
"Need For Speed- Carbon"

Hope that helps
 

PsyBlade

Snake Charmer
OP
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
i dont think its game specific but charater specific, Windows doesnt allow certain characters in folder or file names like " \ / : * ? " < > | ", so if a game title has been named/renamed with these characters then when creating the folders for them during conversion may error out and unfinish correctly.
Yes I know, I included the replacement you (correctly) proposed.
I originally thought some game might contain another incompatible character.
But as it turns out the repaceing simply didn't work as intended.

fixed in version 0.8.1

tnx
 

fig2k4

Well-Known Member
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
This is my simple function for fixing the filenames if it's of any use. It basically just replaces all occurrences of the invalid characters.

Code:
function FixFilename(fname: string): string;
begin
result := stringreplace(fname, ':', ' -', [rfreplaceAll]);
result := stringreplace(result, '/', ' ', [rfreplaceAll]);
result := stringreplace(result, '\', ' ', [rfreplaceAll]);
result := stringreplace(result, '*', ' -', [rfreplaceAll]);
result := stringreplace(result, '?', ' ', [rfreplaceAll]);
result := stringreplace(result, '|', ' -', [rfreplaceAll]);
result := stringreplace(result, '"', '''', [rfreplaceAll]);
result := stringreplace(result, '', ')', [rfreplaceAll]);
result := stringreplace(result, '^', ' ', [rfreplaceAll]);
result := stringreplace(result, '  ', ' ', [rfreplaceAll]);
result := trim(result);
end;

BTW, in Delphi '''' is equivalent to a single ', so a quotation mark becomes an apostrophe.

Edit: I really should've refreshed the page before posting, sorry. :)
 

PsyBlade

Snake Charmer
OP
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
Thanks but it's already fixed.

But maybe we should use the same replacements.

I use
name = name.translate(string.maketrans('\/|*?"',":::~_'{}"))
name = re.sub(r' ?: ?',r' - ',name)

which does essentially the same but
does not reduce multiple spaces to one space (intentionally)
and it includes a spaces in front and back of inserted "-" only if there was none
(re is pythons regular expression module)

the differences would be:
"\/" -> " " vs " - "
"?" -> " " vs "_"
"*" -> " -" vs "~"
"" -> "()" vs "{}"

I don't think replacing "^" is needed

What do you think of matching them?
(I would prefer to keep \/ and ? my way)

BTW the last time I had contact with pascal was ~13 years ago.
I would have never guessed that it was still in use.
 

fig2k4

Well-Known Member
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
"?" -> " " vs "_"
I've came across some filenames that had garbled characters which show as question marks. Probably from not being converted correctly at some point (UTF8->Unicode etc). I used a space there so if a filename has something like "A Game: ???????title" it would be converted to "A Game - title" because the double spaces are removed at the end of the function. Using the underscore it would be "A Game - _______title" which doesn't look as good in this situation.

and it includes a spaces in front and back of inserted "-" only if there was none
Maybe just laziness on my part, but I use the same thing for removing double spaces produced here too. :)

I don't think replacing "^" is needed
I can't remember why I have that, but I fully tested this at the time so there must be a reason it's there. Technically there's no need for it though.

"" -> "()" vs "{}"
Just my personal choice, but I think the filenames look neater with the round brackets?

"\/" -> " " vs " - "
"*" -> " -" vs "~"

When I wrote this I really just picked some random replacement characters and made some adjustments while testing. I'll change these ones to match yours since they look better. Replacing the slash with a dash actually just makes more sense. :)
 

PsyBlade

Snake Charmer
OP
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
"?" -> " " vs "_"
I've came across some filenames that had garbled characters which show as question marks. Probably from not being converted correctly at some point (UTF8->Unicode etc). I used a space there so if a filename has something like "A Game: ???????title" it would be converted to "A Game - title" because the double spaces are removed at the end of the function. Using the underscore it would be "A Game - _______title" which doesn't look as good in this situation.
Makes sense - will change

and it includes a spaces in front and back of inserted "-" only if there was none
Maybe just laziness on my part, but I use the same thing for removing double spaces produced here too. :)
will change for uniformitys sake - not that important anyway

I don't think replacing "^" is needed
I can't remember why I have that, but I fully tested this at the time so there must be a reason it's there. Technically there's no need for it though.
Can't see how it would be usefull in a title anyway - will change

"" -> "()" vs "{}"
Just my personal choice, but I think the filenames look neater with the round brackets?
The idea was that () is common while and {} are uncommon, and my replacement keeps that
but from a looks pov you are right - will change

"/" -> " " vs " - "
"*" -> " -" vs "~"
When I wrote this I really just picked some random replacement characters and made some adjustments while testing. I'll change these ones to match yours since they look better. Replacing the slash with a dash actually just makes more sense. :)
Good - but somehow the backslash was lost

that makes the full replacement table:
Code:
\,/,|,:  -> " - " (note the second space A -B would look stupid, double spaces are reduced anyway)
^,?	-> " "
*		-> ~
<	   -> (
>	   -> )
'"'	   -> "'"
"  "	 -> " "

new and improved table implemented in 0.8.2
 
  • Like
Reactions: 1 person

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Playing well some of them.... Sharp X68000 games lol Japanese is hard...