Homebrew Official 5.5.X ELF Loader

NWPlayer123

Well-Known Member
OP
Member
Joined
Feb 17, 2012
Messages
2,642
Trophies
0
Location
The Everfree Forest
XP
6,693
Country
United States
So, I've spent the past 4 or 5 days fiddling with this to get it to work and it finally does, allows you to load a gigantic ELF into JIT, since apparently it's 32MB (and no RPX gets that big, even uncompressed because of the data section), and I just got it working. I've only tested it on my system but it should work on others if you have the ELF in the right place. It's provided as-is, with no warranty, feel free to do as you see fit. I'll get a better ELF documentation/structuring done soon.

Technical Explanation
If you wanna know how it works, I reused some code from FIX's ELF loader in libwiiu but I had to redo the whole thing because it was giving me lots of problems. It uses the very end of MEM1 (0xF5FFFFE0-FF)
to store stuff while it works, then copies the ELF into 0xF5800000 (slightly before that), it might have trouble with bigger stuff so I'd suggest developing file loading using sockets. It uses a catch() function at the start so I can jump to it to recover ROP chains. All the ROP does is copy the loader to the very end of JIT, and then reruns all the ROP to copy sections into the start as needed and then jumps to it.

Usage
It searches for a URL with /payload, so host it somewhere with a URL like http://192.168.0.7/payload?elfloader, it'll cut off that part and load a file called boot.elf (http://192.168.0.7/boot.elf)

Downloads??
Attached is libwiiu source for the ELF loader and the Hello World ELF I used to test. You can grab the code550.bin and host it wherever. It will probably only work on 5.5.X because of the ROP. Also had MrRean help me get this working, so thanks.
 

Attachments

  • loadelf.zip
    36.9 KB · Views: 1,708
  • boot.zip
    1.1 KB · Views: 1,280
Last edited by NWPlayer123,

NWPlayer123

Well-Known Member
OP
Member
Joined
Feb 17, 2012
Messages
2,642
Trophies
0
Location
The Everfree Forest
XP
6,693
Country
United States
Would this help the development of Emulators ?
Definitely, gives you lots more room to work with
Are there any ELF files to load right now?

How can we develop them ourselves?
There aren't any now but I have plans for a whole homebrew framework, you can go look at the libwiiu source for an example https://github.com/wiiudev/libwiiu/tree/master/elfexamples/helloelf/src
Loadiine Elf ?
This could technically load in loadiine's ELF but it's not possible to run loadiine with just this because you need to patch the kernel for a bunch of stuff.
I'm probably doing something wrong. Pardon me, it's early and I'm dumb.
Let's say my server is http://22.22.22.22
It contains http://22.22.22.22/code550.bin and http://22.22.22.22/boot.elf
I opened the Wii browser, put in the address http://22.22.22.22/code550.bin and it says it can't load file.
What should I actually do.
You need to be using an exploit, yellows8 makes you create a php file which you then run, so you could have /payload?sysver=550 to load the code550.bin, or you could make it easy and use this. It'll let you put the code in /payloads, and the elf in /data (folders in the same place as the jar file), and then you can connect with /payload?elfloader (with /payload/elfloader.bin)
 

Noy2222

Active Member
Newcomer
Joined
Jan 20, 2012
Messages
28
Trophies
0
XP
170
Country
I think this goes over my head. Going to either need a much more detailed guide (don't feel the need to create one, I should probably just wait for -) or a much more script kiddie method.
 

NWPlayer123

Well-Known Member
OP
Member
Joined
Feb 17, 2012
Messages
2,642
Trophies
0
Location
The Everfree Forest
XP
6,693
Country
United States
Will this work self hosted from an ez share card?
I'm not sure how those work, but if it's not like a normal server, you're probably out of luck. Browser doesn't have access to SD card without special permissions and this is a userspace-only thing. It shouldn't be too bad to modify it to load multiple .ELF files like a full homebrew channel thing, hosted on some server.
So what can we exactly do with this .ELF loader, NWPlayer?
Anything a normal program could, sound, music, graphics, games, fonts. You can do everything from a simple media player to a full blown game (minus load times)
 
Last edited by NWPlayer123,

Flux0

Well-Known Member
Newcomer
Joined
Jan 3, 2016
Messages
94
Trophies
0
Age
44
XP
505
Country
United States
Unfortunately, no, browser doesn't have access to SD card without special permissions and this is a userspace-only thing. It shouldn't be too bad to modify it to load multiple .ELF files like a full homebrew channel thing, hosted on some server.

An ez share has a built in wifi access point to let devices connect to it. The main purpose they are marketed for is remote downloading of pictures off digital cameras. However the self contained AP along with the micro SD slot make them pretty good for self hosting stuff on the Wii U.

I was asking about if it works because it is just a fairly basic http server running there and didn't know if it needed anything beyond that.
 

NWPlayer123

Well-Known Member
OP
Member
Joined
Feb 17, 2012
Messages
2,642
Trophies
0
Location
The Everfree Forest
XP
6,693
Country
United States
An ez share has a built in wifi access point to let devices connect to it. The main purpose they are marketed for is remote downloading of pictures off digital cameras. However the self contained AP along with the micro SD slot make them pretty good for self hosting stuff on the Wii U.

I was asking about if it works because it is just a fairly basic http server running there and didn't know if it needed anything beyond that.
Oh, then yeah, that should be fine with yellows8's package.
 
  • Like
Reactions: Flux0

duffmmann

Well-Known Member
Member
Joined
Mar 11, 2009
Messages
3,966
Trophies
2
XP
2,306
Country
United States
Wasn't one of the first things done when the Wii was exploited in Twilight Princess run .elf files? I think it was, and I recall a Sega Genesis emulator being one of the first .elf files. And eventually that method led to the ability to install the homebrew channel... is that theoretically possible with this kind of thing? Would we possibly through this method be able to install a Wii U homebrew channel (if someone managed to develop one) Cuz if so, this could be freaking huge.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    I wonder if that was the point of game streaming
  • Psionic Roshambo @ Psionic Roshambo:
    But it's a dead end
  • Xdqwerty @ Xdqwerty:
    @Psionic Roshambo, people who cant download it can still play the game
  • BigOnYa @ BigOnYa:
    If your internet speeds are fast enough. Streaming 4k takes alot. I used to only have 20mb sec, and 4k struggled. Now I have 300mb sec and 4k plays fine.
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, i only have like 1 or 2 mb sec
  • BigOnYa @ BigOnYa:
    Did you feed the hamster in your internet router? It prob died and is running slow now.
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, why did you start saying my pc has a hamster in the first place?
    +1
  • BigOnYa @ BigOnYa:
    Its actua!ly just a old joke, meaning its slow. Was just kidding around with you.
    +1
  • BigOnYa @ BigOnYa:
    I bet @AncientBoi has some hamsters hidden somewhere tho....
    +2
  • Psionic Roshambo @ Psionic Roshambo:
    I think Game streaming should work like this.... Local Hardware able the run the game fine, game engine and common assets stored locally, all FMV and music and textures could be streaming
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Some temporary storage
  • Xdqwerty @ Xdqwerty:
    also @BigOnYa im making some progress on my gdevelop project, implemented various mechanics
  • Psionic Roshambo @ Psionic Roshambo:
    They went all in on streaming, should have been more of a hybrid approach
    +1
  • BigOnYa @ BigOnYa:
    Or free government supplied high speed internet be nice also. Like Obama care. Xdqwerty that's cool, its time consuming but rewarding once done or playable, to see what you've made from scratch. Animations take forever, but worth it.
    +1
  • Xdqwerty @ Xdqwerty:
    @BigOnYa, although the bullets are a bit buggy
    +1
  • Psionic Roshambo @ Psionic Roshambo:
    Not to mention this would be a massive pain to pirate
  • Xdqwerty @ Xdqwerty:
    @BigOnYa,
    and the visual aspect of the game is quite crude (the sprite that looks best is that of the protagonist just because he is a stickman with sunglasses)
    +1
  • BigOnYa @ BigOnYa:
    There is a bullets behaviour you assign to your character, that makes the code easier, under "behaviours"
  • Xdqwerty @ Xdqwerty:
    i meant that when the character is pointing to the right, the bullets spawn where they should, but when he is on the right, they move to the right but the spawn point is incorrect
  • BigOnYa @ BigOnYa:
    Itch.io has lots of free assets also. Under the bullets behavior tab, there is a "rotate bullets" option, can try that. Or in the code can try
    - fire bullet Player.X(PlayerDirection)
  • Xdqwerty @ Xdqwerty:
    im taking a break for today anyway
    +1
  • BigOnYa @ BigOnYa:
    YEa gotta after a while, looking at code for long periods will bug your eyes.
    +1
  • BigOnYa @ BigOnYa:
    That's cool tho, I'm proud of you going back to it, not giving up. It is difficult at first to learn, but fun once you get the hang of it. I think I've watched every tutorial video there is, but I still struggle sometimes to get stuff to work right. But gotta keep trying dif things, and eventually you will get it right.
    +1
    BigOnYa @ BigOnYa: That's cool tho, I'm proud of you going back to it, not giving up. It is difficult at first to... +1