Hacking wwt+wit: Wiimms WBFS+ISO Tools

SuperrSonic

Well-Known Member
Member
Joined
Dec 9, 2011
Messages
807
Trophies
1
XP
2,296
Country
Puerto Rico
It says OK, I did verify before, it even says OK with the built image but always crashes in the same spot regardless.
NmQ5auP.png
 

Nickkk

Well-Known Member
Newcomer
Joined
May 25, 2012
Messages
61
Trophies
0
Website
desairem.altervista.org
XP
159
Country
Swaziland
Sometime ago I tried running 2 instances of wwt in parallel and I noticed that this way games are not added correctly to WBFS partitions. Is there a chance that parallel operations could be supported in the future?
 

CyberMario

Well-Known Member
Newcomer
Joined
Jan 10, 2016
Messages
87
Trophies
0
Location
???
XP
191
Country
United States
Hey Wiimm I've been admiring your work for quite a while. Your Mario Kart Wii projects are some of the most fun I had with Mario Kart in a long time.

I made an account solely to ask you for some assistance.

Goal: Build a Super Smash Bros Legacy ISO image. (Super Smash Bros Legacy is a Project M Mod. More info on it can be found here http://smashboards.com/threads/1-5-update-smash-bros-legacy-m-3-6-version-1-21.376318/)
The Issue: After the intro of the modded iso plays, the game crashes.

My Steps:
  1. I've have a good backup of Super Smash Bros. Brawl on my computer. I've tested this backup on the latest version of Dolphin. It works perfectly.
  2. After properly installing and rebooting Wit on my windows machine, I've extracted my backup using wit.
  3. For good measure, I've recompressed recompiled (COPY in wit) the Brawl backup without modifying any files. The ISO that wit produced also worked on Dolphin perfectly.
  4. I've replaced all the Brawl extracted files with all the modded files of Super Smash Bros Legacy. I did this via Window Explorer with a copy and paste. (Overwrite All)
  5. I've ran the COPY command in wit to build the ISO. The opening runs fine in Dolphin, but after a certain point in the intro, Dolphin crashes and hands me a bunch of error's similar to the image I posted below.
8247b615d717bc0e8e2483e0b1758d5a.png


I thought the error could lie in the GCT file not being active in Dolphin. But after forcing Dolphin to run the Legacy GCT, the same error/crash still exists.

Do you have any idea where the problem could be? I've spent about 4 hours trying to resolve this issue.
 
Last edited by CyberMario,

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
I know, that most of the SSBB dumps are broken, because of the 2 partition tables.

What does "wit dump ssbb.wbfs" tell?
Here is my dump:
Code:
# wit d ssb.wdf

Dump of file ssb.wdf

  Real path:         ..../ssb.wdf
  Virtual size:      1fb800000/hex = 8514437120 = 8120 MiB
  Scrubbed size:     1c7fe8000/hex = 7650312192 = 7296 MiB, 89.9%, 233469*32K
  WDF2 file size:    1c7e0ec30/hex = 7648373808 = 7294 MiB, 89.8%, 100.0%
  File & disc type:  WDF2/WII  &  Wii
  Disc & part IDs:   disc=RSBP01, ticket=RSBP, tmd=RSBP, boot=RSBP01
  Disc name:         Super Smash Bros. Brawl
  DB title:          Super Smash Bros. Brawl
  ID Region:         PAL [PAL ]
  Region setting:    2 [Europe] / Jap=128 USA=128 ?=128 Eur=12,12,12,12,12,7 Kor=128
  System menu:       v258 = 3.1E
  System version:    00000001-00000024 = IOS 0x24 = IOS 36
  Partitions:            15  [encrypted, scrubbed, well signed]
  Directories:          340
  Files:               6616

  2 partition tables with 15 partitions:

    index      type    offset ..   end off   size/hex =   size/dec =  MiB  status
    ----------------------------------------------------------------------------------------
     0     part.tab     40020 ..     40030         10 =         16         2 partitions
     1     part.tab     40040 ..     400a8         68 =        104         13 partitions
    ----------------------------------------------------------------------------------------
     0.0   UPDATE 1     50000 ..   aea8000    ae58000 =  182812672 =  174  enc,signed
     0.1     DATA 0   f800000 .. 1da550000  1cad50000 = 7697924096 = 7341  enc,signed,scrub
     1.0     "HA8P" 1da550000 .. 1daff0000     aa0000 =   11141120 =   11  enc,signed
     1.1     "HA9P" 1daff0000 .. 1dbaa0000     ab0000 =   11206656 =   11  enc,signed
     1.2     "HBAP" 1dbaa0000 .. 1dc568000     ac8000 =   11304960 =   11  enc,signed
     1.3     "HBBF" 1dc570000 .. 1dd0e0000     b70000 =   11993088 =   11  enc,signed
     1.4     "HBBP" 1dd0e0000 .. 1ddc50000     b70000 =   11993088 =   11  enc,signed
     1.5     "HBCP" 1ddc50000 .. 1de718000     ac8000 =   11304960 =   11  enc,signed
     1.6     "HBDP" 1de720000 .. 1df1c8000     aa8000 =   11173888 =   11  enc,signed
     1.7     "HBEP" 1df1d0000 .. 1dfcc0000     af0000 =   11468800 =   11  enc,signed
     1.8     "HBFP" 1dfcc0000 .. 1e08a8000     be8000 =   12484608 =   12  enc,signed
     1.9     "HBGP" 1e08b0000 .. 1e1490000     be0000 =   12451840 =   12  enc,signed
     1.10    "HBIP" 1e1490000 .. 1e2490000    1000000 =   16777216 =   16  enc,signed
     1.11    "HBKP" 1e2490000 .. 1e5d38000    38a8000 =   59408384 =   57  enc,signed
     1.12    "HBLP" 1e5d40000 .. 1e8160000    2420000 =   37879808 =   36  enc,signed
    ----------------------------------------------------------------------------------------
I'm not sure if you need the additional partitions for the custom image.
 
Last edited by Wiimm,
  • Like
Reactions: CyberMario

markehmus

Well-Known Member
Member
Joined
Jul 26, 2008
Messages
1,521
Trophies
0
Age
112
Location
in the GAME
XP
1,279
Country
Canada
Hey Wiimm I've been admiring your work for quite a while. Your Mario Kart Wii projects are some of the most fun I had with Mario Kart in a long time.

3. I've replaced all the Brawl extracted files with all the modded files of Super Smash Bros Legacy. I did this via Window Explorer with a copy and paste. (Overwrite All)

after changing out the original files with the modded files ... dont you need to update the fst.bin and boot.bin with the new files sizes and what not ? fstcreator.exe click this link to download PG

then rebuild the game ?

i used to use fstcreator.exe with this .bat below, right on my removable storage, i would switch out levels on NSMBW:
Code:
@echo off
.\fstcreator.exe .\games\SMNE01\files\ .\games\SMNE01\sys\fst.bin .\games\SMNE01\sys\boot.bin
pause
 
Last edited by markehmus, , Reason: spell bad
  • Like
Reactions: CyberMario

TecXero

Technovert
Member
Joined
Apr 13, 2014
Messages
2,810
Trophies
0
Location
Mainframe
XP
1,040
Country
United States
I finally decided to start using WBFS over ISO due to switching to a smaller drive. Thank you for this great tool. It beats having to boot virtualbox to run WBM and works well.
:grog:
 

CyberMario

Well-Known Member
Newcomer
Joined
Jan 10, 2016
Messages
87
Trophies
0
Location
???
XP
191
Country
United States
I know, that most of the SSBB dumps are broken, because of the 2 partition tables.

What does "wit dump ssbb.wbfs" tell?

I'm not sure if you need the additional partitions for the custom image.

Here is my dump.

PHP:
Dump of file Super Smash Bros. Brawl.iso

  Real path:         ./wit-v2.31a-r6005 Project M ISO Builder/Super Smash Bros. Brawl.iso
  ISO file size:     1fb4e0000/hex = 8511160320 = 8117 MiB
  Scrubbed size:     1d2878000/hex = 7827062784 = 7464 MiB, 92.0%, 238863*32K
  File & disc type:  ISO/WII  &  Wii
  Disc & part IDs:   disc=RSBE01, ticket=RSBE, tmd=RSBE, boot=RSBE01
  Disc name:         Super Smash Bros. Brawl
  DB title:          Super Smash Bros. Brawl
  ID Region:         NTSC/USA [USA ]
  Region setting:    1 [USA] / Jap=128 USA=45 ?=128 Eur=128,128,128,128,128,128 Kor=128
  System menu:       v257 = 3.1U
  System version:    00000001-00000024 = IOS 0x24 = IOS 36
  Partitions:            14  [encrypted, well signed]
  Directories:          328
  Files:               6001

  2 partition tables with 14 partitions:

    index      type    offset ..   end off   size/hex =   size/dec =  MiB  status
    ----------------------------------------------------------------------------------------
     0     part.tab     40020 ..     40030         10 =         16         2 partitions
     1     part.tab     40040 ..     400a0         60 =         96         12 partitions
    ----------------------------------------------------------------------------------------
     0.0   UPDATE 1     50000 ..   abb8000    ab68000 =  179732480 =  171  enc,signed
     0.1     DATA 0   f800000 .. 1da550000  1cad50000 = 7697924096 = 7341  enc,signed
     1.0     "HA8E" 1da550000 .. 1db008000     ab8000 =   11239424 =   11  enc,signed
     1.1     "HA9E" 1db010000 .. 1dbad0000     ac0000 =   11272192 =   11  enc,signed
     1.2     "HBAE" 1dbad0000 .. 1dc5b0000     ae0000 =   11403264 =   11  enc,signed
     1.3     "HBBE" 1dc5b0000 .. 1dd138000     b88000 =   12091392 =   12  enc,signed
     1.4     "HBCE" 1dd140000 .. 1ddc20000     ae0000 =   11403264 =   11  enc,signed
     1.5     "HBDE" 1ddc20000 .. 1de6e0000     ac0000 =   11272192 =   11  enc,signed
     1.6     "HBEE" 1de6e0000 .. 1df1e0000     b00000 =   11534336 =   11  enc,signed
     1.7     "HBFE" 1df1e0000 .. 1dfd88000     ba8000 =   12222464 =   12  enc,signed
     1.8     "HBGE" 1dfd90000 .. 1e0938000     ba8000 =   12222464 =   12  enc,signed
     1.9     "HBIE" 1e0940000 .. 1e18f8000     fb8000 =   16482304 =   16  enc,signed
     1.10    "HBKE" 1e1900000 .. 1e5000000    3700000 =   57671680 =   55  enc,signed
     1.11    "HBLE" 1e5000000 .. 1e7210000    2210000 =   35717120 =   34  enc,signed
    ----------------------------------------------------------------------------------------

I have the US version of SSBB, which I suspect is the reason why the two code dumps are wildly different.

after changing out the original files with the modded files ... dont you need to update the fst.bin and boot.bin with the new files sizes and what not ? fstcreator.exe click this link to download PG

then rebuild the game ?

i used to use fstcreator.exe with this .bat below, right on my removable storage, i would switch out levels on NSMBW:
Code:
@echo off
.\fstcreator.exe .\games\SMNE01\files\ .\games\SMNE01\sys\fst.bin .\games\SMNE01\sys\boot.bin
pause

May I have more information on this process? fstcreator.exe analyses the extracted modded files and updates fst.bin and boot.bin? What's happening behind the scenes?
 
Last edited by CyberMario,

markehmus

Well-Known Member
Member
Joined
Jul 26, 2008
Messages
1,521
Trophies
0
Age
112
Location
in the GAME
XP
1,279
Country
Canada
fstcreator.exe kind of updates the games table of contents with the new files sizes before you rebuild the files to iso or wbfs

if fstcreeator.exe is on your c drive root and your game is extracted to your c drive root and the folder the extracted game is in is called ssbb then you would make the .bat like this
Code:
@echo off
c:\fstcreator.exe c:\games\SSBB\files\ c:\games\SSBB\sys\fst.bin c:\games\SSBB\sys\boot.bin
pause
 
  • Like
Reactions: CyberMario

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
fstcreator.exe is useless if creating an image with wit. Did you really believed that the image creation was done without updating the main file listing?

Another point. For wit+wwt the file format (wbfs, wdf, iso, ...) is not relevant; they are only different containers.

@CyberMario
You image looks good. Have you ever tested to extract and recompile the image without modifications?

EDIT:
See here for a list with required, optional and ignored files:
* http://wit.wiimm.de/info/composing.html#part
 
Last edited by Wiimm,

CyberMario

Well-Known Member
Newcomer
Joined
Jan 10, 2016
Messages
87
Trophies
0
Location
???
XP
191
Country
United States
You image looks good. Have you ever tested to extract and recompile the image without modifications?

EDIT:
See here for a list with required, optional and ignored files:
* http://wit.wiimm.de/info/composing.html#part

Yes I have.
...3. For good measure, I've recompiled (COPY in wit) the Brawl backup without modifying any files. The ISO that wit produced also worked on Dolphin perfectly....

Would you like to see the dump of recompiled image (no mods) as well?
 
Last edited by CyberMario,

markehmus

Well-Known Member
Member
Joined
Jul 26, 2008
Messages
1,521
Trophies
0
Age
112
Location
in the GAME
XP
1,279
Country
Canada
fstcreator.exe is useless if creating an image with wit. Did you really believed that the image creation was done without updating the main file listing?
good to know,
i always use qtwitgui and pune told me to use fstcreator , but maybe he meant just for *neek filesystem and i miss understood
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
@CyberMario
I read it, and forgot it.
If the unmodified and recompiled image works, then some of the files are bad.

From MKW I know, that some code is only running at Dolphin (Dolphin seems to be more tolerant than Wii), and other code only at the Wii (Dolphin can't emulate all CPU instructions).
 

CyberMario

Well-Known Member
Newcomer
Joined
Jan 10, 2016
Messages
87
Trophies
0
Location
???
XP
191
Country
United States
@CyberMario
I read it, and forgot it.
If the unmodified and recompiled image works, then some of the files are bad.

From MKW I know, that some code is only running at Dolphin (Dolphin seems to be more tolerant than Wii), and other code only at the Wii (Dolphin can't emulate all CPU instructions).

Alright, it sounds like putting the iso on the Wii is the only real way to test it. That's going to take some time because I don't have a Wii on me right now.

When I do get the chance to test it and if it doesn't work, is there any other suggestions you can think of?
 

person66

If it isn't edited, it isn't a true person66 post
Member
Joined
Jun 16, 2009
Messages
1,108
Trophies
0
Location
Canada
XP
415
Country
Canada
EDIT: Figured it out, its just the last 2 characters of the title id. Kinda strange, its not something I'd expect would even need to be patched in anywhere, but what do I know :P

Hey wiimm, I'm not sure if you would know the answer to this, but it is in regards to Brawl and wit's dolpatch feature. I have been looking at a bunch of custom brawl building scripts, all of them have a variable called %PC%, which is always a 2-byte hex value that gets patched at address 805A14B8. The problem is every mod uses a different value here, and I can't figure out what it is for or where they get the value from (for example, Project M 3.01 uses 504D, while 3.5 uses 4333). Any ideas?
 
Last edited by person66,

person66

If it isn't edited, it isn't a true person66 post
Member
Joined
Jun 16, 2009
Messages
1,108
Trophies
0
Location
Canada
XP
415
Country
Canada
So, new problem, still with Brawl.

If I build a Brawl ISO from a folder using wit copy, without using other parameters, the built ISO runs fine. But if I change the ID with --id, then when I try to run the ISO, I get the "Please insert the Super Smash Bros. Brawl Game Disc." screen. Any idea what I am doing wrong here? Nothing has been patched, I just extracted Brawl, then built the ISO from the extracted folder. Works if I don't change the ID, doesn't work if I do.

I guess I should also mention I am using Dolphin to test, not an actual Wii.

EDIT: Side note, if I do --id="RSBE01" (which is Brawls regular ID) then it also runs fine.

EDIT #2: Figured it out, and also figured out why the patch was needed in my previous post. So there are 2 things that need to happen for the game to not show the insert disc screen after changing Brawl's ID. First, main.dol needs to be edited. If you open it in a hex editor then at address 0x00494630, where it should originally have the text value RSBE, change it to match the new ID. The second thing only applies if the last part of your ID is not 01 (as in RSBE01). If that part is not set to 01, then you need to add a patch when loading the game (i.e. wit's dolpatch, or a Gecko code, or in Dolphin right click the game, then properties->patches tab). For the address/offset of the patch use 805A14B8, and for the value use the last 2 characters of your custom title (in hex, obviously. Also, in dolphin you have to specify that the size is a word, not a byte).

EDIT #3: Just realized that the patch for the last part of the ID could also be added directly to main.dol, at address 0x00494638. Conversely, I assume (though I haven't tested) the edit to main.dol for the first part of the ID could be applied as a patch instead, at address/offset 805A14B0
 
Last edited by person66,
  • Like
Reactions: Wiimm

osupka

Member
Newcomer
Joined
Feb 4, 2016
Messages
8
Trophies
0
Age
38
XP
70
Country
Found kind of a bug. When Wii Backup Manager removes partitions from the iso, it does not remove the address of the second partition from the partition table at 0x40028.

Before removing a partition:
c0iJ6ek.png



After removing:

KlXQAkv.png



It does not cause problems when playing the iso, because the number of partitions is set to 1. But it does leave ambiguous garbage at that space.

When I execute "wit convert game.iso --psel data" on a "2-partition" iso. The UPDATE partition gets removed and data at 0x40028 is filled with 0. When I exectue the same command on a "1-partition" iso, that garbage at 0x40028 does not get removed. That's quite an ambiguous behaviour I think.
 
Last edited by osupka,

Nickkk

Well-Known Member
Newcomer
Joined
May 25, 2012
Messages
61
Trophies
0
Website
desairem.altervista.org
XP
159
Country
Swaziland
Hi Wiimm,
some users of Witgui reported that they have problems listing WBFS partitions. I noticed that this happens when using the command wwt find --all, but everything works when finding all connected devices with diskutil list -plist and filtering out WBFS partitions when the command wwt find device runs without raising an error. Do you know what might be the cause of this problem?
 

Wiimm

Developer
OP
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
@Nickkk
Please tell me, where I have to search the partitions.

Extract from history:
Code:
wwt v0.39a r782 - 2010-03-29
...
- wwt --auto: If the file /proc/partitions is not found, than all devices
   named '/dev/sd*' and '/dev/rdisk*' are scanned for WBFS. If scanning of
   '/dev/rdisk*' fails then also files named '/dev/disk*' are scanned.
   Using character devices '/dev/rdisk*' will speed up wwt on apple computers.
 

SuperrSonic

Well-Known Member
Member
Joined
Dec 9, 2011
Messages
807
Trophies
1
XP
2,296
Country
Puerto Rico
@Wiimm is there anything else I could try to get Another Code R to be compatible with wit? I have tried so many things, yet it always crashes at the initial loading screen. No matter how much I try, it doesn't make sense to me why this game would be different from the rest. Can Japanese filenames be an issue? This game has a lot of those but dolphin indicates it crashes loading a standard file.
 

markehmus

Well-Known Member
Member
Joined
Jul 26, 2008
Messages
1,521
Trophies
0
Age
112
Location
in the GAME
XP
1,279
Country
Canada
@Wiimm is there anything else I could try to get Another Code R to be compatible with wit? I have tried so many things, yet it always crashes at the initial loading screen. No matter how much I try, it doesn't make sense to me why this game would be different from the rest. Can Japanese filenames be an issue? This game has a lot of those but dolphin indicates it crashes loading a standard file.
wit.png really wit doesn't work with Another Code R , extracted and converted with wit for me, as you can in the pic
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    SylverReZ @ SylverReZ: https://www.youtube.com/watch?v=uLN9qrJ8ESs