Advertisement
Guest User

Screen Pattern v3088 / 17552 code.bin

a guest
May 24th, 2015
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.79 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 (*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) = 0x0011DD80;
  26. int (*GSPGPU_FlushDataCache)(void *addr, unsigned int len) = 0x0012C228;
  27. int (*svcSleepThread)(unsigned long long nanoseconds) = 0x0010420C;
  28.  
  29. int uvl_entry();
  30.  
  31. /********************************************//**
  32.  *  \brief Starting point from exploit
  33.  *
  34.  *  Call this from your exploit to run UVLoader.
  35.  *  It will first cache all loaded modules and
  36.  *  attempt to resolve its own NIDs which
  37.  *  should only depend on sceLibKernel.
  38.  *  \returns Zero on success, otherwise error
  39.  ***********************************************/
  40.  
  41. int START_SECTION
  42. uvl_start ()
  43. {
  44.     __asm__ volatile (".word 0xE1A00000");
  45.     uvl_entry();
  46.     __asm__ volatile ("bx lr");
  47. }
  48.  
  49. /********************************************//**
  50.  *  \brief Entry point of UVLoader
  51.  *
  52.  *  \returns Zero on success, otherwise error
  53.  ***********************************************/
  54. int
  55. uvl_entry ()
  56. {
  57.     int i;
  58.  
  59.     // makes random pattern on screen
  60.       svcSleepThread (0x400000LL);
  61.       svcSleepThread (0x400000LL);
  62.       svcSleepThread (0x400000LL);
  63.     for (i = 0; i < 3; i++) // do 3 times to be safe
  64.     {
  65.         GSPGPU_FlushDataCache (0x18000000, 0x00038400);
  66.         GX_SetTextureCopy (0x18000000, 0x1F48F000, 0x00038400, 0, 0, 0, 0, 8);
  67.         svcSleepThread (0x400000LL);
  68.         GSPGPU_FlushDataCache (0x18000000, 0x00038400);
  69.         GX_SetTextureCopy (0x18000000, 0x1F4C7800, 0x00038400, 0, 0, 0, 0, 8);
  70.         svcSleepThread (0x400000LL);
  71.     }
  72.  
  73.     svcSleepThread (0x4000000LL); // wait 30 seconds
  74.     return 0;
  75. }
  76.  
  77.  
  78.  
  79. /********************************************//**
  80.  *  \brief Exiting point for loaded application
  81.  *
  82.  *  This hooks on to exit() call and cleans up
  83.  *  after the application is unloaded.
  84.  *  \returns Zero on success, otherwise error
  85.  ***********************************************/
  86. int
  87. uvl_exit (int status)
  88. {
  89.     return 0;
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement