Hacking [WIP] open source Kernel access on 3DS

Status
Not open for further replies.

flipy

Member
Newcomer
Joined
Jan 21, 2015
Messages
16
Trophies
0
Age
42
XP
89
Country
Can you try OSKA without my printf code?


OSKA boots fine without printf.
It hangs and returns to home with a warning followed by a soft-reboot.
Do you have a boot.3dsx that I can try? (to eliminate bad builds on my end)

Edit: tried printing a test string and it gets printed.
Edit2: tried printing both memory addresses separated, but it hanged on both
 

173210

Well-Known Member
Member
Joined
Jan 22, 2014
Messages
245
Trophies
0
Age
26
Location
Japan
Website
173210.github.io
XP
683
Country
OSKA boots fine without printf.
It hangs and returns to home with a warning followed by a soft-reboot.
Do you have a boot.3dsx that I can try? (to eliminate bad builds on my end)

Edit: tried printing a test string and it gets printed.
Edit2: tried printing both memory addresses separated, but it hanged on both
I think it crashes because it try to access kernel memory.
Write printf in arm11Kexec and try again.
Code:
diff --git a/oska.c b/oska.c
index fbfbb87..0877d80 100644
--- a/oska.c
+++ b/oska.c
@@ -257,6 +257,9 @@ static void __attribute__((naked)) arm11Kexec()
 
        __asm__("add sp, sp, #8\n");
 
+      printf("0xEFFF497C: 0x%08" PRIx32 ", 0x%08" PRIx32 "\n",
+              *(int *)0xEFFF497C, *(int *)0xEFFF4980);
+
        buf[0] = 0xF00FF00F;
 
        // Fix up memory
 
  • Like
Reactions: Margen67

flipy

Member
Newcomer
Joined
Jan 21, 2015
Messages
16
Trophies
0
Age
42
XP
89
Country
I think it crashes because it try to access kernel memory.
Write printf in arm11Kexec and try again.
Code:
diff --git a/oska.c b/oska.c
index fbfbb87..0877d80 100644
--- a/oska.c
+++ b/oska.c
@@ -257,6 +257,9 @@ static void __attribute__((naked)) arm11Kexec()
 
        __asm__("add sp, sp, #8\n");
 
+      printf("0xEFFF497C: 0x%08" PRIx32 ", 0x%08" PRIx32 "\n",
+              *(int *)0xEFFF497C, *(int *)0xEFFF4980);
+
        buf[0] = 0xF00FF00F;
 
        // Fix up memory

Now something is printed, but is garbage and can't be recognized.
Compiler complains about types being printed: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
 

173210

Well-Known Member
Member
Joined
Jan 22, 2014
Messages
245
Trophies
0
Age
26
Location
Japan
Website
173210.github.io
XP
683
Country
Now something is printed, but is garbage and can't be recognized.
Compiler complains about types being printed: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'int' [-Wformat=]
I forgot int32_t. Anyway, printf may not work on supervisor mode.
If so, this code should work.
Code:
diff --git a/oska.c b/oska.c
index fbfbb87..d6f1c1e 100644
--- a/oska.c
+++ b/oska.c
@@ -14,6 +14,7 @@ static int32_t *buf;
static int32_t *createThreadPatchPtr;
static int32_t *svcPatchPtr;
static int svcIsPatched = 0;
+static int32_t dump[2];
 
// Uncomment to have progress printed w/ printf
#define DEBUG_PROCESS
@@ -271,7 +272,9 @@ static void __attribute__((naked)) arm11Kexec()
        InvalidateAllIcache();
        CleanAllDcache();
 
-      arm9Exploit();
+      // arm9Exploit();
+      dump[0] = *(int32_t *)0xEFFF497C;
+      dump[1] = *(int32_t *)0xEFFF4980;
 
        __asm__("movs r0, #0\n"
                "pop {pc}\n");
@@ -317,6 +320,8 @@ int exploit()
                :: "i"(arm11Kexec) : "r0");
#ifdef DEBUG_PROCESS
        if (svcIsPatched) {
+              printf("dump = { 0x%08" PRIx32 ", 0x%08" PRIx32 "\n",
+                      dump[0], dump[1]);
                printf("Testing SVC 0x7B\n");
                __asm__("ldr r0, =%0\n"
                        "svc #0x7B\n"
 
  • Like
Reactions: 2Hack and Margen67

flipy

Member
Newcomer
Joined
Jan 21, 2015
Messages
16
Trophies
0
Age
42
XP
89
Country
I forgot int32_t. Anyway, printf may not work on supervisor mode.
If so, this code should work.
Code:
diff --git a/oska.c b/oska.c
index fbfbb87..d6f1c1e 100644
--- a/oska.c
+++ b/oska.c
@@ -14,6 +14,7 @@ static int32_t *buf;
static int32_t *createThreadPatchPtr;
static int32_t *svcPatchPtr;
static int svcIsPatched = 0;
+static int32_t dump[2];
 
// Uncomment to have progress printed w/ printf
#define DEBUG_PROCESS
@@ -271,7 +272,9 @@ static void __attribute__((naked)) arm11Kexec()
        InvalidateAllIcache();
        CleanAllDcache();
 
-      arm9Exploit();
+      // arm9Exploit();
+      dump[0] = *(int32_t *)0xEFFF497C;
+      dump[1] = *(int32_t *)0xEFFF4980;
 
        __asm__("movs r0, #0\n"
                "pop {pc}\n");
@@ -317,6 +320,8 @@ int exploit()
                :: "i"(arm11Kexec) : "r0");
#ifdef DEBUG_PROCESS
        if (svcIsPatched) {
+              printf("dump = { 0x%08" PRIx32 ", 0x%08" PRIx32 "\n",
+                      dump[0], dump[1]);
                printf("Testing SVC 0x7B\n");
                __asm__("ldr r0, =%0\n"
                        "svc #0x7B\n"


Not always svcIsPatched returns true.
Result:
Code:
dump = { 0xe28f0010, 0xe28f1044 }
 
  • Like
Reactions: 173210 and Margen67

Datalogger

Living the Dream
Member
Joined
Dec 21, 2009
Messages
416
Trophies
1
Location
Maui
XP
712
Country
United States
Two quick questions.

Does it help to have someone run this patch on a N3DSXL with 9.0.0-20U ?
If so, are any of the patches posted earlier left applied to what's on the GIT, or just the last one?

Using just this one patch I get
dump = { 0x00000000, 0x00000000
 

173210

Well-Known Member
Member
Joined
Jan 22, 2014
Messages
245
Trophies
0
Age
26
Location
Japan
Website
173210.github.io
XP
683
Country
Two quick questions.

Does it help to have someone run this patch on a N3DSXL with 9.0.0-20U ?
If so, are any of the patches posted earlier left applied to what's on the GIT, or just the last one?

Using just this one patch I get
dump = { 0x00000000, 0x00000000
The patch has not been completed yet.
I'll tell you the progress of the development as soon as possible to get your report for OSKA's behavior and make our project more democratic.
 

Datalogger

Living the Dream
Member
Joined
Dec 21, 2009
Messages
416
Trophies
1
Location
Maui
XP
712
Country
United States
The patch has not been completed yet.
I'll tell you the progress of the development as soon as possible to get your report for OSKA's behavior and make our project more democratic.

OK, Thanks.
Just seeing if there's anything I can do to help out... :)
I've got plenty experience with DevkitPro from my wii days.
 
  • Like
Reactions: Margen67

ody81

Well-Known Member
Member
Joined
Aug 21, 2012
Messages
464
Trophies
0
XP
315
Country
By the way, OSKA doesn't have license agreements.
To prevent others from using our code with closed softwares, we should license our code under copyleft license.
I often use GPLv3. If you agree to use GPLv3, please like this post. If you disagree, please write your opinion.


That's a great idea, the gpl is there for a reason so you should use it.

It doesn't detract from the project in any way.

By the way, good for you guys and good luck. I also think certain software should be free and open sourced for the masses :)
 
  • Like
Reactions: Margen67

Datalogger

Living the Dream
Member
Joined
Dec 21, 2009
Messages
416
Trophies
1
Location
Maui
XP
712
Country
United States
I just now finished reading what yifan.lu said about the ARM9 Kernel exploit.
Quite the interesting read...
 
Status
Not open for further replies.

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Psionic Roshambo @ Psionic Roshambo:
    On Android I like Adblock Browser
  • K3Nv2 @ K3Nv2:
    I just say Mexicos a fake America
    +2
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, what about tacos?
  • K3Nv2 @ K3Nv2:
    Taco bell
  • K3Nv2 @ K3Nv2:
    Taco flavored kisses
  • Psionic Roshambo @ Psionic Roshambo:
    Taco Tuesday and Wetback Wednesday Thott Thursday Freaky Friday lol
  • Psionic Roshambo @ Psionic Roshambo:
    Midget Monday is best
  • Xdqwerty @ Xdqwerty:
    @K3Nv2, mexican tacos existed before taco bell
  • Psionic Roshambo @ Psionic Roshambo:
    Taco Bell is about as Mexican as Pizza Hut
    +1
  • K3Nv2 @ K3Nv2:
    Taco bell is authentic Mexican food what are you talking about
  • K3Nv2 @ K3Nv2:
    California is Mexico
  • mthrnite @ mthrnite:
    oled gbasp pl0x
    +1
  • ColdBlitz @ ColdBlitz:
    touchscreen?????
  • ColdBlitz @ ColdBlitz:
    is there any gba homebrew that would offer use for that?
  • K3Nv2 @ K3Nv2:
    The Touchscreen makes using system menu options for brightness and filter adjustments easier
  • Xdqwerty @ Xdqwerty:
    @ColdBlitz, who said anything about touchscreen?
  • ColdBlitz @ ColdBlitz:
    the video title is
    "We Now Have A Touch Screen And OLED Modded Game Boy Color"
  • K3Nv2 @ K3Nv2:
    On screen keys would be cool if the rubber ever fails
  • Psionic Roshambo @ Psionic Roshambo:
    I feel like at that point might as well go emulation lol
  • Psionic Roshambo @ Psionic Roshambo:
    One of those RG things
  • K3Nv2 @ K3Nv2:
    Some people just like using original hardware for the hobby point of it
  • K3Nv2 @ K3Nv2:
    You can easily buy replacement buttons but it's a good fall back
  • ColdBlitz @ ColdBlitz:
    on screen keys would be cool but the gba screen is pretty tiny though :(
  • K3Nv2 @ K3Nv2:
    I'd rather use emulation but it's cool regardless again the main point of the Touchscreen isn't just for buttons but for menu options
    K3Nv2 @ K3Nv2: I'd rather use emulation but it's cool regardless again the main point of the Touchscreen isn't...