Hacking Wii backup Manager for Windows

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
@Cyan
I checked the code again. I should've done that before my reponse.
smile.gif


The partition type in the MBR should be set correctly, unless something blocks it. I've added a check so the format will fail if the MBR isn't updated correctly.

What about the anti-virus option in the CMOS, could that block the MBR update or is that only for the system drive?

Is it possible that the drive you used was initialised using a GUID partition table instead of MBR?



The code doesn't handle that. I'm not even sure if USBLoaderGX can use drives with the GPT. This could be where the real problem is. I'll try to add code to update the GPT, it shouldn't be too difficult.

If it is a problem with the GPT, it would explain why using another partition manager would fix it since they probably use MBR by default.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
46
Location
Engine room, learning
XP
15,661
Country
France
Thank you for your quick answer
smile.gif


unfortunately, it wasn't my drive so I can't test it myself.
It was a user report that the drive was detecting NTFS instead of FAT32 with USBLoaderGX, after using Wii Backup Manager to format his drive to FAT32.

Dimok changed the way the loader is detecting the partition format (on r1027), so now it's detecting the correct one, and he said it might be because the MBR wasn't updated after the partition format.
I just reported the issue here for you to check if it was really a bug or not, so you could fix it (if needed).

maybe we could test it with the GX revision 1026 (though, I don't have a spare HDD to format it).
 

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
I've added a quick and easy check to see if the drive does use the MBR. If it's GPT or RAW, then the format will fail. So the user would need to convert it to an MBR disk.

I would add support for the GPT, but I can't find any info on the GUIDs needed for the PartitionType and PartitionID.

There's a lot of things that could cause the MBR not to be updated. A couple of them would be that the version of WBM was from before I added the fixes for Vista/Win7 or it didn't have admin rights. Because it's detected as NTFS instead of FAT32, those are the 2 most likely things.

It used to have that problem because of the security in Vista/Win7. I actually saw it for myself, where the drive was still considered as NTFS even in Windows.

I really need to test myself with the version of GX that had the error but I don't have another USB drive just now either.
smile.gif
I'll do it as soon as I can.
 

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
I've tested the FAT32 format and the MBR is definitely updated here. I've also added support for GUID partition tables, although generally nothing needs updated in the GPT because the filesystem info isn't stored there.

If using a GPT, the filesystem should be determined from the partition's boot record (the BIOS parameter block), not the MBR because it doesn't contain valid filesystem information.

Edit: I just checked a freshly formatted NTFS partition using Windows and a GPT. The partition type read from the MBR is definitely wrong because it's supposed to be read from the BPB like I mentioned.

I'm not sure what happened with the user, but the values are getting written and read back OK here.

It made me think though. When formatting to WBFS, the MBR isn't updated. When reading back the partition info, it still shows as NTFS. That's a bit obvious because there's no code in place to update the MBR. I tried to add that, but for some reason it fails every time. It's not really a problem because there's no valid boot record, so it's just consider it as invalid or RAW.
 

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
@toss01
I think I know what the problem is now. With all the farting about with partition types in the MBR, I discovered that if it's set to something that Windows doesn't handle, ie. ext3, then it shows in disk management as a healthy partition instead of RAW. Apart from showing up there, Windows completely ignores the partition.

That leaves 3 possibilities.

1. The MBR is corrupt.
2. Whatever formatted the partition to WBFS changed the partition type in the MBR.
3. The original filesystem was something that Windows doesn't handle.

Since formatting to WBFS doesn't usually set the partition type in the MBR, number 3 is the most likely situation.

I came across a technique to brute force check for valid drives, which would make your drive show up. I'll try to get that included for the next release.

I've also added code to change the partition type to 0x07 (PARTITION_IFS) when formatting to WBFS so this doesn't happen in future. Doing this means that a drive letter can be assigned if needed.
 

toss01

Well-Known Member
Newcomer
Joined
Sep 13, 2009
Messages
54
Trophies
0
XP
83
Country
Thanks fig2k4

That does sound like what has happened,

I'll wait to your fix comes out and let you know.

Like I said, over a year and a half ago I used Gparted to create a blank partition then config usb loader formatted it automatically when I turned it on, so whether back then it wasn't assigning a MBR I'm not sure
 

Meneertje

New Member
Newbie
Joined
Jan 6, 2011
Messages
2
Trophies
0
XP
1
Country
Netherlands
Hi,

Greeeeat work!

Everything (apart from the below) is working so much better then other managers, the support for all the filesystems mixing and matching, copying from everywhere to anywhere etc, awesome.

However Ive found one maaajor annoyance in how to select games, that is not being able to CTRL click click click or click shift click etc to select multiples or ranges of games (like click the top NTSC game in list, hold shift then click bottom NTCS to select them all). Also it would be nice to be able to not just load the .sel files but also be able to merge them like 'Sports.sel and Adventure.sel' to load BOTH lists instead of one cancelling out the other. Can think of some similar things but these would be a GREAT addition.
 

smuddge

Well-Known Member
Newcomer
Joined
Jan 13, 2009
Messages
74
Trophies
0
XP
205
Country
United States
@fig2k4
fantastic work you have done here! this is such a superior app to all others in the disk backup management utility category!! Love it

selection option ctrl or shift to select groups of files would be great. with this and images i see no reason to use any other app

can't wait for next release!

thanks for all your hard work
 

dexter222

Well-Known Member
Member
Joined
Apr 19, 2009
Messages
337
Trophies
0
Location
Land of Fruits and Nuts
XP
195
Country
United States
Cyan said:
Thank you for your quick answer
smile.gif


unfortunately, it wasn't my drive so I can't test it myself.
It was a user report that the drive was detecting NTFS instead of FAT32 with USBLoaderGX, after using Wii Backup Manager to format his drive to FAT32.

Dimok changed the way the loader is detecting the partition format (on r1027), so now it's detecting the correct one, and he said it might be because the MBR wasn't updated after the partition format.
I just reported the issue here for you to check if it was really a bug or not, so you could fix it (if needed).

maybe we could test it with the GX revision 1026 (though, I don't have a spare HDD to format it).


Actually, Cyan, I have to use another program to format my larger drives to FAT32 as Wii backup manager will not do it. It formats it NTFS instead. Wasn't the issue only on large (1tb plus) partitions? As I recall, it works fine on smaller drives.

I also noticed that Wii backup manager fails to format WBFS on larger partitions as well. WBFS may actually prove useful on using the 3tb drives as Seagate makes it all work in the MBR by making the sector size 4096 by default (otherwise it would have a partition limit of about 2.2tb). This would also defeat the 500 file limitation as it is based on the sector size. Unfortunately the 3tb drive would fail to accept files after about the first 20 or so.

WBFS may prove to be the only way for a Wii to even see the 3tb seagates.

If I can find a WBFS utility that will correctly format a 3tb seagate drive I will run more tests (like throw a thousand games on it and see if it works on any loaders).

BTW Will backup manager is great
smile.gif
it's the only utility I use on windows (except to format drives). Thanks for your hard work!
 

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
@Meneertje and smuddge
I can see the point of the extended seletion, but I find it really annoying when I've spent a few minutes selection files and then something stupid happens and everything gets deselected (like me being an idiot forgetting to hold ctrl.
smile.gif
).

How about a hybrid approach.. You could use extended select to highlight items (using ctrl or shift), then in the menu there could be an option to "add to selection" and "remove from selection". That way you can quickly highlight some items, add them to the selection, then do whatever you want knowing that all the items are checked/ticked and safe from accidental deselection.

@dexter222
Actually, Cyan, I have to use another program to format my larger drives to FAT32 as Wii backup manager will not do it. It formats it NTFS instead. Wasn't the issue only on large (1tb plus) partitions? As I recall, it works fine on smaller drives.
It sounds like you used an older version of WBM when I thought using the Windows API for FAT32 formatting was a good idea. Obviously Windows decided to just format as NTFS on larger drives. I switched back to using the FatFormat32 code. You could try the current release or wait for the next one which should be up in a day or 2 hopefully, which has added support for GPT disks.

I also noticed that Wii backup manager fails to format WBFS on larger partitions as well. WBFS may actually prove useful on using the 3tb drives as Seagate makes it all work in the MBR by making the sector size 4096 by default (otherwise it would have a partition limit of about 2.2tb). This would also defeat the 500 file limitation as it is based on the sector size. Unfortunately the 3tb drive would fail to accept files after about the first 20 or so.
Without any more info or a way to test a 3TB drive, I can't really help much just now. Windows won't let me create a dynamically expanding 3TB VHD, even though I could use common sense to never use more than the real drive space available. If I could find something to create that VHD, I could test it like I was using a real drive. I'll have a look for some virtual drive software that might let me do some testing..

I know that CFG has added support for drives with a sector size of 4096. That could probably format the WBFS drive OK.

You realise that if this 3TB drive is using GPT, then the real problem all along was that USBLoaderGX reading the partitions wrong?
smile.gif
Now that it's reading the partition boot sector to get the file system info, instead of the MBR, it'll work fine with GPT disks. (I just had to come to some kind of conclusion after all the investigation.
smile.gif
)
 

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
http://gbatemp.net/t185428-inside-wbfs?vie...t&p=2330449
Has there been any advancements here? Can loaders handle the sector size being different from the physical size?

WBM should already format WBFS OK when the physical sector size is different from 512, that's one of the first bugs I found in libWBFS while I was converting it. Because I can't test with a 3TB drive I can't tell what the problem is there.

While testing in the past, I've also changed the sector size like you mentioned and could make it possible to choose the size from the format dialog if loaders support this trick.

Duh, I just had a thought. When formatting WBFS, I can easily change the sector size and count to emulate a 3TB drive to test that way. If it formats OK, there's no reason for it not to work with the real drive.
 

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country

Wiimm

Developer
Member
Joined
Aug 11, 2009
Messages
2,292
Trophies
1
Location
Germany
Website
wiimmfi.de
XP
1,519
Country
Germany
fig2k4 said:
WBM should already format WBFS OK when the physical sector size is different from 512, that's one of the first bugs I found in libWBFS while I was converting it. Because I can't test with a 3TB drive I can't tell what the problem is there.
First this is a good hint for me to implement the auto detection too. And for testing I use sparse wbfs files. I just create a 3TB file and format it (both with the wwt command INIT). After formatting it consumes only 12K.

About advancements: I don't know. (not interested because I own only 60-70 games)

Last not least: A drive formated with sector size 4096 have 4084 (=4096-12) slots.
 

fig2k4

Well-Known Member
OP
Member
Joined
Oct 30, 2009
Messages
758
Trophies
0
Location
Scotland
Website
www.wiibackupmanager.co.uk
XP
174
Country
I wasn't quick enough editing the post then
smile.gif


Last not least: A drive formated with sector size 4096 have 4084 (=4096-12) slots.
I was stepping through the code when I said 16000, the next line of code brings it down to 4084 because of the limit due to the sector size.
smile.gif


It's a pain in the ass not having a spare drive to test in the loader. I recently formatted my drive to NTFS and forgot to leave a couple of small test partitions on it.
 

ChaosEnergy

Well-Known Member
Member
Joined
Jul 11, 2009
Messages
201
Trophies
0
XP
215
Country
Gambia, The
you know there are tools to shrink your partition, so you can create test partitions, withoput loosing data (except if you have a wbfs partition..)
 

oggzee

Well-Known Member
Member
Joined
Apr 11, 2009
Messages
2,333
Trophies
0
XP
188
Country
Slovenia
Wiimm said:
A short view into the cfg loader sources tells me that CFG supports different hdd sector sizes and I will test it in the next days. The best is to ask oggzee.
Indeed cfg works fine with a 4k sector size disk with a MBR WBFS partition.
There are people that confirmed this.
For example:
http://gbatemp.net/t147638-configurable-us...t&p=3370638
note: it was already working in versions up to 61, then it was broken in 62 and fixed again in 63 ...

fat probably won't work with 4k because in libfat it's hardcoded to use 512, that would need to be fixed.
i haven't checked libntfs, but i assume it might need tweaking as well..
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    SylverReZ @ SylverReZ: @The Real Jdbye, :creep: