Hacking OSDriver kernel exploit - a technical description

Onion_Knight

Well-Known Member
Member
Joined
Feb 6, 2014
Messages
878
Trophies
0
Age
45
XP
997
Country
Be aware that with pygecko, it will freeze the console if you launch a game, quit it, and then return to the browser.
(well for me it freezes, maybe it's the modifications i made on pygecko so i'm not sure)

To resolve the problem I had to add a "GX2WaitForVsync" in the start function of the pygecko codehandler :

Code:
static void start(int argc, void *argv) {
    int sockfd = -1, clientfd = -1, ret, len;
    struct sockaddr_in addr;
    struct bss_t *bss = argv;

    socket_lib_init();

    while (1) {
        addr.sin_family = AF_INET;
        addr.sin_port = 7331;
        addr.sin_addr.s_addr = 0;

        sockfd = ret = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
        CHECK_ERROR(ret == -1);
        ret = bind(sockfd, (void *)&addr, 16);
        CHECK_ERROR(ret < 0);
        ret = listen(sockfd, 1);
        CHECK_ERROR(ret < 0);
        len = 16;
        clientfd = ret = accept(sockfd, (void *)&addr, &len);
        CHECK_ERROR(ret == -1);
        socketclose(sockfd);
        sockfd = -1;
        ret = rungecko(bss, clientfd);
        CHECK_ERROR(ret < 0);
        socketclose(clientfd);
        clientfd = -1;

        GX2WaitForVsync();
        continue;
error:
        if (clientfd != -1)
            socketclose(clientfd);
        if (sockfd != -1)
            socketclose(sockfd);
        bss->error = ret;
        GX2WaitForVsync();
    }


I modified this section to withstand client side issues, but I will add that to my code.

Code:
    addr.sin_family = AF_INET;
     addr.sin_port = 7331;
     addr.sin_addr.s_addr = 0;
     sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);  //open a file handle to socket
     CHECK_ERROR(sockfd == -1);
     ret = bind(sockfd, (void *)&addr, 16);
     CHECK_ERROR(ret < 0);
     ret = listen(sockfd, 20);
     CHECK_ERROR(ret < 0);
     
     while(1) {
     len = 16;
     clientfd =  accept(sockfd, (void *)&addr, &len);
     CHECK_ERROR(clientfd == -1);
     ret = rungecko(bss, clientfd);
     CHECK_ERROR(ret < 0);
     socketclose(clientfd);
     clientfd = -1;
     }
     socketclose(sockfd);
     sockfd = -1;
error:
     if (clientfd != -1)
       socketclose(clientfd);
     if (sockfd != -1)
       socketclose(sockfd);
     bss->error = ret;
   
}
[code]
 

Onion_Knight

Well-Known Member
Member
Joined
Feb 6, 2014
Messages
878
Trophies
0
Age
45
XP
997
Country
Yes, you can also add the read/write syscall to all syscall tables directly in the kernel exploit.

If you're on 5.3.2 :

in loader.h:
#define KERN_SYSCALL_TBL_1 0xFFE84C70 // unknown
#define KERN_SYSCALL_TBL_2 0xFFE85070 // works with games
#define KERN_SYSCALL_TBL_3 0xFFE85470 // works with loader
#define KERN_SYSCALL_TBL_4 0xFFEA9CE0 // works with home menu
#define KERN_SYSCALL_TBL_5 0xFFEAA0E0 // works with browser (previously KERN_SYSCALL_TBL)

in loader.c:
- replace "copy_payload[0xff8/4] = KERN_SYSCALL_TBL + (0x34 * 4);" by "copy_payload[0xff8/4] = KERN_SYSCALL_TBL_5 + (0x34 * 4);"
- add those lines after the " Map the loader and coreinit as RW before exiting" part :
/* Add read/write syscalls to the other syscall_tables */
kern_write(KERN_SYSCALL_TBL_1 + (0x34 * 4), KERN_CODE_READ);
kern_write(KERN_SYSCALL_TBL_1 + (0x35 * 4), KERN_CODE_WRITE);

kern_write(KERN_SYSCALL_TBL_2 + (0x34 * 4), KERN_CODE_READ);
kern_write(KERN_SYSCALL_TBL_2 + (0x35 * 4), KERN_CODE_WRITE);

kern_write(KERN_SYSCALL_TBL_3 + (0x34 * 4), KERN_CODE_READ);
kern_write(KERN_SYSCALL_TBL_3 + (0x35 * 4), KERN_CODE_WRITE);

kern_write(KERN_SYSCALL_TBL_4 + (0x34 * 4), KERN_CODE_READ);
kern_write(KERN_SYSCALL_TBL_4 + (0x35 * 4), KERN_CODE_WRITE);

Then you're free to use the syscalls everywhere :)

edit: sorry I didn't read well the question, I let this here if you are interested

DO I need to add the offsets in the headerfile for Kernal Read and Write, in loader.h
 

golden45

Well-Known Member
Member
Joined
Jun 23, 2015
Messages
108
Trophies
0
Age
124
XP
473
Country
France
DO I need to add the offsets in the headerfile for Kernal Read and Write, in loader.h
In loader.h, inside the part "#elif VER == 532" => "#else# :
you should have something like this :

Code:
#elif VER == 532
  #define KERN_SYSCALL_TBL_1  0xFFE84C70 // unknown
  #define KERN_SYSCALL_TBL_2  0xFFE85070 // works with games
  #define KERN_SYSCALL_TBL_3  0xFFE85470 // works with loader
  #define KERN_SYSCALL_TBL_4  0xFFEA9CE0 // works with home menu
  #define KERN_SYSCALL_TBL_5  0xFFEAA0E0 // works with browser
  #define KERN_CODE_READ  0xFFF02274
  #define KERN_CODE_WRITE  0xFFF02294
  #define KERN_ADDRESS_TBL  0xFFEAAA10
  #define KERN_HEAP  0xFF200000
#else

KERN_CODE_READ and KERN_CODE_WRITE don't change, those are the addresses where the read/write code is called from the syscall handler.
 
  • Like
Reactions: paulloeduardo

Onion_Knight

Well-Known Member
Member
Joined
Feb 6, 2014
Messages
878
Trophies
0
Age
45
XP
997
Country
In loader.h, inside the part "#elif VER == 532" => "#else# :
you should have something like this :

Code:
#elif VER == 532
  #define KERN_SYSCALL_TBL_1  0xFFE84C70 // unknown
  #define KERN_SYSCALL_TBL_2  0xFFE85070 // works with games
  #define KERN_SYSCALL_TBL_3  0xFFE85470 // works with loader
  #define KERN_SYSCALL_TBL_4  0xFFEA9CE0 // works with home menu
  #define KERN_SYSCALL_TBL_5  0xFFEAA0E0 // works with browser
  #define KERN_CODE_READ  0xFFF02274
  #define KERN_CODE_WRITE  0xFFF02294
  #define KERN_ADDRESS_TBL  0xFFEAAA10
  #define KERN_HEAP  0xFF200000
#else

KERN_CODE_READ and KERN_CODE_WRITE don't change, those are the addresses where the read/write code is called from the syscall handler.

Thats what I thought I posted in my question. I did exactly that. I was wondering if I needed to recalculate the addresses for KERN_CODE_READ/WRITE from those new base addresses and add add a define for those.
 

Reecey

Mario 64 (favorite game of all time)
Member
Joined
Mar 7, 2010
Messages
5,870
Trophies
2
Location
At Home :)
XP
4,477
Country
I was just thinking on this thread, if others are creating there own osdrivers then maybe they might change bits and bobs to get it working better they should post them up for others to test. Someone might even hit the jackpot and discover a version that never errors a more cleaner booting version, its worth others testing them to find out the best osdriver. If this thread is about the osdriver then its the perfect thread to post them up and not in the wiiu hacking & homebrew thread where they all just get lost eventually in the masses of pages:)
 

Psi-hate

GBATemp's Official Psi-Hater
Member
Joined
Dec 14, 2014
Messages
1,750
Trophies
1
XP
3,433
Country
United States
Sorry for uh.. asking such a question, but if the exploit was patched 5.5, then is 5.4 exploitable at all? I heard that one of the developers had it running on 5.4, but I don't seem to see anything about it on these forums?
 

Marionumber1

Well-Known Member
OP
Member
Joined
Nov 7, 2010
Messages
1,234
Trophies
3
XP
4,045
Country
United States
Sorry for uh.. asking such a question, but if the exploit was patched 5.5, then is 5.4 exploitable at all? I heard that one of the developers had it running on 5.4, but I don't seem to see anything about it on these forums?

I've had an alternate kernel exploit since early August, which is private and works fine on 5.5.0.
 

n1ghty

Well-Known Member
Member
Joined
Aug 8, 2013
Messages
273
Trophies
0
XP
606
Country
Saint Kitts and Nevis
Sorry for uh.. asking such a question, but if the exploit was patched 5.5, then is 5.4 exploitable at all? I heard that one of the developers had it running on 5.4, but I don't seem to see anything about it on these forums?
The kernel exploit is the same for 5.4, but there is no public userland exploit for 5.4.
The non-public browser exploit for 5.4 is also usable in 5.5 and thus currently unpatched.
The public kernel exploit got patched in 5.5, but there is a non-public one.

Releasing the new browser exploit for 5.4 would be bad because it would probably get fixed in 5.6 and so on...
 

Psi-hate

GBATemp's Official Psi-Hater
Member
Joined
Dec 14, 2014
Messages
1,750
Trophies
1
XP
3,433
Country
United States
The kernel exploit is the same for 5.4, but there is no public userland exploit for 5.4.
The non-public browser exploit for 5.4 is also usable in 5.5 and thus currently unpatched.
The public kernel exploit got patched in 5.5, but there is a non-public one.

Releasing the new browser exploit for 5.4 would be bad because it would probably get fixed in 5.6 and so on...
Ah, okay. Thanks for clarifying! If there's a userland exploit for 5.4 and above, I'd definitely wait for that. I suppose it'd be a good time to block the updates in case the 5.4+ userland exploits are released later?
 

MLT

Member
Newcomer
Joined
Oct 25, 2015
Messages
15
Trophies
0
Age
48
XP
78
Country
for make online functions to works for loadiine i need to access to this area 0x0DD00000 wich is mapped on the kernel here:

0xFFEAAA30 value 0x0DD00000 virt addr
0xFFEAAA34 value 0x02300000 size
0xFFEAAA38 value 0x8DD00000 phy addr
0xFFEAAA3C value 0x2FF09400 memory flags....

any idea to can write on it or remap to another area wich that area are rwx , any ideas will be welcome , if i got access to that memory i can do so many thinks..
 

NexoCube

Well-Known Member
Member
Joined
Nov 3, 2015
Messages
1,222
Trophies
0
Age
29
Location
France
XP
1,340
Country
France
I've had an alternate kernel exploit since early August, which is private and works fine on 5.5.0.

I know this thread exists from a long time, but how did you find Syscalls Table like for OSDriver KExploit ?

Code:
    #define KERN_SYSCALL_TBL        0xFFEAA0E0
    #define KERN_CODE_READ            0xFFF02274
    #define KERN_CODE_WRITE            0xFFF02294
    #define KERN_ADDRESS_TBL        0xFFEAAA10
    #define KERN_HEAP                0xFF200000

I really don't know where these ares ? Is there a easy way to find them like documentation or something ?
 

MLT

Member
Newcomer
Joined
Oct 25, 2015
Messages
15
Trophies
0
Age
48
XP
78
Country
I know this thread exists from a long time, but how did you find Syscalls Table like for OSDriver KExploit ?

Code:
    #define KERN_SYSCALL_TBL        0xFFEAA0E0
    #define KERN_CODE_READ            0xFFF02274
    #define KERN_CODE_WRITE            0xFFF02294
    #define KERN_ADDRESS_TBL        0xFFEAAA10
    #define KERN_HEAP                0xFF200000

I really don't know where these ares ? Is there a easy way to find them like documentation or something ?


just dumping the kernel and reversing the tables.....kernel code are at FFF00100
 

Don Jon

Well-Known Member
Member
Joined
Nov 20, 2015
Messages
1,057
Trophies
0
Age
38
XP
1,496
Country
United States
so ive got a question
ive found a working kernel exploit for firmware 5.5.1 through the process of brute forcing

my intentions are to either release it with a working emulator
or release it alone and let someone finish it

the thing is that I am fairly new to the community(was a microsoft guy)
and i would hate to release something that has already been discovered?
could I check @DeVS your exploit and compare
if they are different
there is no reason for holding back if it turns out mine is different

btw I AM open for donations
 
Last edited by Don Jon,
Joined
Feb 15, 2015
Messages
1,464
Trophies
0
XP
1,099
Country
United States
so ive got a question
ive found a working kernel exploit for firmware 5.5.1 through the process of brute forcing

my intentions are to either release it with a working emulator
or release it alone and let someone finish it

the thing is that I am fairly new to the community(was a microsoft guy)
and i would hate to release something that has already been discovered?
could I check @DeVS your exploit and compare
if they are different
there is no reason for holding back if it turns out mine is different

btw I AM open for donations
Nice scam dude. :P
 
  • Like
Reactions: BIFFTAZ

Don Jon

Well-Known Member
Member
Joined
Nov 20, 2015
Messages
1,057
Trophies
0
Age
38
XP
1,496
Country
United States
hey guys
just got pm not long ago
i gave some info
turns out my exploit IS different from the private ones witheld

So
EXPECT A REALESE SOONtm
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • Quincy @ Quincy:
    Usually when such a big title leaks the Temp will be the first to report about it (going off of historical reports here, Pokemon SV being the latest one I can recall seeing pop up here)
  • K3Nv2 @ K3Nv2:
    I still like how a freaking mp3 file hacks webos all that security defeated by text yet again
  • BigOnYa @ BigOnYa:
    They have simulators for everything nowdays, cray cray. How about a sim that shows you playing the Switch.
  • K3Nv2 @ K3Nv2:
    That's called yuzu
    +1
  • BigOnYa @ BigOnYa:
    I want a 120hz 4k tv but crazy how more expensive the 120hz over the 60hz are. Or even more crazy is the price of 8k's.
  • K3Nv2 @ K3Nv2:
    No real point since movies are 30fps
  • BigOnYa @ BigOnYa:
    Not a big movie buff, more of a gamer tbh. And Series X is 120hz 8k ready, but yea only 120hz 4k games out right now, but thinking of in the future.
  • K3Nv2 @ K3Nv2:
    Mostly why you never see TV manufacturers going post 60hz
  • BigOnYa @ BigOnYa:
    I only watch tv when i goto bed, it puts me to sleep, and I have a nas drive filled w my fav shows so i can watch them in order, commercial free. I usually watch Married w Children, or South Park
  • K3Nv2 @ K3Nv2:
    Stremio ruined my need for nas
  • BigOnYa @ BigOnYa:
    I stream from Nas to firestick, one on every tv, and use Kodi. I'm happy w it, plays everything. (I pirate/torrent shows/movies on pc, and put on nas)
  • K3Nv2 @ K3Nv2:
    Kodi repost are still pretty popular
  • BigOnYa @ BigOnYa:
    What the hell is Kodi reposts? what do you mean, or "Wut?" -xdqwerty
  • K3Nv2 @ K3Nv2:
    Google them basically web crawlers to movie sites
  • BigOnYa @ BigOnYa:
    oh you mean the 3rd party apps on Kodi, yea i know what you mean, yea there are still a few cool ones, in fact watched the new planet of the apes movie other night w wifey thru one, was good pic surprisingly, not a cam
  • BigOnYa @ BigOnYa:
    Damn, only $2.06 and free shipping. Gotta cost more for them to ship than $2.06
    +1
  • BigOnYa @ BigOnYa:
    I got my Dad a firestick for Xmas and showed him those 3rd party sites on Kodi, he loves it, all he watches anymore. He said he has got 3 letters from AT&T already about pirating, but he says f them, let them shut my internet off (He wants out of his AT&T contract anyways)
  • K3Nv2 @ K3Nv2:
    That's where stremio comes to play never got a letter about it
  • BigOnYa @ BigOnYa:
    I just use a VPN, even give him my login and password so can use it also, and he refuses, he's funny.
  • BigOnYa @ BigOnYa:
    I had to find and get him an old style flip phone even without text, cause thats what he wanted. No text, no internet, only phone calls. Old, old school.
  • Psionic Roshambo @ Psionic Roshambo:
    @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87 cents. Free shipping from China... It arrived it works and honestly I don't understand how it was so cheap.
    +1
    Psionic Roshambo @ Psionic Roshambo: @BigOnYa, Lol I bought a new USB card reader thing on AliExpress last month for I think like 87... +1