Advertisement
Guest User

Kindof sortof maybe pokemon shuffle ram editor thingy?

a guest
Feb 22nd, 2015
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.73 KB | None | 0 0
  1. /*
  2.  * uvloader.c - Userland Vita Loader entry point
  3.  * Copyright 2012 Yifan Lu
  4.  *
  5.  * Licensed under the Apache License, Version 2.0 (the "License");
  6.  * you may not use this file except in compliance with the License.
  7.  * You may obtain a copy of the License at
  8.  *
  9.  *    http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17.  
  18. #define START_SECTION __attribute__ ((section (".text.start"), naked))
  19.  
  20. // make sure code is PIE
  21. #ifndef __PIE__
  22. #error "Must compile with -fPIE"
  23. #endif
  24.  
  25. int(*IFile_Open)(void *this, const short *path, int flags) = 0x0022FE08;
  26. int(*IFile_Write)(void *this, unsigned int *written, void *src, unsigned int len) = 0x00168764;
  27. int (*GX_SetTextureCopy)(void *input_buffer, void *output_buffer, unsigned int size, int in_x, int in_y, int out_x, int out_y, int flags) = 0x0011DD48;
  28. int (*GSPGPU_FlushDataCache)(void *addr, unsigned int len) = 0x00191504;
  29. int (*svcSleepThread)(unsigned long long nanoseconds) = 0x0023FFE8;
  30.  
  31. int uvl_entry();
  32.  
  33. /********************************************//**
  34.  *  \brief Starting point from exploit
  35.  *
  36.  *  Call this from your exploit to run UVLoader.
  37.  *  It will first cache all loaded modules and
  38.  *  attempt to resolve its own NIDs which
  39.  *  should only depend on sceLibKernel.
  40.  *  \returns Zero on success, otherwise error
  41.  ***********************************************/
  42.  
  43. int START_SECTION
  44. uvl_start ()
  45. {
  46.     __asm__ volatile (".word 0xE1A00000");
  47.     uvl_entry();
  48.     __asm__ volatile ("bx lr");
  49. }
  50.  
  51. /********************************************//**
  52.  *  \brief Entry point of UVLoader
  53.  *
  54.  *  \returns Zero on success, otherwise error
  55.  ***********************************************/
  56. int
  57. uvl_entry ()
  58. {
  59.     void *this = 0x08F10000;
  60.     int *written = 0x08F01000;
  61.     int *buf = 0x18410000;
  62.  
  63.     unsigned int addr;
  64.     unsigned int offset1;
  65.     unsigned int offset2;
  66.  
  67.     /*IFile_Open(this, L"dmc:/mem-0xFFFF0000.bin", 6);*/
  68.     svcSleepThread(0x400000LL);
  69.  
  70.     addr = 0x17580000;
  71.     offset1 = 0xebac;
  72.     offset2 = 0xedd8;
  73.  
  74.     GSPGPU_FlushDataCache(addr, 0x10000);
  75.     GX_SetTextureCopy(addr, buf, 0x10000, 0, 0, 0, 0, 8);
  76.     GSPGPU_FlushDataCache(buf, 0x10000);
  77.  
  78.     buf[offset1] = 0x5;
  79.     buf[offset2] = 0x5;
  80.  
  81.     svcSleepThread(0x400000LL);
  82.     GSPGPU_FlushDataCache(buf, 0x10000);
  83.     GX_SetTextureCopy(buf, addr, 0x10000, 0, 0, 0, 0, 8);
  84.     GSPGPU_FlushDataCache(addr, 0x10000);
  85.     svcSleepThread(0x400000LL);
  86.  
  87.     /*for (addr = 0x14000000; addr < 0x1A800000; addr += 0x10000)
  88.     {
  89.         GSPGPU_FlushDataCache(addr, 0x10000);
  90.         GX_SetTextureCopy(addr, buf, 0x10000, 0, 0, 0, 0, 8);
  91.         GSPGPU_FlushDataCache(buf, 0x10000);
  92.         svcSleepThread(0x400000LL);
  93.         IFile_Write(this, written, buf, 0x10000);
  94.  
  95.         GSPGPU_FlushDataCache(0x18000000, 0x00038400);
  96.         GX_SetTextureCopy(0x18000000, 0x1F48F000, 0x00038400, 0, 0, 0, 0, 8);
  97.         svcSleepThread(0x400000LL);
  98.         GSPGPU_FlushDataCache(0x18000000, 0x00038400);
  99.         GX_SetTextureCopy(0x18000000, 0x1F4C7800, 0x00038400, 0, 0, 0, 0, 8);
  100.         svcSleepThread(0x400000LL);
  101.     }*/
  102.  
  103.     return 0;
  104. }
  105.  
  106.  
  107.  
  108. /********************************************//**
  109.  *  \brief Exiting point for loaded application
  110.  *
  111.  *  This hooks on to exit() call and cleans up
  112.  *  after the application is unloaded.
  113.  *  \returns Zero on success, otherwise error
  114.  ***********************************************/
  115. int
  116. uvl_exit (int status)
  117. {
  118.     return 0;
  119. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement