Homebrew [Released] Some developer tools for the privileged among us

Archshift

Member
OP
Newcomer
Joined
Apr 3, 2015
Messages
10
Trophies
0
XP
56
Country
United States
By privileged, I obviously mean those of us who use libkhax! I've made a few tools that can take advantage of bootstrap's kernel access.

First is service-patch. This tool, as the name suggests, is able to patch services in two ways.
First of all, it patches the currently-running homebrew to have full service access, without ninjhax limitations. It does this by patching the PID of Cubic Ninja to zero, and all PIDs below five have automatic full access to all services.
The tool also provides infrastructure to patch the code of any currently-running process. If you tried to do this with the debug SVCs, the process would crash on execution of whatever code you patched, but service-patch queries the location of the code under the kernel addressing-mode, and patches the code by directly accessing the memory.

The next tool is i2c. As its name suggests as well, the program is able to access the I2C registers. This can be neat especially for ARM9 homebrew developers (rxTools comes to mind), as you can do such things as querying the current battery level from I2C. Check 3DBrew for all currently-known I2C functions.
NOTE: ALWAYS BE CAREFUL MESSING AROUND WITH I2C AND BE SURE OF WHAT YOU'RE DOING. DEVELOPERS HAVE BRICKED THEIR 3DS DOING THINGS AS SIMPLE AS MESSING WITH THE LED REGISTERS.

There's also dump-kernelmem. This dumps the kernel memory.

I'd also like to give a quick mention to the bootstrap branch of Decrypt9. This has existed for quite a while already, but it's apparently been undiscovered so far! To run Decrypt9 from bootstrap, compile Decrypt9, then replace the payload.bin in bootstrap with Decrypt9.bin (renamed, of course, to payload.bin). It even supports the N3DS!

Have fun developing!
 

yifan_lu

@yifanlu
Member
Joined
Apr 28, 2007
Messages
663
Trophies
0
XP
1,671
Country
United States
Thank you! "The tool also provides infrastructure to patch the code of any currently-running process." Does this allow you to patch a process and return to home menu/launch another title? Because it would be nice to be able to, for example, patch NIM to bypass update checks and then open eshop.
 
  • Like
Reactions: Margen67

Archshift

Member
OP
Newcomer
Joined
Apr 3, 2015
Messages
10
Trophies
0
XP
56
Country
United States
Unfortunately all the tool can do is patch code, it doesn't do anything special to allow returning to home menu.

From what I've been told on #3dsdev, it's not even feasible to return to home menu from Ninjhax because the RO exploit has so much fallout.
 

Shadowtrance

Well-Known Member
Member
Joined
May 9, 2014
Messages
2,493
Trophies
0
Location
Hervey Bay, Queensland
XP
1,787
Country
c:/Users/teron_000/Desktop/GIT-REPOS/service-patch/source/main.cpp:17:38: error: 'svcBackdoor' was not declared in this scope
svcBackdoor(patch_process_wrapper);
When attempting to build service-patch. Nothing changed, just default source.
I'm not much of a coder, just a tinkerer. Thought I'd point that out incase it's an error on your part or maybe me just being a noob. haha
 

dubbz82

Well-Known Member
Member
Joined
Feb 2, 2014
Messages
1,572
Trophies
0
Age
39
XP
1,189
Country
United States
Spiffy, I'm going to stay the heck away though, until someone inevitably makes something with this. Very nice though
 

yifan_lu

@yifanlu
Member
Joined
Apr 28, 2007
Messages
663
Trophies
0
XP
1,671
Country
United States
Unfortunately all the tool can do is patch code, it doesn't do anything special to allow returning to home menu.

From what I've been told on #3dsdev, it's not even feasible to return to home menu from Ninjhax because the RO exploit has so much fallout.

Yeah, I've been trying to get process patching to work with spider, but turns out that saving/restoring heap and restoring SVC 8 code is not enough because although it allows you to return from kernel, it crashes some service or something because closing spider gives you a black screen with the error message.
 

josamilu

Well-Known Member
Member
Joined
Feb 1, 2015
Messages
383
Trophies
0
Location
Saturn is better than Jupiter :P
XP
309
Country
Gambia, The
Awsome release. I modified service-patch a bit and tried to compile it but got this error :
Code:
d:/devkitPro/ctrulib/service-patch-master/source/main.cpp: In function 'int main
(int, char**)':
d:/devkitPro/ctrulib/service-patch-master/source/main.cpp:105:38: error: 'svcBac
kdoor' was not declared in this scope
    svcBackdoor(patch_process_wrapper);
                                      ^
How can I fix this?
 

dubbz82

Well-Known Member
Member
Joined
Feb 2, 2014
Messages
1,572
Trophies
0
Age
39
XP
1,189
Country
United States
Awsome release. I modified service-patch a bit and tried to compile it but got this error :
Code:
d:/devkitPro/ctrulib/service-patch-master/source/main.cpp: In function 'int main
(int, char**)':
d:/devkitPro/ctrulib/service-patch-master/source/main.cpp:105:38: error: 'svcBac
kdoor' was not declared in this scope
    svcBackdoor(patch_process_wrapper);
                                      ^
How can I fix this?



Check 3 posts above yours.
 
  • Like
Reactions: josamilu

dela

Well-Known Member
Newcomer
Joined
Dec 6, 2014
Messages
78
Trophies
0
Location
Cagliari
XP
122
Country
Italy
Release damn interesting, has already been a while that study through the suggestion of another dev, as decrypt9 works, and now this with your other release I've literally amazed.
 

sanni

Well-Known Member
Member
Joined
Nov 7, 2003
Messages
142
Trophies
1
XP
1,151
Country
Germany
Soooo can we combine this service patch with the 3dsx version of FBI and install a newer browser version? Or other correctly signed cia's like system updates?
 
  • Like
Reactions: Margen67

dela

Well-Known Member
Newcomer
Joined
Dec 6, 2014
Messages
78
Trophies
0
Location
Cagliari
XP
122
Country
Italy
Before I was giving you a look springs from your smartphone, I did not understand if it can enable svc "0x7c" in unsigned [KernelSetState (Type unsigned int, unsigned int Param0, Param1 unsigned int, unsigned int Param2)].
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,255
Trophies
1
Age
46
Location
Japan
XP
2,808
Country
United States
I'd also like to give a quick mention to the bootstrap branch of Decrypt9. This has existed for quite a while already, but it's apparently been undiscovered so far! To run Decrypt9 from bootstrap, compile Decrypt9, then replace the payload.bin in bootstrap with Decrypt9.bin (renamed, of course, to payload.bin). It even supports the N3DS!

Slightly off topic- but can somebody pretty please do this and release a .3ds version of decrypt9 that will run on N3DS? Or really any way of running Decrypt9 on N3DS. Also, can this be used somehow to make rxtools work on N3DS?
 
  • Like
Reactions: Margen67

Oishikatta

Well-Known Member
Member
Joined
Oct 30, 2014
Messages
971
Trophies
0
XP
593
Country
United States
Slightly off topic- but can somebody pretty please do this and release a .3ds version of decrypt9 that will run on N3DS? Or really any way of running Decrypt9 on N3DS. Also, can this be used somehow to make rxtools work on N3DS?


You quoted his link to his bootstrap branch of Decrypt9 that compiles to .3dsx and runs on the N3DS via ninjahax.
 

You may also like...

General chit-chat
Help Users
  • Sicklyboy @ Sicklyboy:
    It's a problem
  • Sicklyboy @ Sicklyboy:
    Someone please take away my internet privileges
  • Psionic Roshambo @ Psionic Roshambo:
    Vinyl sucks
  • Psionic Roshambo @ Psionic Roshambo:
    Problem solved
  • Sicklyboy @ Sicklyboy:
    Between what I own and what I have on order, I have almost 100 albums already
  • Sicklyboy @ Sicklyboy:
    And while this is a problem I am working to solve, I don't even own a record player
  • Psionic Roshambo @ Psionic Roshambo:
    Now that's a problem lol
  • K3N1 @ K3N1:
    Did your record skip?
  • Psionic Roshambo @ Psionic Roshambo:
    He broke all kinds of records
  • M4x1mumReZ @ M4x1mumReZ:
    Vinyl is more for the collectors than anything honestly.
  • M4x1mumReZ @ M4x1mumReZ:
    Also don't use unknown vinyl players which have the cheap mechanism, as the needle can damage your vinyls.
  • M4x1mumReZ @ M4x1mumReZ:
    Invest into a more good quality player than anything.
  • M4x1mumReZ @ M4x1mumReZ:
    Audio-Technica is a reputable brand.
  • K3N1 @ K3N1:
    Something old was mentioned and all of a sudden we're all experts on it
    +1
  • Veho @ Veho:
    Hefalump syndrome.
  • K3N1 @ K3N1:
    Elephants are cool
  • K3N1 @ K3N1:
    I wonder what Will Smith is going to say about YouTube this year
  • Veho @ Veho:
    He's gonna slap his mobile phone.
    +1
  • K3N1 @ K3N1:
    Or get into a random argument with someone he's never met before on Facebook
    +1
  • M4x1mumReZ @ M4x1mumReZ:
    Him getting pissed after someone mentions his wife.
  • Psionic Roshambo @ Psionic Roshambo:
    Arguing on the internet is like winning the special Olympics.... Even if you win your still retarded
  • K3N1 @ K3N1:
    Nuh uh
  • K3N1 @ K3N1:
    Bought mw2 don't ask why
    K3N1 @ K3N1: Bought mw2 don't ask why