Hacking USB Loader GX

  • Thread starter cyrex
  • Start date
  • Views 7,162,795
  • Replies 29,357
  • Likes 47

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
edit: I think I uploaded all of the changed files to github, if someone else wants to test and patch em in go for it. :)

Change list
Download link
Do you have a patch ?
I can copy all of them manually, but it's faster if you can provide a patch ;)

your changes are good so I'll merge them directly with the next release.
 

pBullet

SHSL Idol
Member
Joined
May 8, 2012
Messages
176
Trophies
1
Age
33
Location
Rhode Island
XP
280
Country
United States
@pBullet:
your HDD is not "entirely partitionned as FAT32".
If you have "usb2:/" it means you have at least 2 partitions.
there's maybe a hidden partition before your FAT32?

But if you are saying nintendont works fine when launched from HBC, then there's an issue with the HDD check in USBLoaderGX.
Maybe it's related to the new compatibility nintendont added recently ? Nintendont is now compatible with EBR (Extended/Logical partition, not primary only)


ahh, that could be your issue!
Do you have 2 HDD connected at the same time? if you do, then the gamecube partition is maybe not mounted in the correct order.

Though, you didn't mention 2 HDD, so maybe you really have more than one partition on your drive.
USBLoaderGX doesn't let you select USB1:/ ?

What's strange to me is that even if you had more than one partition, and if you can't select usb1:/, then it should work fine.
the loader asks you to set the gamecube partition to the "first" primary+FAT32 partition. If it doesn't list usb1 partition it means it's not a compatible one (so obviously not fAT32), making your USB2 partition the first fat32.
Maybe it's NOT primary but extended or GPT?

Like I said, Nintendont is now compatible with EBR and GBT partitions. I released a version to test that change here.
Please try it.
I will release it officially today.

Hmm, no there are no other HDDs connected to the console. I use a 500GB Toshiba HDD. It does not use external power, so I use a USB splitter to draw power from both slots on the back of the console.

I've tried alternating between having the secondary cable on Slot 1 and Slot 0, but it doesn't seem to change the issue.

mRFxObi.png


Also, I downloaded the version of GX that you linked to, and it completely fixes my problem! Kudos to you.
 
  • Like
Reactions: self_slaughter

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,515
Country
United States
Hmm, no there are no other HDDs connected to the console. I use a 500GB Toshiba HDD. It does not use external power, so I use a USB splitter to draw power from both slots on the back of the console.

I've tried alternating between having the secondary cable on Slot 1 and Slot 0, but it doesn't seem to change the issue.

mRFxObi.png


Also, I downloaded the version of GX that you linked to, and it completely fixes my problem! Kudos to you.

You have a reserved partition before your FAT32 one. I'm not sure if there's GPT support in USB Loader GX yet, either. I know there isn't in d2x cIOS.
 

pBullet

SHSL Idol
Member
Joined
May 8, 2012
Messages
176
Trophies
1
Age
33
Location
Rhode Island
XP
280
Country
United States
You have a reserved partition before your FAT32 one. I'm not sure if there's GPT support in USB Loader GX yet, either. I know there isn't in d2x cIOS.

Good catch. I actually ignored that because I thought it was required for the drive to function with its utility tool on my computer, but that is not the case. I also converted it to MBR.

wXFbexc.png


And it works great.

Though, I am curious... is one big FAT32 partition better to have than say a small FAT32 partition (that has homebrew apps, gamecube games, saves, etc) and a larger NTFS partition that has solely Wii games? The only benefit that I have seen so far is that you don't have to break up the Wii games if they're too large (iirc over 4GB). Is there a significant performance difference?
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,515
Country
United States
Good catch. I actually ignored that because I thought it was required for the drive to function with its utility tool on my computer, but that is not the case. I also converted it to MBR.

wXFbexc.png


And it works great.

Though, I am curious... is one big FAT32 partition better to have than say a small FAT32 partition (that has homebrew apps, gamecube games, saves, etc) and a larger NTFS partition that has solely Wii games? The only benefit that I have seen so far is that you don't have to break up the Wii games if they're too large (iirc over 4GB). Is there a significant performance difference?

No, there's no performance difference. When the loader sets up the cIOS to play a game it makes a list of all of the chunks of the wbfs file and sends it to the cIOS with the settings including the ".wbf1" file. The custom IOS just treats it like it's a solid stand-alone partition while the game is running.

I generally suggest FAT32 because there's not anything that doesn't support it. :)
 

self_slaughter

Well-Known Member
Member
Joined
Apr 27, 2009
Messages
105
Trophies
0
XP
246
Country
Do you have a patch ?
I can copy all of them manually, but it's faster if you can provide a patch ;)

your changes are good so I'll merge them directly with the next release.

Try this, I just ran "diff - Naur ./1261 ./1262 > triforce.patch"
If that's no good to you let me know how you want it and I'll try again. :)

http://www.mediafire.com/file/bybc0l8865zbh8g/triforce.patch

edit: wrong patch, reuploaded.

Also, if you get time to have a quick look: after downloading covers the loader only displays GameCube games instead of your selected categories until you re-sort/reload the list. ;)
 
Last edited by self_slaughter,

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
GPT works fine with Wii games and d2x.
I don't remember if it works with EmuNAND.
It "now" works with Nintendont too. like I said, I updated USBGX to support GPT and EBR (extended+logical) partitions. But your issue was not the GPT, but the fact that you had a hidden and reserved partition before the FAT32 partition.

You just formated it the best way you could (1 single primary, FAT32 partition)! have fun now.

@self_slaughter :
thank you!
I'll take a look at the cover issue, I thought it had a "restore previously selected" code.
it's disabling all filters to download all covers, then re-enable it. Maybe it re-enable only gamecube? But I often download covers and didn't notice that behavior.
Well, I'll check!
thanks.
edit: the patch doesn't work with tortoiseSVN, but don't worry it's easy to fix. It seems the header is not the same format it's expecting.
 

danuota

Member
Newcomer
Joined
Feb 3, 2016
Messages
7
Trophies
0
Age
50
XP
67
Country
Italy
Last edited by danuota,

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
I uploaded r1262:
http://www.mediafire.com/file/eumm525jmrij6zp/R1262.7z
* Fixed compiling meta.cpp under linux/mac

* Removed Neek2o warning when using SD card on Wii.
* Added A button to exit credit page (self_slaughter)

Nintendont:
* Updated to Config to v7 (Nintendont v4.424+) (self_slaughter)
* Added Triforce Arcade mode option (self_slaughter)
* Added compatibility for GPT and EBR partition type (v3.400+)


I removed the B button to exit categories because it was already assigned to another event (Scrolling the page!).
I kept your A button to exit the credits. There's currently no action tied to it, so it's fine. if I need more page later I could set A to switch pages, but for the moment it's fine to use it to exit.
I moved Triforce option but it's only a visual change for the user.

I forgot to look at the cover issue.

edit:
@Badablek
I forgot to increase the EmuNAND path check to work with usb:// !!
sorry :P

did you rename your path and make it work?
 

self_slaughter

Well-Known Member
Member
Joined
Apr 27, 2009
Messages
105
Trophies
0
XP
246
Country
Ahhh ok, I only have two categories... "All & Hidden" so I would never of noticed that it even scrolls!

I just thought it was a bit difficult to back out when you accidentally hit categories instead of the sources icon using a control pad. ;)


Sent from my Nexus 5 using Tapatalk
 

WuaZ

Active Member
Newcomer
Joined
Mar 17, 2015
Messages
26
Trophies
0
XP
262
Country
France
The latest dol forwarder (5.1) seems not to desactivate AHBPROT when used with the latest release of Priiloader (0.8.1). Indeed, I observed the following behaviour with my Wii
1) Priiloader v0.7 autobooting ForwarderV5.1.dol -> no issue with Nintendon't
2) Priiloader v0.8.1 autobooting ForwarderV5.1.dol -> impossible to start Nintendon't from USB Loader GX. If I try to start a NGC game, I have an AHBPROT error (please start Nintendon't from HBC or update your channel). If I try to start Nintendon't from the homebrew menu in USB Loader GX -> error at startup ("check that your meta.xml contains ahbaccess", which is the case)
3) Priiloader v0.8.1 autobooting ForwarderV5.1.dol then leaving USB Loader GX to System Menu and starting it again using the wad Loader (UNEO) -> no issue with Nintendon't

I tried two versions of Nintendon't : 3.3xx and 4.4xx and I tried both with d2x v10-beta-52 and v10-beta-53-alt.

Do you think there is an issue in the dol forwarder or in Priiloader 0.8.1? I guess in Priiloader but I would like to be sure.
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,515
Country
United States
Are you sure you're using the right file? This is the one intended for that purpose: https://sourceforge.net/projects/usbloadergx/files/Releases/Forwarders dols/ForwarderV5.1.dol/download

I use it to boot straight to GX and it still worked fine with Gamecube games. It does require you have IOS58 like Nintendont.

USB Loader GX should tell you in the credits screen if AHB_PROT is disabled.

It's possible you have the wrong file installed in Priiloader or you have the full GX channel (UNLR) installed on your NAND, too.
 
Last edited by GreyWolf,

WuaZ

Active Member
Newcomer
Joined
Mar 17, 2015
Messages
26
Trophies
0
XP
262
Country
France
Yes I am using ForwarderV5.1.dol (to install in Priiloader), I have the latest release of USB Loader GX in my SD and the wad forwarder (UNEO) in my NAND. Everything is working fine with Priiloader 0.7 (which is unable to deactivate AHBPROT for dol) but not with Priiloader 0.8 (which is able to deactivate AHBPROT for dol). From my understanding, with Priiloader 0.7, the dol forwarder is loaded without AHB access, it deactivate AHBPROT and start USB Loader GX with AHB access. I do not understand what is happening with Priiloader 0.8.1.
 

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
Users had to install the forwarder dol instead of the loader's dol with Priiloader 0.7 because it didn't provide AHB access.
I think 0.8 is providing AHB to the boot dol, so you could try to install USBLoaderGX boot.dol instead of the forwarder.

But I don't know why the forwarder wouldn't work the same way than with 0.7
in fact, I never even understood why the forwarder dol worked at all. the forwarder dol doesn't disable AHBPROT, it's the forwarder channel which does it.

Priiloader still doesn't have an option to autoboot an installed channel instead of an installed dol?
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,515
Country
United States
Users had to install the forwarder dol instead of the loader's dol with Priiloader 0.7 because it didn't provide AHB access.
I think 0.8 is providing AHB to the boot dol, so you could try to install USBLoaderGX boot.dol instead of the forwarder.

But I don't know why the forwarder wouldn't work the same way than with 0.7
in fact, I never even understood why the forwarder dol worked at all. the forwarder dol doesn't disable AHBPROT, it's the forwarder channel which does it.

Priiloader still doesn't have an option to autoboot an installed channel instead of an installed dol?

It does, but if you update only the copy in the apps folder gets updated. Priiloader will still launch the old one that's installed in the system menu folder.

EDIT:

0.8 : DacoTaco's Meh (29 July 2015)
  • Fixed Gc controller when updating
  • Fixed some DVD drive accessing bugs
  • Fixed some changelog displaying issues
  • added support for the new HBC
  • check apps on USB if SD has none
  • changed magicword to 0x817FEFF0 (for techinical reasons. old magicwords still work; but it is recommended to switch)
  • fixed random small bugs
  • new libogc -> new wiimotes supported
  • fixed loading compressed dols
  • fixed title menu crash
  • fixed installer some more
  • Dropped language mods.
  • set black background as default
  • added argument + ahbprot support for dols
  • all dols use IOS 58,61 or 38(with ahbprot)
  • EasterEgg removed
  • Gecko output will now be dumped to fat:/prii.log
AHB_PROT disable for all dols was added in 0.8.0 so the forwarder dol should be getting full access when it launches.
 
Last edited by GreyWolf,
  • Like
Reactions: cvskid

WuaZ

Active Member
Newcomer
Joined
Mar 17, 2015
Messages
26
Trophies
0
XP
262
Country
France
Users had to install the forwarder dol instead of the loader's dol with Priiloader 0.7 because it didn't provide AHB access.
I think 0.8 is providing AHB to the boot dol, so you could try to install USBLoaderGX boot.dol instead of the forwarder.
I agree with GreyWolf: if I do that, the dol booted by Priiloader won't be updated, because the installed dol will be copied in NAND.

But I don't know why the forwarder wouldn't work the same way than with 0.7
in fact, I never even understood why the forwarder dol worked at all. the forwarder dol doesn't disable AHBPROT, it's the forwarder channel which does it.

If the dol forwarder doesn't disable AHBPROT, how can it work? Is it launching the forwarder channel, which disable AHBPROT and start USB Loader GX? Is it using the HBC to start USB Loader GX? I remember trying to boot homebrews directly with Letterbomb starting the dol forwarder (I put the homebrew I wanted to start in the USB Loader GX folder) on unmoded Wii (no HBC, no cIOS) and the homebrew was starting but failing to get AHB access.

Priiloader still doesn't have an option to autoboot an installed channel instead of an installed dol?

No, you can only start the HBC, the System Menu or an installed file (dol).

AHB_PROT disable for all dols was added in 0.8.0 so the forwarder dol should be getting full access when it launches.

It is what is strange in this case : Priiloader 0.7 should not be able to deactivate AHBPROT, dol forwarder should not be able either (according to Cyan's post above), but it works. Priiloader 0.8.1 should be able to deactivate it, so as long as the dol forwarder does not reinstate AHBPROT it would work, but it doesn't.

Edit : another question : I'm using USB Loader with cIOS 249 slot (d2x v10 installed on it). So from my understanding, USB Loader GX should boot using cIOS 249, which doesn't need AHB access since it has already USB and NAND accesses via the cIOS. When loading an homebrew using no cIOS, USB Loader GX should deactivate AHBPROT, isn't it? Or should AHBPROT be deactivated at USB Loader GX's launch time (and it doesn't reactivate it when loading the cIOS)?
 
Last edited by WuaZ,

Cyan

GBATemp's lurking knight
Former Staff
Joined
Oct 27, 2002
Messages
23,749
Trophies
4
Age
45
Location
Engine room, learning
XP
15,649
Country
France
You are right. you knows it well :)

I never checked what the forwarder dol is doing (I'm not the one who compiled it). I always assumed it was the boot.dol of the forwarder v5.1 that we are injecting into a channel.
It makes more sense to provide that forwarder's compiled dol as it's part of the sources.

But AHB is not something which can be disabled from a program, it's a flag in the tmd of a launched title (disc, or channel), or by some unknown hack (HBC booting). I don't know how Prii0.8 is getting it.
The only way that forwarder.dol can disable the protection is by launching the installed forwarder channel instead of being the forwarder code to load the loader. But I can't imagine previous developers releasing a dol to load a channel to load the loader.

I could test on vWii! I don't have the forwarder installed, so if it doesn't boot the loader it means it's trying to launch the channel.
it if boots the loader, then I don't know how AHB access is provided.


Once AHB access is available (AHBPROT disabled), USBLoader can keep that access right when reloading to another IOS.
so if you boot from HBC (which provides AHB access), or from the forwarder, the loader keeps AHB enabled for the launched homebrew : nintendont, Wiimc, emulators, etc.
It does it automatically, regardless of which IOS you use (58 or cIOS), as long as HBC or forwarder provided it, it keeps it.

If you boot from priiloader 0.7 with cIOS, like you said you already have NAND/ES/USB access patched so it doesn't rely on AHB to access these devices, but it can't (or shouldn't) provide AHB to launched homebrew when reloading to IOS58.

Maybe I'm not understanding it correctly?
Before I add IOS58 support for the loader, it already had functions to reload IOS keeping rights. Maybe it's only keeping the NAND or USB rights but doesn't set the AHB flag? so nintendont which checks only the flag to know if it has USB access is failing while it could access usb without AHB due to cIOS rights passed to 58?
But the code works by disabling Mem2 prot before reloading the IOS, which I think requires AHB? so maybe cIOS have ahb access? if that's the case, loading cIOS first and reloading to 58 should work to launch any homebrew with AHB access.

That still doesn't explain why Priiloader0.8 stopped working nor why 0.7 works with the forwarder dol.

Someone will have to explain to me, because I never understood where AHB come from when launching the forwarder.dol without the channel.
 

GreyWolf

Well-Known Member
Member
Joined
Mar 2, 2015
Messages
5,399
Trophies
0
Age
54
XP
1,515
Country
United States
I'm looking at the forwarder code right now. It looks like it's linked with either the HBC's app_booter.bin (or FIX94's version) and there is no reference to AHBPROT in the source at all. Looking at Priiloader's source it looks like it's disabling AHBPROT when it boots a dol as the log states. It could be something in GX's code that isn't passing the bit on to other homebrew.

@Cyan Any idea what magic_patcher.o actually does? I can't find the source for it anywhere and the loader source doesn't really say anything about it.
 
Last edited by GreyWolf,

WuaZ

Active Member
Newcomer
Joined
Mar 17, 2015
Messages
26
Trophies
0
XP
262
Country
France
I did more tests today and I found a way to have the forwarder working with Priiloader 0.8.1 (even if I still do not understand why it is working). Here are the different tests I did:
1) Priiloader 0.7 + ForwarderV5.1.dol at the root of the SD
I installed the forwarder.dol and when Priiloader boots it, USB Loader GX starts with AHB access (according to credits and to Nintendon't)
2) Priiloader 0.8.1 + ForwarderV5.1.dol at the root of the SD (both cases: fresh install of Priiloader 0.8.1 or update from 0.7 with the .dol already install)
I installed the forwarder.dol and when Priiloader boots it, USB Loader GX starts without AHB access (according to credits and to Nintendon't)
3) Priiloader 0.8.1 + ForwarderV5.1.dol in a dedicated folder in app folder, renamed boot.dol with a dedicated meta.xml requesting AHB access (<ahb_access/>)
upload_2016-10-22_15-48-29.png


upload_2016-10-22_15-49-33.png


I installed it and now USB Loader GX is autobooted with AHB access (according to credits and to Nintendon't).

I still don't understand why it is working with Priiloader 0.7 without requesting AHB access, so I will continue to look for an explanation (because I would like to understand what is granted AHB access in the forwarder).

Edit (additional test): launch the .dol forwarder from the HBC without requesting AHB access (so no <ahb_access/> in the meta.xml) -> USB Loader GX starts withtout AHB access, so it confirms the .dol forwarder is not able to grant AHB access.
 
Last edited by WuaZ,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    I @ idonthave: :)