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

Archshift

Member
OP
Newcomer
Joined
Apr 3, 2015
Messages
10
Trophies
0
XP
76
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
76
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,807
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
41
XP
1,215
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
319
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
41
XP
1,215
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
142
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,215
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
142
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,777
Trophies
2
Age
48
Location
Japan
XP
3,677
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
603
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.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Maximumbeans @ Maximumbeans: butte