Hacking Sad, unfinished port of an ELF loader.

brienj

Trying to avoid getting cancer
Member
Joined
Jan 3, 2016
Messages
1,232
Trophies
0
Website
twitter.com
XP
2,142
Country
United States
Please try the Hello World example I compiled. The elfloader just quits if it can't find the payload so we don't know if it really works. http://josamilu.de/wiiu/boot.elf
I finally tested this, and I am using your elf file, but I was also getting the "leaddr fails" error. I've fixed that error, but now I get a "leaddr response 200". I'll have to look at this some more later.
 

bonx

Member
Newcomer
Joined
Jan 15, 2016
Messages
18
Trophies
0
XP
178
Country
Germany
I finally tested this, and I am using your elf file, but I was also getting the "leaddr fails" error. I've fixed that error, but now I get a "leaddr response 200". I'll have to look at this some more later.
Leaddr response 200 is in html everthing loaded successfull. Correct me if im wrong
 

brienj

Trying to avoid getting cancer
Member
Joined
Jan 3, 2016
Messages
1,232
Trophies
0
Website
twitter.com
XP
2,142
Country
United States
Leaddr response 200 is in html everthing loaded successfull. Correct me if im wrong
That's what I thought, so either it did work, and the example elf I downloaded isn't compiled correctly, or something else is wrong, because nothing happened, except that message on the screen.
 

eliboa

Well-Known Member
Member
Joined
Jan 13, 2016
Messages
157
Trophies
0
XP
1,257
Country
France
I committed a possible fix. Redownload the github branch and try again.
I tested it. No more errors from cURL lib but a beautiful freeze on white screen. it looks like the issue is beyond the downloading part.
I'll try to debug it later.
 

Onion_Knight

Well-Known Member
Member
Joined
Feb 6, 2014
Messages
878
Trophies
0
Age
45
XP
997
Country
I finally tested this, and I am using your elf file, but I was also getting the "leaddr fails" error. I've fixed that error, but now I get a "leaddr response 200". I'll have to look at this some more later.
Leaddr response 200 is in html everthing loaded successfull. Correct me if im wrong
That's what I thought, so either it did work, and the example elf I downloaded isn't compiled correctly, or something else is wrong, because nothing happened, except that message on the screen.


If you read the source code, his message isn't clear there, Its actually an error on anything that ISN'T a HTTP 200 OK msg. I've gotten it to work and download the elf. if you really want to see whats occuring there, I suggest you do the following
Code:
  int resp = 404;
   curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &resp);
   if(resp != 200){
     char msg[128];
     __os_snprintf(msg,128, "URL: %s\nResponse Code: %d", buf, resp);
     OSFatal(msg);
   }

Here's mine compiled into an mp4. Just save your boot.elf in the same directoy with the mp4 and the index.html and it will properly fetch your elf. There are some issues with example elf, it doesn't load so I don' t know if its the elf loader or the elf. I'll keep going through the code till I get it worked out and than I'll provide working source and a working example.

EDIT: As for what IS Occurring is here, its pretty clear. Your 90% likely getting a 404 File Not Found error. The best way to fix this, is figure out where its actually requesting the file. You can look at your apache logs, or what I usually do is watch the traffic with wireshark on my server. That way I can see the request itself come in. I've found that using the php script can have some issues with elf resolution if you don't know where to put your files. So if you aren't running apached or famliar with it, the mp4 will be easier for you. To test, I ran my tests with mp4 and that index.html and a boot.elf with pythons simple http server and it worked every time to find and download the file.
 

Attachments

  • 550elf.zip
    2.8 KB · Views: 101
Last edited by Onion_Knight,

NWPlayer123

Well-Known Member
Member
Joined
Feb 17, 2012
Messages
2,642
Trophies
0
Location
The Everfree Forest
XP
6,693
Country
United States
If you read the source code, his message isn't clear there, Its actually an error on anything that ISN'T a HTTP 200 OK msg. I've gotten it to work and download the elf. if you really want to see whats occuring there, I suggest you do the following
Code:
char msg[64];
__os_sprintf(msg, 64, "Error: %s\nHTTP Response: %d", buf, resp);
OSFatal(msg);

Here's mine compiled into an mp4. Just save your boot.elf in the same directoy with the mp4 and the index.html and it will properly fetch your elf. There are some issues with example elf, it doesn't load so I don' t know if its the elf loader or the elf. I'll keep going through the code till I get it worked out and than I'll provide working source and a working example.

EDIT: As for what IS Occurring is here, its pretty clear. Your 90% likely getting a 404 File Not Found error. The best way to fix this, is figure out where its actually requesting the file. You can look at your apache logs, or what I usually do is watch the traffic with wireshark on my server. That way I can see the request itself come in. I've found that using the php script can have some issues with elf resolution if you don't know where to put your files. So if you aren't running apached or famliar with it, the mp4 will be easier for you. To test, I ran my tests with mp4 and that index.html and a boot.elf with pythons simple http server and it worked every time to find and download the file.
It's probably the ELF loader, specifically the ROP, you'd need to refind the ROP address in memory from yellows8's stuff, I'll attempt that for 550 after I sleep, I rewrote everything up to ROP and it works perfectly so you just need to setup the last part, copying and executing. The ELF is self contained (IE all addresses are within the blob) and the load_elf_image or w/e copies the 4 defined hardcoded functions from coreinit (OSDynLoad_Acquire and FindExport, OSFatal, and __os_snprintf) to the last tiny section of MEM1 (that's what the 0xF5FFFFEC is) which the ELF then uses when it sets up, so it isn't a problem with the ELF.
 

Attachments

  • ELFLoader0.7z
    14.8 KB · Views: 112

Onion_Knight

Well-Known Member
Member
Joined
Feb 6, 2014
Messages
878
Trophies
0
Age
45
XP
997
Country
It's probably the ELF loader, specifically the ROP, you'd need to refind the ROP address in memory from yellows8's stuff, I'll attempt that for 550 after I sleep, I rewrote everything up to ROP and it works perfectly so you just need to setup the last part, copying and executing. The ELF is self contained (IE all addresses are within the blob) and the load_elf_image or w/e copies the 4 defined hardcoded functions from coreinit (OSDynLoad_Acquire and FindExport, OSFatal, and __os_snprintf) to the last tiny section of MEM1 (that's what the 0xF5FFFFEC is) which the ELF then uses when it sets up, so it isn't a problem with the ELF.

Yeah, I confirmed that last night when I verified the handle coreinit. once that was verified, all the other offsets were good. I'm also up to the at this point, but I'm off to work in few minutes. So either way, someone will have it done soon.
 
  • Like
Reactions: canariobr

brienj

Trying to avoid getting cancer
Member
Joined
Jan 3, 2016
Messages
1,232
Trophies
0
Website
twitter.com
XP
2,142
Country
United States
If you read the source code, his message isn't clear there, Its actually an error on anything that ISN'T a HTTP 200 OK msg. I've gotten it to work and download the elf. if you really want to see whats occuring there, I suggest you do the following
Code:
  int resp = 404;
   curl_easy_getinfo(curl_handle, CURLINFO_RESPONSE_CODE, &resp);
   if(resp != 200){
     char msg[128];
     __os_snprintf(msg,128, "URL: %s\nResponse Code: %d", buf, resp);
     OSFatal(msg);
   }

Here's mine compiled into an mp4. Just save your boot.elf in the same directoy with the mp4 and the index.html and it will properly fetch your elf. There are some issues with example elf, it doesn't load so I don' t know if its the elf loader or the elf. I'll keep going through the code till I get it worked out and than I'll provide working source and a working example.

EDIT: As for what IS Occurring is here, its pretty clear. Your 90% likely getting a 404 File Not Found error. The best way to fix this, is figure out where its actually requesting the file. You can look at your apache logs, or what I usually do is watch the traffic with wireshark on my server. That way I can see the request itself come in. I've found that using the php script can have some issues with elf resolution if you don't know where to put your files. So if you aren't running apached or famliar with it, the mp4 will be easier for you. To test, I ran my tests with mp4 and that index.html and a boot.elf with pythons simple http server and it worked every time to find and download the file.
Edit: After further testing and adding the code to display the actual error message, it was indeed a file not found error. I found out I did not have an elf file MIME type configured in my web server, I'm a DERP. But now, it seems to load the boot.elf file, but then the screen is just white, like the elf didn't load correctly. No errors, since it was finding the elf file now, it just hangs after loading it. At this point, I don't know if it is the loader or the elf file. I used the elf file that josamilu provided. As long as that is definitely a good elf file for 5.5 firmware, then the loader is not loading it at the correct address, or so I assume. I guess I will try to compile another elf file, and if that doesn't work, I'll wait until someone can confirm that josamilu's elf file is indeed a good elf file or not. Then I will know where the problem is.
 
Last edited by brienj,

drewl

Member
Newcomer
Joined
Jan 18, 2016
Messages
19
Trophies
0
Age
53
XP
60
Country
United States
I asked NWPlayer123 about that, and she said that Loadiine on 5.5.1 won't work until the IOSU exploit is released.
nonsense, nothing to do with iosu, the devs don't want make loadiine at 55+. Why? many reasons: the promised iosu, other possible hacks, laziness)) I'm sure is possible make loadiine for 55+ a couple of hours, just need good dev.
 
  • Like
Reactions: tomman321

DeslotlCL

GBAtemp's scalie trash
Member
Joined
Oct 28, 2015
Messages
2,847
Trophies
0
XP
2,755
Country
United States
so basically the elf loader is a way to load homebrew from the sd instead of using the web browser? (though you still need to use the browser)
 
Last edited by DeslotlCL,

josamilu

Well-Known Member
Member
Joined
Feb 1, 2015
Messages
383
Trophies
0
Location
Saturn is better than Jupiter :P
XP
319
Country
Gambia, The
I will be back tomorrow and will then look further into the elf loader. Also I don't think that there is a problem with the elf file, but I will compile it again and see if there are any differences.
so basically the elf loader is a way to load homebrew from the sd instead of using the web browser? (through you still need to use the browser)
Atm the elf loader loads the payload from a Webserver, but it i'm sure that it can also be loaded from SD with a bit of rewriting.
 

The Real Jdbye

*is birb*
Member
Joined
Mar 17, 2010
Messages
23,321
Trophies
4
Location
Space
XP
13,902
Country
Norway
nonsense, nothing to do with iosu, the devs don't want make loadiine at 55+. Why? many reasons: the promised iosu, other possible hacks, laziness)) I'm sure is possible make loadiine for 55+ a couple of hours, just need good dev.
Um. There is no public kernel exploit for 5.5. Loadiine can't happen without a kernel exploit.
IOSU is a (superior) alternative to that which will give more access so proper USB loaders will be possible.
So yes, it has a lot to do with IOSU.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: https://www.youtube.com/watch?v=-Eo3Bh06drc