Hacking wwt+wit: Wiimms WBFS+ISO Tools

Nickkk

Well-Known Member
Newcomer
Joined
May 25, 2012
Messages
61
Trophies
0
Website
desairem.altervista.org
XP
159
Country
Swaziland
I think I found a bug when trying to convert a game from wbfs to wia with the argument --compression FAST. GOOD and BEST seem to work!

!! wit: ERROR #25 [CAN'T OPEN FILE] in SetupWriteWIA() @ src/lib-wia.c#2371
!! Can't open file stream: /Users/me/Desktop/hjk.wia
!! -> Bad file descriptor [9]
2012-11-06 15:02:36.589 Witgui[6805:303] !! wit: ERROR #41 [FATAL ERROR] in write_data() @ src/lib-wia.c#1483
!! ASSERTION FAILED !!!
 

PsyBlade

Snake Charmer
Member
Joined
Jul 30, 2009
Messages
2,204
Trophies
0
Location
Sol III
XP
458
Country
Gambia, The
I would be gratefull if you could take a look at this file
http://www.mediafire.com/?wvsnucp6zvxrh7m
I would like to know if this is just fucked up bad (and maybe how it happened) or if this is a problem with our tools

It's a verbatim copy ot the first block of a WBFS
Submitter claimed that it worked but that wwt could not open the WBFS; seems inexperienced

I can open it with wwt just fine
The block mappings of some games look messed up bad but somehow seem strange
I think this MIGHT be some data format we don't understand

see http://gbatemp.net/threads/wbfs2fat-py.291320/page-8#post-4444055 and later for details

EDIT:
Appart from the common x-linking problem it seems some single layer games have uninitialized garbage for the second layer part of the block map instead of the usual zeros
Was able to work around the issue for THIS user with a particularly ugly hack
(skip 2. layer if block 22 is maped)
No idea how to detect this in general
 

Nickkk

Well-Known Member
Newcomer
Joined
May 25, 2012
Messages
61
Trophies
0
Website
desairem.altervista.org
XP
159
Country
Swaziland
Please forget the canceling issue, I tried again and now it works. Just to summarize my latest posts (and a couple of new issues):

1) Having individual downloads of wit, wwt etc would be great so that GUIs based on those can download them separately and don't have to ship them along everytime.

2) Converting from wbfs to win with the FAST compression mode doesn't seem to work, extracting from wia to wia works indeed.

3) Please update --scan-progress on wwt :-)

4) I noticed the CPU % getting used is sometimes really low ... is this normal? Or could conversions somehow run faster? Also the percent of work done when converting to wia jumps to 100% almost at the beginning and then back again a couple of times.

5) Canceling conversions to the iso format can take quite a lot of time ... is this normal, too?

Thank you for your patience and your answers! Your tools are really appreciated ;-)
 

b0ring

Member
Newcomer
Joined
Jul 1, 2009
Messages
8
Trophies
0
XP
72
Country
So I decided to finally try and convert my usb hard drive from WBFS to FAT32, but I'm not able to because of some problem games. Wii Backup Manager lists four potential problem games (they list ??? partitions).

I'm trying to figure out how to fix the problem but wwt keeps failing...

C:\Program Files\Wiimm\WIT>wwt verify -a -R -vvv

wwt: Wiimms WBFS Tool v2.10a r4118 cygwin - Dirk Clemens - 2012-10-10

One WBFS partition found.
* Summary of WBFS Check: 2 errors found:
2 WBFS sectors are used by 2 or more discs!
Total: 3 discs are invalid!


WBFSv1 #1/1 opened: /dev/sde1
>scan 1.0/70 DATA RODP01 WarioWare: Smooth Moves
>info TICKET & TMD are well signed. Partition is encrypted
and scrubbed.
+OK 1.0/70 DATA RODP01 WarioWare: Smooth Moves
>scan 2.0/70 DATA RHAP01 Wii Play
>info TICKET & TMD are well signed. Partition is encrypted
and scrubbed.
+OK 2.0/70 DATA RHAP01 Wii Play
!! wwt: ERROR #40 [OUT OF MEMORY] in my_malloc() @ src/debug.c#190
!! Out of memory while malloc() 3809215494 bytes (0xe30c0406)

I get the same thing, every time, with the exact same memory location. Any idea what my next move should be?
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
@psyblade:
I have spent only a little time but I can't see any curious thing.

@nickkk:
1.) Not planned
2.) Converting to "win"?
3.) For which operation? scanning of a wbfs drive is fast.
4.) Mostly the tools wait for disc io. For WIA it changes multiple times between de-/compressing and disc io.
5.) My tools will test the abort condition before each read/write call. It if the OS cleans the cache, there no chance to abort.

@b0ring:
I think it is an error because of wring data. I will create a new version in the next days to find the correct source code position to add some additional tests. Can you wait before removing the bad discs? Perhaps a raw copy of the related images and verifying the copied image will produce the same results.
 

b0ring

Member
Newcomer
Joined
Jul 1, 2009
Messages
8
Trophies
0
XP
72
Country
@b0ring:
I think it is an error because of wring data. I will create a new version in the next days to find the correct source code position to add some additional tests. Can you wait before removing the bad discs? Perhaps a raw copy of the related images and verifying the copied image will produce the same results.

No problem, I'll try copying in the next few days when I have some time. Thanks for the quick reply.
 

b0ring

Member
Newcomer
Joined
Jul 1, 2009
Messages
8
Trophies
0
XP
72
Country
@b0ring:
Here are some updates. They will print the source position more exact. That helps me to implement a guardian.
* http://wit.wiimm.de/download/bin/cygwin/wit-3194.exe
* http://wit.wiimm.de/download/bin/cygwin/wwt-3194.exe
Both are only the Cygwin binaries.

A quick run with the new files got me this, I hope it's of some use:
!! wwt: ERROR #40 [OUT OF MEMORY] in wd_load_part() @ src/libwbfs/wiidisc.c#2036

!! Out of memory while malloc() 3809215494 bytes (0xe30c0406)
 

Nickkk

Well-Known Member
Newcomer
Joined
May 25, 2012
Messages
61
Trophies
0
Website
desairem.altervista.org
XP
159
Country
Swaziland
I meant wia, of course :) Converting to win with option FAST enabled throws an error. I meant adding --scan-progress to the LIST command as in wit. So, is there no way of using all CPU for a single conversion?
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
liblzma supports 2 CPUs, but because any reasons this didn't worked correct. But I made only a little try, because WIA is still my academic project and I never used it and so I will not waste my time.
 

b0ring

Member
Newcomer
Joined
Jul 1, 2009
Messages
8
Trophies
0
XP
72
Country
Thank you for these quick updates. They're much appreciated. Running it again, I got further but still hit problems.

I've put the output here: click me!

Now that clearly tells me that "Super Smash Bros. Brawl" is a problem, but that was backed up with seemingly no problem when I used Wii Backup Manager. And now I'm hitting an internal error?

Should I presume from all this that my hard drive is just fucked..? :P
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
If you mean this:
Code:
!! wwt: ERROR #14 [INVALID WII PARTITION] in wd_load_part() @ src/libwbfs/wiidi
c.c#2033
!!      Invalid TMD size (0xe30c0406) in partition '0x50384148 ["HA8P"]':
!!      /dev/sde1
!! wwt: ERROR #14 [INVALID WII PARTITION] in wd_load_part() @ src/libwbfs/wiidi
It's a wanted error message because the disc is incomplete. For SSBB it is normal, because the dumpers forget to copy the partitions of the second partition table. Prior wit crashed.
 

b0ring

Member
Newcomer
Joined
Jul 1, 2009
Messages
8
Trophies
0
XP
72
Country
Sorry, I was referring to the way the program terminated (Error #39).

I ran it again today with more success. The Error #14s from before became Error #16s this time. However, the program still terminated like this:
Code:
  !H1-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H2-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H1-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H2-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H1-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H2-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H1-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H2-DIF 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H3-ERR 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !H3-ERR 48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
  !ABORT  48.0/69  DATA    R3MP01 Metroid Prime: Trilogy
- REMOVE disc [R3MP01] Metroid Prime: Trilogy
!! wwt: ERROR #39 [INTERNAL ERROR] in ExistsWDisc() @ src/wbfs-interface.c#4115
!!      Internal error

Can you offer any advice on what's happening to cause this sudden abort? I'm sorry for asking so many questions, but without knowing what I'm supposed to see I've no idea what I'm supposed to do...short of formatting the drive and starting again with the few games that successfully backed up.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
Internal errors are really bad. here it is:
Code:
    if ( !w || !w->wbfs || !id6 || strlen(id6) != 6 )
    return ERROR0(ERR_INTERNAL,0);
'w' is the wdisc pointer. I assume, that the id6 was wrong (shorter than 6 chars because a NULL value.
This was to careful and I changed it now to strlen(id6) > 6
 

b0ring

Member
Newcomer
Joined
Jul 1, 2009
Messages
8
Trophies
0
XP
72
Country
Just thought I'd post an update. I ran 'verify' once more, it gave some errors during the check but this time it at least completed without aborting due to error. I went ahead an ran wbfs2fat anyway, and it all went smoothly. The USB Loader reads the games, and the four problem ones simply kick me back to the Wii menu.

So thanks both for the tools and support. :)
 

Nickkk

Well-Known Member
Newcomer
Joined
May 25, 2012
Messages
61
Trophies
0
Website
desairem.altervista.org
XP
159
Country
Swaziland
I'm trying to publish Witgui on the App Store. The only thing is that Apple requires wit to be signed with my Apple Developer Certificate ... Would I be allowed to build wit by myself and sign it? If the answer is yes, where can I download the source code?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • SylverReZ @ SylverReZ:
    @Maximumbeans, I'm doing alright, thanks.
    +1
  • Maximumbeans @ Maximumbeans:
    That must be rough. Productive I'm sure but hard to balance with daily life
    +1
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Indeed. I've been working on getting this Infecutus chip to work on my PS2. But after soldering, I realised that a plastic piece was missing from the power ribbon cable to the power and eject buttons.
  • SylverReZ @ SylverReZ:
    Now I could go with soldering the contacts from the cable to the connector on the mobo, but doesn't sound like a good permanent solution.
  • Maximumbeans @ Maximumbeans:
    Man, that's beyond my brain :rofl: I'm no good with hardware for now. I'd like to get into hardmods in future though
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Maybe start practice soldering. Get a cheap-ass soldering iron and follow some good YouTube tutorials.
    +1
  • SylverReZ @ SylverReZ:
    Least my experience has gotten better than over a decade ago. My iron would constantly bump into components and break them.
  • Maximumbeans @ Maximumbeans:
    Sounds good. I actually did soldering but like 16 years ago for school so uuuuh probably rusty haha
  • SylverReZ @ SylverReZ:
    @Maximumbeans, Same here. I did soldering at school from a teacher who I honestly liked since he had plenty of good electronics experience.
    +1
  • Maximumbeans @ Maximumbeans:
    I wish I could play chess well
    +1
  • Maximumbeans @ Maximumbeans:
    Useless but a true art
    +1
  • SylverReZ @ SylverReZ:
    @Maximumbeans, I had a friend who had a glass chess set for their birthday.
  • SylverReZ @ SylverReZ:
    It was like all clear and fancy. Tbf I'm not too experienced with chess, but would like to learn someday.
  • Maximumbeans @ Maximumbeans:
    That sounds really cool
  • Maximumbeans @ Maximumbeans:
    I know the basics but no strategy at all :rofl:
    +1
  • Veho @ Veho:
    Watch chess streamers on Twitch and you'll pick up a thing or two.
    +1
  • Veho @ Veho:
    Not to mention there's an infinite number of chess games for every possible platform.
    +1
  • DinohScene @ DinohScene:
    just play it, get beaten a few times and start dominating
    +1
  • K3Nv2 @ K3Nv2:
    Nude chess is best
    +1
  • DinohScene @ DinohScene:
    strip checkers > nude chess
    +1
  • K3Nv2 @ K3Nv2:
    Nude checkers get jumped
    +1
  • SylverReZ @ SylverReZ:
    @Veho, I guess you'd pick up something while watching tub streams.
  • SylverReZ @ SylverReZ:
    @K3Nv2, Dick fights. :tpi:
  • Veho @ Veho:
    Turkish olive oil wrestling.
    +1
    Veho @ Veho: Turkish olive oil wrestling. +1