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
Wiimm said:
Because no bugs (exclude installing) reported since months my WIT tools seems to be perfect
hahaha, what a joke ... A few days later I found rarely appearing bug:
If creating a Wii image and using hard links (option --links) the offsets of some hard linked files were wrong for some special situations.


Download of the current version:
 

scooter_seh

Member
Newcomer
Joined
Oct 19, 2008
Messages
7
Trophies
0
Age
35
Location
Michigan
Website
scottnation.com
XP
248
Country
United States
I am writing a program in C# that uses the WIT COPY command to convert .iso to .wbfs files and it doesn't work. I only want to convert one file and not search the whole directory. The source file is something like c:/test.iso and the dest file is similarly c:/id.wbfs. I'm using C# and Windows. Thanks for any help.
Code:
string arguments = "COPY -s " + source + " -d " + dest + " -B";
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
The command line is correct for these parameters, but you should quote the filenames to avoid space conflicts:
Code:
string arguments = "COPY -s \"" + source + "\" -d \"" + dest + "\" -B";
Be sure that the filename itself contains no " (or quote it).
btw: "string arguments" contains a blank!
 

airline38

Well-Known Member
Member
Joined
Mar 28, 2010
Messages
741
Trophies
1
XP
807
Country
Taiwan
@Wiimm , I got this error information below :

Code:
D:\Wii>wit verify eleven.iso
*****ÂÂwit: Wiimms ISO Tool v2.00b r2855 cygwin - Dirk Clemens - 2011-07-13ÂÂ***

!H0-ERR .0ÂÂUPDATEÂÂSTQJHF eleven.iso
!H0-ERR .1ÂÂDATAÂÂÂÂSTQJHF eleven.iso

Is there a way to get more error details of the ISO file by using "wit" ?
Is there other wit command I can use ? or is there a way I can use wit to
fix this error ?


Code:
D:\Wii>wit dump eleven.iso --show p-info

Dump of file eleven.iso

ÂÂPartition table #0, partition #0, type 1 [UPDATE]:
ÂÂÂÂTICKET & TMD are well signed. Partition is encrypted.
ÂÂÂÂPartition key:ÂÂÂÂa7b447b0 f1faaa93 0ad6aeae c00f2bd3
ÂÂÂÂPartition IDs:ÂÂÂÂticket=.UPJ, tmd=.UPJ, boot=RELSAB
ÂÂÂÂboot.bin, title:ÂÂSample Game Name
ÂÂÂÂSystem version:ÂÂ 00000001-00000004 = IOS 0x04 = IOS 4
ÂÂÂÂDirectories:ÂÂÂÂÂÂÂÂ 5
ÂÂÂÂFiles:ÂÂÂÂÂÂÂÂÂÂÂÂÂÂ79

ÂÂPartition table #0, partition #1, type 0 [DATA]:
ÂÂÂÂTICKET & TMD are well signed. Partition is encrypted and scrubbed.
ÂÂÂÂPartition key:ÂÂÂÂ7a28e8b4 3d2f95f6 11403d0b 32a4d024
ÂÂÂÂPartition IDs:ÂÂÂÂticket=STQJ, tmd=STQJ, boot=STQJHF
ÂÂÂÂboot.bin, title:ÂÂInazumaElevenStrikers
ÂÂÂÂSystem version:ÂÂ 00000001-00000038 = IOS 0x38 = IOS 56
ÂÂÂÂDirectories:ÂÂÂÂÂÂÂÂ 7
ÂÂÂÂFiles:ÂÂÂÂÂÂÂÂÂÂÂÂ7623
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
Code:
# wit help verify
...
ÂÂÂÂ --limit numÂÂÂÂMaximal printed errors of each partition. A zero
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂmeans unlimited. The default is 10.

ÂÂ-l --longÂÂÂÂÂÂÂÂ On error print an additional line to localize the
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂexact position where the error is found. If set
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtwice a hexdump of the hash values is printed
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂtoo.
...
Missing there is the impact of --verbose. So try -llv
Code:
# wit verify corrupt/wch.wdf -llv

wit: Wiimms ISO Tool v2.00b r2834 x86_64 - Dirk Clemens - 2011-07-13

>scanÂÂ .0ÂÂDATAÂÂÂÂRTYP01 corrupt/wch.wdf
>infoÂÂÂÂÂÂÂÂÂÂÂÂÂÂ TICKET & TMD are well signed. Partition is encrypted and scrubbed.
!H0-ERR .0ÂÂDATAÂÂÂÂRTYP01 wch.wdf
ÂÂÂÂÂÂÂÂÂÂÂÂgroup=833.13, block=22bd7.1, data-off=115eb8400=B+400, hash-off=115eb8000=B+0
ÂÂÂÂÂÂÂÂÂÂÂÂDATA 115eb8400: 7d 43 17 a3ÂÂc5 51 a4 f3ÂÂ6c 23 fd 88ÂÂ3e ab 25 7c :}C...Q..l#..>.%|:
ÂÂÂÂÂÂÂÂÂÂÂÂHASH 115eb8000: 91 ea 35 e2ÂÂ9f 16 2c 5aÂÂbb 62 ca 60ÂÂd1 39 a4 f0ÂÂbc c7 18 cf
ÂÂÂÂÂÂÂÂÂÂÂÂVERIFYÂÂÂÂÂÂ 0: 93 c4 4c 74ÂÂ7b b2 98 9aÂÂf5 96 26 44ÂÂed e7 04 2bÂÂ6e d0 a4 89
!H0-ERR .0ÂÂDATAÂÂÂÂRTYP01 wch.wdf
ÂÂÂÂÂÂÂÂÂÂÂÂgroup=833.13, block=22bd7.2, data-off=115eb8800=B+800, hash-off=115eb8014=B+14
ÂÂÂÂÂÂÂÂÂÂÂÂDATA 115eb8800: 49 6d c4 c0ÂÂ2f d7 cb 69ÂÂ3a 90 24 9aÂÂ06 8e 4f e7 :Im../..i:.$...O.:
ÂÂÂÂÂÂÂÂÂÂÂÂHASH 115eb8014: b2 3b 01 77ÂÂ96 4f e7 4dÂÂfc 14 89 ddÂÂbc c7 18 cfÂÂb2 3b 01 77
ÂÂÂÂÂÂÂÂÂÂÂÂVERIFYÂÂÂÂÂÂ 0: 42 73 4e 04ÂÂ25 89 2d b3ÂÂa6 c3 de e5ÂÂ52 41 c8 efÂÂ10 28 76 00
...
 

iautran

Active Member
Newcomer
Joined
Jul 23, 2010
Messages
28
Trophies
0
XP
62
Country
United States
Hi,

as this is the main topic for wit magic tool, I have a question please.
While I was trying to launch a game I ve received a black screen and then the WBFS partition is not recognized anymore.

I have launched this command :

Code:
wwt.exe analyse

ANALYZE /dev/sda

ANALYZE /dev/sda1

ANALYZE /dev/sda2

ANALYZE /dev/sdb
------------------------------------------------------------------------------------
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂHD SECTORSÂÂWBFS SECTORSÂÂ DISCSÂÂÂÂÂÂ (all values in hex)
ÂÂÂÂÂÂÂÂÂÂ WBFSÂÂÂÂ totalÂÂsecÂÂtotalÂÂÂÂsecÂÂmax inode
NAMEÂÂÂÂmagic vrsÂÂÂÂ num sizeÂÂ numÂÂÂÂsizeÂÂnum sizeÂÂADDITIONAL INFORMATION
------------------------------------------------------------------------------------
INODE-TIM: okÂÂ1 1e848000ÂÂ200ÂÂf424ÂÂ400000ÂÂ1f4 1400ÂÂ2010-07-23 16:21:08 n=488
------------------------------------------------------------------------------------

ANALYZE /dev/sdb1
------------------------------------------------------------------------------------
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂHD SECTORSÂÂWBFS SECTORSÂÂ DISCSÂÂÂÂÂÂ (all values in hex)
ÂÂÂÂÂÂÂÂÂÂ WBFSÂÂÂÂ totalÂÂsecÂÂtotalÂÂÂÂsecÂÂmax inode
NAMEÂÂÂÂmagic vrsÂÂÂÂ num sizeÂÂ numÂÂÂÂsizeÂÂnum sizeÂÂADDITIONAL INFORMATION
------------------------------------------------------------------------------------
INODE-TIM: okÂÂ1 1e848000ÂÂ200ÂÂf424ÂÂ400000ÂÂ1f4 1400ÂÂ2010-07-23 16:21:08 n=488
DISCS:ÂÂÂÂÂÂ-ÂÂ0 1e848000ÂÂ200ÂÂf424ÂÂ400000ÂÂ1f4 1400ÂÂ51 disc header found
------------------------------------------------------------------------------------

ANALYZE /dev/sdb2

So my WBFS partition is at /dev/sdb1 if I am correct.
The last time I had this error, I ran the command below but the result is not good this time :
Code:
wwt recover -p /dev/sdb1
*****ÂÂwwt: Wiimms WBFS Tool v1.10a r1386 cygwin - Dirk Clemens - 2010-07-15ÂÂ*****

!! wwt: ERROR #23 [READ FILE FAILED] in AnalyzePartitions() @ src/wbfs-interface.c#367
!!ÂÂÂÂÂÂNo WBFS magic found: /dev/sdb1
!! wwt: ERROR #15 [NO WBFS FOUND] in AnalyzePartitions() @ src/wbfs-interface.c#381
!!ÂÂÂÂÂÂno WBFS partitions found -> abort

What should I do ?
(I have others NTFS partitions on this disk; so I would like some advices before trying a lot of things
smile.gif


Thanks !!
smile.gif


P.S: I have downloaded the v2.00b version but the problem remains
smile.gif
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
The WBFS header of /dev/sdb1 seems overwritten.
The recover command works only on valid WBFS and tries to recover (deleted) discs.
If you are sure that /dev/sdb1 is the right device, try: wwt format --recover --force /dev/sdb1
 

iautran

Active Member
Newcomer
Joined
Jul 23, 2010
Messages
28
Trophies
0
XP
62
Country
United States
Thanks a lot !
I am quite sure it is the right partition as it was already on "sdb1" last year when I've asked you about another similar issue (and I didnt repartition my HDD since this moment, so it will be already "sdb1" right ?

Moreover, it seems that your tool see the WBFS partition on this address (sdb1) if I am reading the output of the command correctly.

(I dont understand why the header was overwritten)

Thank you
 

iautran

Active Member
Newcomer
Joined
Jul 23, 2010
Messages
28
Trophies
0
XP
62
Country
United States
One more time your post was very helpfull Wimm !

The command you sent me worked correctly and I am able to play with the game on the HDD !

As you suspect, I am using USB Loader GX to launch my games. (If you can advice me another application, let me know !
smile.gif
)
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
ok, 10+ times GX loader does this. There must be related bug in the software.
I use CFG loader, but this is my personal decision and I will not say that other loaders like WiiFlow are less good.


iautran said:
I am quite sure it is the right partition as it was already on "sdb1" last year when I've asked you about
I always say "if you sure" because if anyone formats the wrong partition all data is lost. It's only a question to point out how dangerous it can be.
 

ice1006

Active Member
Newcomer
Joined
Sep 8, 2009
Messages
30
Trophies
0
XP
55
Country
United States
Dear Wiimm,

After I have done many tests, I am sure there is something wrong with wit.exe when upack and repack wii iso/wbfs file or other formats.(I only tested *.iso and *.wbfs)

The tested game is "Super Papaer Mario Wii" (R8PJ01, Jap Region), I descrip the test process:

1、Prepare the original iso file R8PJ01.iso, of course it runs well on Wii with CFG USB Loader.
2、Transfer the original file R8PJ01.iso to wbfs format R8PJ01.wbfs with wit.exe, the R8PJ01.wbfs works well on USB Loader, too.
3、Upack all the files of R8PJ01.wbfs to directory C:\R8PJ01 (FST) with wit.exe
4、Without replace anything of the extracted files, just keep all the files original, then, repack the directory C:\R8PJ01 to R8PJ01-new.wbfs


The new file R8PJ01-new.wbfs is different with R8PJ01.wbfs, there are some bytes different between the two files, and the result is, the R8J01.wbfs works well but R8PJ01-new.wbfs is broken -- when it runs on USB Loader, It will crash after select save profile, and could not enter the game.

All files are from the orginal wbfs/iso, no file were replaced, but why after repack it will broken? and become different with orignal file?

I am doing a localization project with Paper Mario R8PJ01, unpack/repack is the basic function, I really hope you could solve this problem. Thanks.
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
That should work!! Differences are normal, because 1) files are arranged in other order and 2) checksums and signatures are different.

Please make a diff on file level: "wit fdiff R8PJ01.wbfs R8PJ01-new.wbfs"
I own the PAL version of it and will try to reproduce this error.
 

ice1006

Active Member
Newcomer
Joined
Sep 8, 2009
Messages
30
Trophies
0
XP
55
Country
United States
Oh, yes yes, wit.exe works well on some other games, I test it with many games, most of them are normal, but I am sure Paper Mario(R8PJ01.iso, USA/PAL region maybe the same, I didn't test U/P region) didn't work with it.

BTW, I forgot to tell you?sometimes, after repack R8PJ01 it works well on Dolphin emulator but not works on Wii. It's strange, I don't know why. Hope you could find the reason and fix it~
rolleyes.gif
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
I can reproduce this error with the PAL version. A diff say:
Code:
# wit fdiff spm.wdf spm2.wdf
* DIFF/FILES 1/1 WDF:spm.wdf -> WDF:spm2.wdf
!ÂÂ Files differ:ÂÂÂÂ DATA/disc/region.bin
!ÂÂ Files differ:ÂÂÂÂ DATA/h3.bin
!ÂÂ Files differ:ÂÂÂÂ DATA/sys/fst.bin
!ÂÂ Files differ:ÂÂÂÂ DATA/ticket.bin
!ÂÂ Files differ:ÂÂÂÂ DATA/tmd.bin
! ISOs differ: WDF:spm.wdf : WDF:spm2.wdf
... and that's expected.

I don't know what happens. I will do it on my todo list.

EDIT:
I have used --region=file to use the original region setting but it doesn't help.

EDIT 2:
Only an idea: The files are sorted case insensitive, wit sorts in strict ascii.
 

ice1006

Active Member
Newcomer
Joined
Sep 8, 2009
Messages
30
Trophies
0
XP
55
Country
United States
So, you mean that when we repack the game, all files are sorted in a new order, and this cause the repacked game broken? Is there any other reason?

In theory, if we didn't replace any file from the extracted game, just keep all the extracted files original, then the repacked new game must be absolutely equal with the original game.

I think you could record the file order or some other information not very clear from original game into a log file during the unpack process, and read the log file to rebuild game when repacking it, so that it can be "absolutely equal" with the original game.


"Super Paper Mario" is a very very strange game, upacking/repacking will cause it broken, and sometimes I replace some file(like *.bfn font file, *.txt message file) with WiiScrubber tools but not wit.exe, it will also be broken on Wii, but it works well on Dolphin... oh my god, I didn't know what happened
frown.gif
 

penly

Member
Newcomer
Joined
Aug 27, 2011
Messages
10
Trophies
0
XP
1
Country
United States
I just wanted to clarify if your scrub ISO option produces files the same as the cISO format please (ie: as ripped by any USB loader) or is there another option which would produce the same output?
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
@ice1006
The file order is a possible issue and the only thing I see now, but I don't know.

@penly
Du you mean the CISO format? It is only used my ULoader and converting to this format is compatible.

Do you mean scrubbing? The scrubbing is similar, but more ciorrect for 2 reasons:
1.) SSBB has special partitions in a second partition table. Most (or all) of the USB Loaders/WBFS Managers ignore theses partitions with the result of a bad dump.

2.) The disc header (first 160 KiB of disc) contains sometime additional infos that the standard scrubbing algorithm doesn't see. My tool find and copy this data. Most of the other tools copies them too because they always copy complete blocks and all of this data i in block #0.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: What the hell was that Syl?