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
@airline38
There is no BCA support in my tools (they just copy all non zeroed data). Have some homebrewers agreed any specification how to store BCA in an ISO?

@aLIBUBA
Yes, there *was* a preallocation bug for splitted files. I have forgotten to subtract the relative file offset of the continuation files before preallocating. For your example it means: The *.wbf1 file preallocates the area from 4G up to 8G and that is impossible for FAT. All other file systems works fine because of truncating.
 

giantpune

Well-Known Member
Member
Joined
Apr 10, 2009
Messages
2,860
Trophies
0
XP
213
Country
United States
there really doesnt need to be any agreement about how/where to store BCA data. pretty much any method of playing a game allows loading it from an external file. and it is only used in 1 game. so its not too much trouble to save the BCA from mario in a file all by itself.
 

davebaol

Well-Known Member
Member
Joined
Sep 3, 2010
Messages
912
Trophies
0
XP
192
Country
Italy
airline38 said:
@Wiimm, how can I use 'wit' to extract the BCA data from an ISO file ?
You can't do it, because bca data is not inside the iso file.
You should read the original dvd using neogamma or cleanrip.
 

Qriist

Member
Newcomer
Joined
Oct 24, 2010
Messages
22
Trophies
0
XP
177
Country
United States
Just reporting a bug, using latest wit.

I am attempting to copy some gamecube games to WIA/NONE and it initially appears successful, albeit larger than the source file. Trying to copy the WIA to another format fails with the following info:
Code:
!! wit: ERROR #40 [FATAL ERROR] in XReadF() @ src/lib-file.c#2216
!!ÂÂÂÂÂÂASSERTION FAILED: 124 10000
Using WIA with no additional arguments, followed by a copy to ISO still fails.
Any ideas?

Otherwise, good stuff as usual.
smile.gif



PS
For sake of argument, my main test game matches the ReDump. http://redump.org/disc/6333/
Others have been tried, however.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
wiimms-tools.png


WIT: Wiimms ISO Tools v1.25a - 2011-01-09
A command line ISO+WBFS tool set for various os.

WIT (Wiimms ISO Tools) is a set of command line tools to manipulate Wii ISO images and WBFS containers. The two main tools are called wit (Wiimms ISO Tool) and wwt (Wiimms WBFS Tool, the WBFS manager).

Feature overview:Visit http://wit.wiimm.de/features.html for more details.

Download of the current version:
There are also some GUI available:

Change log:


Code:
wit v1.25a r2133 - 2011-01-09

- Bug fix for "wit mix": If reading from FST signing failed.
- Bug fix: The space preallocation for splitted files exceeded the defined
ÂÂ limit. This results in an error on FAT partitions.
- "wit DUMP image": IDs (ticket, tmd, boot) and IOS of the data partition are
ÂÂ printed in the "intro" and "partition info" sections of the dump. Therefor
ÂÂ the option --show has 3 new keywords: D-ID, P-ID and ID (=D-ID|P-ID).
ÂÂ These new keywords can be used to minimze the dump (print IDs only).
- wwt format: If formatting a device and option --hss is not, then the real
ÂÂ sector size of the device is used. This is a concession for the new drives
ÂÂ with 4096 instead of 512 bytes per block.


Known bugs:

- The GameCube support is in development and EXPERIMENTAL!
ÂÂÂÂ- Conversion to WIA fails.
- wit COPY --raw: Copying an image in raw mode to a WBFS file is buggy.
- There are new problems while reading from non seekable sources (e.g. pipes).
ÂÂ The reason is the complete new and more intelligent wiidisc lib which makes
ÂÂ more lookups ==> The best is to use version 1.01c for pipes.
- No WIA/bzip2 support for MAC/x86_64. (bug in the Mac bzip2 library)

The source is published under the license of GPL2. Checkout the sources directly from the SVN repository or browse the source. Visit http://wit.wiimm.de/ for more information.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
wiimms-tools.png


WIT: Wiimms ISO Tools v1.25b - 2011-01-10
A command line ISO+WBFS tool set for various os.

BUG FIX RELEASE

WIT (Wiimms ISO Tools) is a set of command line tools to manipulate Wii ISO images and WBFS containers. The two main tools are called wit (Wiimms ISO Tool) and wwt (Wiimms WBFS Tool, the WBFS manager).

Feature overview:Visit http://wit.wiimm.de/features.html for more details.

Download of the current version:
There are also some GUI available:

Change log:


Code:
wit v1.25b r2143 - 2011-01-10

- Bug fix for "wwt init": Auto hd sector size (hss) detection was wrong and
ÂÂ returns always the value 4096.
- "wwt FIND" supports option --sections and --old-style. The later one will
ÂÂ ensure that the GUIs can read and scan the old style because I will change
ÂÂ the layout completly in one of the next releases.


Known bugs:

- The GameCube support is in development and EXPERIMENTAL!
ÂÂÂÂ- Conversion to WIA fails.
- There are new problems while reading from non seekable sources (e.g. pipes).
ÂÂ The reason is the complete new and more intelligent wiidisc lib which makes
ÂÂ more lookups ==> The best is to use version 1.01c for pipes.
- No WIA/bzip2 support for MAC/x86_64. (bug in the Mac bzip2 library)

The source is published under the license of GPL2. Checkout the sources directly from the SVN repository or browse the source. Visit http://wit.wiimm.de/ for more information.
 

john.jingle

Well-Known Member
Member
Joined
Jan 24, 2008
Messages
290
Trophies
1
XP
561
Country
United States
I have been having trouble with my HD loading certain games (a majority of them, really) and I'm trying to scan for bad sectors. Some people told me to download wit-console for ways to repair my HD but I don't know how this program works. Can anyone tell me what's wrong with my WBFS formatted hd?

I went to this page http://wit.wiimm.de/download.html#vers-v1.25a to download the Cygwin (Windows) version and extracted it. I then opened wit-console in the bin folder.

After typing "wwt check --auto", it says
Summary of WBFS Check: 956 errors found:
4 used WBFS sectors marked as free!
485 free WBFS sectors marked as used!
466 WBFS sectors are used by 2 or more discs!
Total: 39 discs are invalid!

Does this mean that 39 of my isos are messed up? If so, how do I fix this?
Typing in wwt recover, repair, verify all say "no WBFS partitions found -> abort"
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
It's curios that the other command didn't work, because all use the same function to wind wbfs drives. Have you forgotten to enter the commands in admin mode?

Try "wwt check" with option --long up to 4 times to be more verbose.

The message "Total: 39 discs are invalid!" means what it says. But remember: If to discs shares the same disc space it is possible that only one is bad. To check this try "wwt verify". But verify can only check the content of the ISO partitions, but not the disc header.
 

smyll

Member
Newcomer
Joined
Jan 15, 2011
Messages
9
Trophies
0
XP
8
Country
France
Hi all,

------------------- Sorry for this long message which explain my various tests
wink.gif


Here is my project :
> I would like to build a WII ISO file with my own programmed DOL & Files.

Note : I have a 4.3E Wii with a chip (Wode Jukebox). So I have all my original dumped Wii games on my HDD. ISO Games Working fine.
I can only use PAL (Europe) ISO.

What I have done :
> Make a dol with devkitpro => Ok tested in dolphin.
> Trying many methods to change the main.dol in a working wii iso => no success (WiiScrubber etc...)
> I am now trying to use wit which seems to be really adapted to my aim :

In my initial test, the wii dol corresponds to the triangle example given with devkitpro (wii/graphics/gx/triangle). For testint I put my ISO on a FAT32 Formatted HDD that works with other ISO.

1) I get the composition template given on the Wit web site (section 6 http://wit.wiimm.de/info/composing.html) :
I put my own dol in the sys directory and rename it "main.dol" and use :
wit copy --id RMCPX3 --name 'MyRom' composing-template myrom1.iso


This rom seems to be ok and works with dolphin.
But it does not work on the WII.

Dump of file myrom1.iso

Real path: /home/Smyll/myrom1.iso
ISO file size: 118240000/hex = 4699979776 = 4482 MiB
Scrubbed size: 78000/hex = 491520 = 480 KiB, 0.01%
Disc type: Wii
ID & file type: RMCPX3, ISO/WII
Disc name: MyRom
ID Region: PAL [PAL ]
Region setting: 2 [Europe] / 00 00 00 00 00 00 00 00
Partitions: 1
Directories: 4
Files: 12
Used ISO blocks: 15 * 32 KiB = 0 MiB

1 partition table with 1 partition:

tab.idx n(part) offset(part.tab) .. end(p.tab)
--------------------------------------------------------
0 1 10008*4 = 40020 .. 40028

1 partition:

index type offset .. end offset size/hex = size/dec = MiB s
tatus
----------------------------------------------------------------------------
--------
0.0 DATA 0 f800000 .. fa20000 220000 = 2228224 = 2 -


1.Bis) I have compare this dump with a working iso game dump
ID Region: PAL [PAL ]
Region setting: 2 [Europe] / 80 80 80 00 03 03 04 03

My region settings seems to be wrong...
So I use WIUI 1.0 to change the region of my rom to PAL. THe new dump becomes:
Dump of file myrom1.iso

Real path: /home/Smyll/myrom1.iso
ISO file size: 118240000/hex = 4699979776 = 4482 MiB
Scrubbed size: 78000/hex = 491520 = 480 KiB, 0.01%
Disc type: Wii
ID & file type: RMCPX3, ISO/WII
Disc name: MyRom
ID Region: PAL [PAL ]
Region setting: 2 [Europe] / 80 80 80 00 03 03 04 03
Partitions: 1
Directories: 4
Files: 12
Used ISO blocks: 15 * 32 KiB = 0 MiB

1 partition table with 1 partition:

tab.idx n(part) offset(part.tab) .. end(p.tab)
--------------------------------------------------------
0 1 10008*4 = 40020 .. 40028

1 partition:

index type offset .. end offset size/hex = size/dec = MiB s
tatus
----------------------------------------------------------------------------
--------
0.0 DATA 0 f800000 .. fa20000 220000 = 2228224 = 2 -


The rom still failed on the WII but is OK for Dolphin.
An interesting thing is that Trucha signer cannot open the iso.

2) 2nd test : Replacing the main dol of a working game with wit
2.1) extract the ISO structure
wit extract xx.iso outISO

I remove all files in "Files" directory an replace the main.dol in sys.

I build the iso again :
wit copy outISO --id RMCPX3 --name 'MyRom2' --region FILE myRom2.iso

I use --region FILE since the region.bin is present.
The dump of this new ROM :
Dump of file myRom2.iso

Real path: /home/Smyll/myRom2.iso
ISO file size: 118240000/hex = 4699979776 = 4482 MiB
Scrubbed size: 470000/hex = 4653056 = 4544 KiB, 0.10%
Disc type: Wii
ID & file type: RMCPX3, ISO/WII
Disc name: MyRom2
ID Region: PAL [PAL ]
Region setting: 2 [Europe] / 80 80 80 00 03 03 04 03
Partitions: 1
Directories: 4
Files: 12
Used ISO blocks: 142 * 32 KiB = 4 MiB

1 partition table with 1 partition:

tab.idx n(part) offset(part.tab) .. end(p.tab)
--------------------------------------------------------
0 1 10008*4 = 40020 .. 40028

1 partition:

index type offset .. end offset size/hex = size/dec = MiB s
tatus
----------------------------------------------------------------------------
--------
0.0 DATA 0 f800000 .. fc58000 458000 = 4554752 = 4 -


Dolphin OK !
Wii FAILED.. but I can open it with trucha.

2.2) Trying to sign 2.1) ISO with a common.key => WII FAILED

2.3) Verifying BCA to 2.1) ISO and 2.2) ISO. Set it in ISOs.
WII FAILED !


I do not know what I have to do to make a personal ISO working in the WII.
What am I doing wrong. Since i am a newbie in WII dev/Hack I think I missing something but I do not know what
wink.gif


Could you help me ? Have you piece of advice or links/tuto ?

Thanks,

Smyll
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
I looks good for me and I can't find an error.

Some remarks:
- My template uses the apploader.img and main.dol example from hackmii.
- If composing a disc my tools always fake sign (trucha sign) the image. This is also true if changing id or title or any other partition data.
 

giantpune

Well-Known Member
Member
Joined
Apr 10, 2009
Messages
2,860
Trophies
0
XP
213
Country
United States
you are using 4.3e. your game simply WILL NOT BE READ unless you have patched your system menu IOS to allow the signing bug. you also nedd to specify an IOS with the fakesigning bug in your disc TMD. you can use the same IOS as your system menu, but next time there is a update, it is very likely that IOS80 will be stubbed, and your disc wont run anymore.
 

smyll

Member
Newcomer
Joined
Jan 15, 2011
Messages
9
Trophies
0
XP
8
Country
France
Wiimm said:
I looks good for me and I can't find an error.

Some remarks:
- My template uses the apploader.img and main.dol example from hackmii.
- If composing a disc my tools always fake sign (trucha sign) the image. This is also true if changing id or title or any other partition data.

Many remarks:

Some information indicated in my wode indicates that "11 reads 15kb". It seems that the error is located at the start of the partition #1 (I have only one). But i do not know why.

Wimm, your answer seems to indicate that the issue is more related to my chip rather than the iso, isn't it ?

Why when composing an iso via Wit, the resulting iso could not be opened by Trucha ?

Thanks

Smyll
 

smyll

Member
Newcomer
Joined
Jan 15, 2011
Messages
9
Trophies
0
XP
8
Country
France
giantpune said:
you are using 4.3e. your game simply WILL NOT BE READ unless you have patched your system menu IOS to allow the signing bug. you also nedd to specify an IOS with the fakesigning bug in your disc TMD. you can use the same IOS as your system menu, but next time there is a update, it is very likely that IOS80 will be stubbed, and your disc wont run anymore.

Question from newbie
wink.gif
:

you also nedd to specify an IOS with the fakesigning bug in your disc TMD. you can use the same IOS as your system menu.
 

smyll

Member
Newcomer
Joined
Jan 15, 2011
Messages
9
Trophies
0
XP
8
Country
France
giantpune said:
look in your system menu's TMD and see what IOS it uses. ( 4.3 uses 80 )

I am sorry for this stupid question:
Which system menu'TMD ?? Where is it ? Where can I see Title Meta Data ?

EDITED --> I've found it on WIT
wit dump --show TMD

Here is the TMD of an ISO that works on my WII :
Partition table #0, partition #0, type 0 [DATA]:
TMD:
Issuer: Root-CA00000001-CP00000004
Signature type: 10001/hex = 65537 [RSA-2048, size=256,
Version: 0
CA version: 0
Signer version: 0
System version: 00000001 00000021 = IOS 0x21 = IOS 33
Title ID: 00010000 524c5850 = '....XXXX'
Title type: 1/hex = 1
Group ID: 3336/hex = 13110
Access rights: 0/hex = 0
Title version: 0/hex = 0
Boot index: 0/hex = 0
N(content): 1/hex = 1
Content #0, ID: 0/hex = 0
Content #0, index: 0/hex = 0
Content #0, type: 3/hex = 3
Content #0, size: ff7c0000/hex = 4286316544
Content #0, hash: 9f8462bc f08e7bda 6a3905ee bdebdec1 db8d50e2
Relevant SHA1: d8b31667 f16d739b 20c4e38c c2c888f6 a79caae4

But I not found this information on my WII. I also saw that 4.3E is IOS 80
 

mikey72

New Member
Newbie
Joined
Feb 6, 2010
Messages
4
Trophies
0
Website
Visit site
XP
95
Country
Just like to say quality bit of software you have here just one little problem im having.
Using version 1.25b r2143 x86_64 on Arch Linux. wwt wont extract from my usb drive. Pretty sure im using the correct syntax.

wwt X -a RHAP01 -d /directory (+tried many other variations on the same theme)

Keep getting the same output:

One WBFS partition found.

WBFSv1 #1 opened: /dev/sdc1

Running with verbose just adds an extra blank line.

Any help would be appreciated looking to use this tool for some backup scripts.

Thanks.
 

mikey72

New Member
Newbie
Joined
Feb 6, 2010
Messages
4
Trophies
0
Website
Visit site
XP
95
Country
Yeh no error msgs or any processes running in background.
unsure.gif
I installed the package from the Arch community AUR I will uninstall and try a previous version and get back to you.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Playing the Judge Dredd arcade game prototype lol I can see why they didn't finish it but at the...