Advertisement
Guest User

Slowhax 3ds

a guest
Nov 3rd, 2016
6,447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.05 KB | None | 0 0
  1. #include <3ds.h>
  2. #include <stdio.h>
  3.  
  4. int main(int argc, char **argv)
  5. {
  6.     gfxInitDefault();
  7.     consoleInit(GFX_TOP, NULL);
  8.     osSetSpeedupEnable(true);
  9.    
  10.     Result res;
  11.  
  12.     printf("Slowerhax\n"); //slower version of slowhax
  13.     //POC - probably won't work and I don't have two weeks to find out
  14.    
  15.     res=nsInit();
  16.     printf("nsinit: %08X\n\n",(int)res);
  17.    
  18.     u64 titleid=0x0004001000024000; //promo video, US old3ds. your mileage may vary. it's good to experiment as not all title relaunch spamming works well or at all.
  19.     //titleid=0x000400102002D500;
  20.     u32 procid;  //we assume nintendo is using an s32 for this hopefully
  21.     u32 launch_flags=0; //this doesn't seem to affect anything
  22.     //u32 target=0x100;
  23.     u32 target=0x7FFFFFFF-1; //(s32 max - 1)
  24.     //This is the PID cut-off. After exiting this app and going to hbmenu, the next app should launch with cut-off + 2 based on tests with lower target PIDs.
  25.     //This, in theory(aka internet lore), should launch 3ds_dsiwarehax_installer with an s32 wrap-around at PID 0, giving it full svc access.
  26.     //This is estimated to take all of two weeks to reach the cut-off! Who has the time to actually test this?
  27.     //Note: this doesn't seems to work on new3ds very well. Relaunching system apps leads to the pid not advancing or memory crashes.
  28.    
  29.     for(u32 i=0 ; i<0x80000000 ; i++){
  30.                 NS_LaunchTitle(titleid, launch_flags, &procid);  //loop until pid is right up next to the s32 wrap-around.
  31.                 printf("%08X\n",(int)procid);
  32.                 NS_TerminateProcessTID(titleid);
  33.                 if(procid>=target)break;
  34.     }
  35.     nsExit();
  36.     printf("\n%08X  Current PID\n",(int)procid);
  37.     printf(  "%08X  Target  PID\n",(int)procid+2);
  38.     printf(  "Start to exit, then run 3ds_dsiwarehax_installer"); //need to launch 3ds_dsiwarehax_installer with an xml to takeover some other app or pid will be download play (too low)
  39.  
  40.     while (aptMainLoop())
  41.     {
  42.        
  43.         hidScanInput();
  44.         u32 kDown = hidKeysDown();
  45.         if (kDown & KEY_START) break;
  46.  
  47.         if (kDown & KEY_A){
  48.            
  49.         }
  50.        
  51.         gfxFlushBuffers();
  52.         gfxSwapBuffers();
  53.  
  54.         gspWaitForVBlank();
  55.     }
  56.  
  57.     gfxExit();
  58.     return 0;
  59. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement