├── 2019-01-16-045140.jpg ├── 2019-01-16-045211.jpg ├── CMakeLists.txt ├── README.md ├── app ├── debugScreen.h ├── debugScreenFont.c └── main.c ├── plugin ├── naavls.c └── naavls.yml └── res └── icon0.png /2019-01-16-045140.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SKGleba/VITA-NoAutoAvls/accaf9e72008338e5f3b54f07ca8c79c4053e48e/2019-01-16-045140.jpg -------------------------------------------------------------------------------- /2019-01-16-045211.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SKGleba/VITA-NoAutoAvls/accaf9e72008338e5f3b54f07ca8c79c4053e48e/2019-01-16-045211.jpg -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) 4 | if(DEFINED ENV{VITASDK}) 5 | set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file") 6 | else() 7 | message(FATAL_ERROR "Please define VITASDK to point to your SDK path!") 8 | endif() 9 | endif() 10 | 11 | project(naavls) 12 | set(TITLE_ID "SKG4V2SW1") 13 | set(TITLE_NAME "switch avls mode") 14 | 15 | include("${VITASDK}/share/vita.cmake" REQUIRED) 16 | 17 | enable_language(C ASM) 18 | 19 | set(CMAKE_C_FLAGS "-Wl,-q -Wall -O3 -std=gnu99") 20 | set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -std=c++11 -fno-rtti -fno-exceptions") 21 | 22 | include_directories( 23 | ) 24 | 25 | link_directories( 26 | ${CMAKE_CURRENT_BINARY_DIR} 27 | ) 28 | 29 | add_executable(app.elf 30 | app/main.c 31 | app/debugScreenFont.c 32 | ) 33 | 34 | target_link_libraries(app.elf 35 | taihen_stub 36 | SceDisplay_stub 37 | SceCtrl_stub 38 | SceAppMgr_stub 39 | ScePower_stub 40 | ) 41 | 42 | add_custom_target(app.velf ALL 43 | COMMAND vita-elf-create app.elf app.velf 44 | ) 45 | 46 | add_custom_target(eboot.bin ALL 47 | COMMAND vita-make-fself -c app.velf eboot.bin 48 | ) 49 | 50 | add_custom_target(${PROJECT_NAME}.vpk ALL 51 | COMMAND vita-mksfoex -s TITLE_ID=${TITLE_ID} "${TITLE_NAME}" param.sfo 52 | COMMAND vita-pack-vpk -s param.sfo -b eboot.bin -a naavls.skprx=naavls.skprx 53 | -a res/icon0.png=sce_sys/icon0.png ${PROJECT_NAME}.vpk 54 | ) 55 | 56 | add_dependencies(app.velf app.elf) 57 | add_dependencies(eboot.bin app.velf) 58 | add_dependencies(${PROJECT_NAME}.vpk eboot.bin) 59 | 60 | add_executable(naavls.elf 61 | plugin/naavls.c 62 | ) 63 | 64 | target_link_libraries(naavls.elf 65 | SceSblSmCommForKernel_stub 66 | SceThreadmgrForDriver_stub 67 | SceSysconForDriver_stub 68 | SceIofilemgrForDriver_stub 69 | SceSdifForDriver_stub 70 | SceSysclibForDriver_stub 71 | SceCpuForDriver_stub 72 | ScePervasiveForDriver_stub 73 | SceSysmemForDriver_stub 74 | SceSblSsMgrForKernel_stub 75 | SceSysrootForDriver_stub 76 | SceDisplayForDriver_stub 77 | SceKernelUtilsForDriver_stub 78 | ScePowerForDriver_stub 79 | SceSysrootForKernel_stub 80 | taihenForKernel_stub 81 | SceIdStorageForDriver_stub 82 | ) 83 | 84 | set_target_properties(naavls.elf 85 | PROPERTIES LINK_FLAGS "-nostdlib" 86 | COMPILE_FLAGS "-D__VITA_KERNEL__" 87 | ) 88 | 89 | add_custom_target(naavls.skprx ALL 90 | COMMAND vita-elf-create -e ${CMAKE_SOURCE_DIR}/plugin/naavls.yml naavls.elf naavls.velf 91 | COMMAND vita-make-fself -c naavls.velf naavls.skprx 92 | ) 93 | add_dependencies(naavls.skprx naavls.elf) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # VITA-NoAutoAvls 2 | A small utility to permanently enable/disable the auto-avls "feature" on Playstation Vita 3 | ## Usage 4 | 1) Download and install the VPK 5 | 2) Run the new app called "switch avls mode" 6 | - it will either enable or disable the auto-avls flag found in idstorage 7 | - it will create a log in ux0:data/noautoavls.log and reboot 8 | 3) Enjoy 9 | ## Notes 10 | - You may need to run it two times when enabling on a never-auto-avls-ed vita 11 | -------------------------------------------------------------------------------- /app/debugScreen.h: -------------------------------------------------------------------------------- 1 | #ifndef DEBUG_SCREEN_H 2 | #define DEBUG_SCREEN_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | extern unsigned char psvDebugScreenFont[]; 14 | 15 | #define SCREEN_WIDTH (960) 16 | #define SCREEN_HEIGHT (544) 17 | #define SCREEN_FB_WIDTH (960) 18 | #define SCREEN_FB_SIZE (2 * 1024 * 1024) 19 | #define SCREEN_FB_ALIGN (256 * 1024) 20 | #define SCREEN_GLYPH_W (8) 21 | #define SCREEN_GLYPH_H (8) 22 | 23 | #define COLOR_BLACK 0xFF000000 24 | #define COLOR_RED 0xFF0000FF 25 | #define COLOR_BLUE 0xFF00FF00 26 | #define COLOR_YELLOW 0xFF00FFFF 27 | #define COLOR_GREEN 0xFFFF0000 28 | #define COLOR_MAGENTA 0xFFFF00FF 29 | #define COLOR_CYAN 0xFFFFFF00 30 | #define COLOR_WHITE 0xFFFFFFFF 31 | #define COLOR_GREY 0xFF808080 32 | #define COLOR_DEFAULT_FG COLOR_WHITE 33 | #define COLOR_DEFAULT_BG COLOR_BLACK 34 | 35 | static int psvDebugScreenMutex; /*< avoid race condition when outputing strings */ 36 | static uint32_t psvDebugScreenCoordX = 0; 37 | static uint32_t psvDebugScreenCoordY = 0; 38 | static uint32_t psvDebugScreenColorFg = COLOR_DEFAULT_FG; 39 | static uint32_t psvDebugScreenColorBg = COLOR_DEFAULT_BG; 40 | static SceDisplayFrameBuf psvDebugScreenFrameBuf = { 41 | sizeof(SceDisplayFrameBuf), NULL, SCREEN_WIDTH, 0, SCREEN_WIDTH, SCREEN_HEIGHT}; 42 | 43 | uint32_t psvDebugScreenSetFgColor(uint32_t color) { 44 | uint32_t prev_color = psvDebugScreenColorFg; 45 | psvDebugScreenColorFg = color; 46 | return prev_color; 47 | } 48 | 49 | uint32_t psvDebugScreenSetBgColor(uint32_t color) { 50 | uint32_t prev_color = psvDebugScreenColorBg; 51 | psvDebugScreenColorBg = color; 52 | return prev_color; 53 | } 54 | 55 | static size_t psvDebugScreenEscape(const char *str){ 56 | int i,j, p=0, params[8]={}; 57 | for(i=0; i<8 && str[i]!='\0'; i++){ 58 | if(str[i] >= '0' && str[i] <= '9'){ 59 | params[p]=(params[p]*10) + (str[i] - '0'); 60 | }else if(str[i] == ';'){ 61 | p++; 62 | }else if(str[i] == 'f' || str[i] == 'H'){ 63 | psvDebugScreenCoordX = params[0] * SCREEN_GLYPH_W; 64 | psvDebugScreenCoordY = params[1] * SCREEN_GLYPH_H; 65 | break; 66 | }else if (str[i] == 'm'){ 67 | for(j=0; j<=p; j++){ 68 | switch(params[j]/10){/*bold,dim,underline,blink,invert,hidden => unsupported yet */ 69 | #define BIT2BYTE(bit) ( ((!!(bit&4))<<23) | ((!!(bit&2))<<15) | ((!!(bit&1))<<7) ) 70 | case 0:psvDebugScreenSetFgColor(COLOR_DEFAULT_FG);psvDebugScreenSetBgColor(COLOR_DEFAULT_BG);break; 71 | case 3:psvDebugScreenSetFgColor(BIT2BYTE(params[j]%10));break; 72 | case 9:psvDebugScreenSetFgColor(BIT2BYTE(params[j]%10) | 0x7F7F7F7F);break; 73 | case 4:psvDebugScreenSetBgColor(BIT2BYTE(params[j]%10));break; 74 | case 10:psvDebugScreenSetBgColor(BIT2BYTE(params[j]%10) | 0x7F7F7F7F);break; 75 | #undef BIT2BYTE 76 | } 77 | } 78 | break; 79 | } 80 | } 81 | return i; 82 | } 83 | 84 | int psvDebugScreenInit() { 85 | psvDebugScreenMutex = sceKernelCreateMutex("log_mutex", 0, 0, NULL); 86 | SceUID displayblock = sceKernelAllocMemBlock("display", SCE_KERNEL_MEMBLOCK_TYPE_USER_CDRAM_RW, SCREEN_FB_SIZE, NULL); 87 | sceKernelGetMemBlockBase(displayblock, (void**)&psvDebugScreenFrameBuf.base); 88 | 89 | SceDisplayFrameBuf framebuf = { 90 | .size = sizeof(framebuf), 91 | .base = psvDebugScreenFrameBuf.base, 92 | .pitch = SCREEN_WIDTH, 93 | .pixelformat = SCE_DISPLAY_PIXELFORMAT_A8B8G8R8, 94 | .width = SCREEN_WIDTH, 95 | .height = SCREEN_HEIGHT, 96 | }; 97 | 98 | return sceDisplaySetFrameBuf(&framebuf, SCE_DISPLAY_SETBUF_NEXTFRAME); 99 | } 100 | 101 | void psvDebugScreenClear(int bg_color){ 102 | psvDebugScreenCoordX = psvDebugScreenCoordY = 0; 103 | int i; 104 | for(i = 0; i < SCREEN_WIDTH * SCREEN_HEIGHT; i++) { 105 | ((uint32_t*)psvDebugScreenFrameBuf.base)[i] = bg_color; 106 | } 107 | } 108 | 109 | #define PSV_DEBUG_SCALE 2 110 | 111 | int psvDebugScreenPuts(const char * text){ 112 | int c, i, j, l, x, y; 113 | uint8_t *font; 114 | uint32_t *vram_ptr; 115 | uint32_t *vram; 116 | 117 | sceKernelLockMutex(psvDebugScreenMutex, 1, NULL); 118 | 119 | for (c = 0; text[c] != '\0' ; c++) { 120 | if (psvDebugScreenCoordX + 8 > SCREEN_WIDTH) { 121 | psvDebugScreenCoordY += SCREEN_GLYPH_H * PSV_DEBUG_SCALE; 122 | psvDebugScreenCoordX = 0; 123 | } 124 | if (psvDebugScreenCoordY + 8 > SCREEN_HEIGHT) { 125 | psvDebugScreenClear(psvDebugScreenColorBg); 126 | } 127 | if (text[c] == '\n') { 128 | psvDebugScreenCoordX = 0; 129 | psvDebugScreenCoordY += SCREEN_GLYPH_H * PSV_DEBUG_SCALE; 130 | continue; 131 | } else if (text[c] == '\r') { 132 | psvDebugScreenCoordX = 0; 133 | continue; 134 | } else if ((text[c] == '\e') && (text[c+1] == '[')) { /* escape code (change color, position ...) */ 135 | c+=psvDebugScreenEscape(text+2)+2; 136 | continue; 137 | } 138 | 139 | vram = (uint32_t*)psvDebugScreenFrameBuf.base; 140 | 141 | font = &psvDebugScreenFont[ (int)text[c] * 8]; 142 | for (i = l = 0; i < SCREEN_GLYPH_W; i++, l += SCREEN_GLYPH_W, font++) { 143 | for (j = 0; j < SCREEN_GLYPH_W; j++) { 144 | for (y = 0; y < PSV_DEBUG_SCALE; y++) { 145 | for (x = 0; x < PSV_DEBUG_SCALE; x++) { 146 | vram_ptr = &vram[(psvDebugScreenCoordX + x + j * PSV_DEBUG_SCALE) + 147 | (psvDebugScreenCoordY + y + i * PSV_DEBUG_SCALE) * SCREEN_FB_WIDTH]; 148 | if ((*font & (128 >> j))) 149 | *vram_ptr = psvDebugScreenColorFg; 150 | else 151 | *vram_ptr = psvDebugScreenColorBg; 152 | } 153 | } 154 | } 155 | } 156 | psvDebugScreenCoordX += SCREEN_GLYPH_W * PSV_DEBUG_SCALE; 157 | } 158 | 159 | sceKernelUnlockMutex(psvDebugScreenMutex, 1); 160 | return c; 161 | } 162 | 163 | int psvDebugScreenPrintf(const char *format, ...) { 164 | char buf[512]; 165 | 166 | va_list opt; 167 | va_start(opt, format); 168 | int ret = vsnprintf(buf, sizeof(buf), format, opt); 169 | psvDebugScreenPuts(buf); 170 | va_end(opt); 171 | 172 | return ret; 173 | } 174 | 175 | #endif 176 | -------------------------------------------------------------------------------- /app/debugScreenFont.c: -------------------------------------------------------------------------------- 1 | /* 2 | * PSP Software Development Kit - http://www.pspdev.org 3 | * ----------------------------------------------------------------------- 4 | * Licensed under the BSD license, see LICENSE in PSPSDK root for details. 5 | * 6 | * font.c - Debug Font. 7 | * 8 | * Copyright (c) 2005 Marcus R. Brown 9 | * Copyright (c) 2005 James Forshaw 10 | * Copyright (c) 2005 John Kelley 11 | * 12 | * $Id: font.c 540 2005-07-08 19:35:10Z warren $ 13 | */ 14 | 15 | unsigned char psvDebugScreenFont[]= 16 | "\x00\x00\x00\x00\x00\x00\x00\x00\x3c\x42\xa5\x81\xa5\x99\x42\x3c" 17 | "\x3c\x7e\xdb\xff\xff\xdb\x66\x3c\x6c\xfe\xfe\xfe\x7c\x38\x10\x00" 18 | "\x10\x38\x7c\xfe\x7c\x38\x10\x00\x10\x38\x54\xfe\x54\x10\x38\x00" 19 | "\x10\x38\x7c\xfe\xfe\x10\x38\x00\x00\x00\x00\x30\x30\x00\x00\x00" 20 | "\xff\xff\xff\xe7\xe7\xff\xff\xff\x38\x44\x82\x82\x82\x44\x38\x00" 21 | "\xc7\xbb\x7d\x7d\x7d\xbb\xc7\xff\x0f\x03\x05\x79\x88\x88\x88\x70" 22 | "\x38\x44\x44\x44\x38\x10\x7c\x10\x30\x28\x24\x24\x28\x20\xe0\xc0" 23 | "\x3c\x24\x3c\x24\x24\xe4\xdc\x18\x10\x54\x38\xee\x38\x54\x10\x00" 24 | "\x10\x10\x10\x7c\x10\x10\x10\x10\x10\x10\x10\xff\x00\x00\x00\x00" 25 | "\x00\x00\x00\xff\x10\x10\x10\x10\x10\x10\x10\xf0\x10\x10\x10\x10" 26 | "\x10\x10\x10\x1f\x10\x10\x10\x10\x10\x10\x10\xff\x10\x10\x10\x10" 27 | "\x10\x10\x10\x10\x10\x10\x10\x10\x00\x00\x00\xff\x00\x00\x00\x00" 28 | "\x00\x00\x00\x1f\x10\x10\x10\x10\x00\x00\x00\xf0\x10\x10\x10\x10" 29 | "\x10\x10\x10\x1f\x00\x00\x00\x00\x10\x10\x10\xf0\x00\x00\x00\x00" 30 | "\x81\x42\x24\x18\x18\x24\x42\x81\x01\x02\x04\x08\x10\x20\x40\x80" 31 | "\x80\x40\x20\x10\x08\x04\x02\x01\x00\x10\x10\xff\x10\x10\x00\x00" 32 | "\x00\x00\x00\x00\x00\x00\x00\x00\x20\x20\x20\x20\x00\x00\x20\x00" 33 | "\x50\x50\x50\x00\x00\x00\x00\x00\x50\x50\xf8\x50\xf8\x50\x50\x00" 34 | "\x20\x78\xa0\x70\x28\xf0\x20\x00\xc0\xc8\x10\x20\x40\x98\x18\x00" 35 | "\x40\xa0\x40\xa8\x90\x98\x60\x00\x10\x20\x40\x00\x00\x00\x00\x00" 36 | "\x10\x20\x40\x40\x40\x20\x10\x00\x40\x20\x10\x10\x10\x20\x40\x00" 37 | "\x20\xa8\x70\x20\x70\xa8\x20\x00\x00\x20\x20\xf8\x20\x20\x00\x00" 38 | "\x00\x00\x00\x00\x00\x20\x20\x40\x00\x00\x00\x78\x00\x00\x00\x00" 39 | "\x00\x00\x00\x00\x00\x60\x60\x00\x00\x00\x08\x10\x20\x40\x80\x00" 40 | "\x70\x88\x98\xa8\xc8\x88\x70\x00\x20\x60\xa0\x20\x20\x20\xf8\x00" 41 | "\x70\x88\x08\x10\x60\x80\xf8\x00\x70\x88\x08\x30\x08\x88\x70\x00" 42 | "\x10\x30\x50\x90\xf8\x10\x10\x00\xf8\x80\xe0\x10\x08\x10\xe0\x00" 43 | "\x30\x40\x80\xf0\x88\x88\x70\x00\xf8\x88\x10\x20\x20\x20\x20\x00" 44 | "\x70\x88\x88\x70\x88\x88\x70\x00\x70\x88\x88\x78\x08\x10\x60\x00" 45 | "\x00\x00\x20\x00\x00\x20\x00\x00\x00\x00\x20\x00\x00\x20\x20\x40" 46 | "\x18\x30\x60\xc0\x60\x30\x18\x00\x00\x00\xf8\x00\xf8\x00\x00\x00" 47 | "\xc0\x60\x30\x18\x30\x60\xc0\x00\x70\x88\x08\x10\x20\x00\x20\x00" 48 | "\x70\x88\x08\x68\xa8\xa8\x70\x00\x20\x50\x88\x88\xf8\x88\x88\x00" 49 | "\xf0\x48\x48\x70\x48\x48\xf0\x00\x30\x48\x80\x80\x80\x48\x30\x00" 50 | "\xe0\x50\x48\x48\x48\x50\xe0\x00\xf8\x80\x80\xf0\x80\x80\xf8\x00" 51 | "\xf8\x80\x80\xf0\x80\x80\x80\x00\x70\x88\x80\xb8\x88\x88\x70\x00" 52 | "\x88\x88\x88\xf8\x88\x88\x88\x00\x70\x20\x20\x20\x20\x20\x70\x00" 53 | "\x38\x10\x10\x10\x90\x90\x60\x00\x88\x90\xa0\xc0\xa0\x90\x88\x00" 54 | "\x80\x80\x80\x80\x80\x80\xf8\x00\x88\xd8\xa8\xa8\x88\x88\x88\x00" 55 | "\x88\xc8\xc8\xa8\x98\x98\x88\x00\x70\x88\x88\x88\x88\x88\x70\x00" 56 | "\xf0\x88\x88\xf0\x80\x80\x80\x00\x70\x88\x88\x88\xa8\x90\x68\x00" 57 | "\xf0\x88\x88\xf0\xa0\x90\x88\x00\x70\x88\x80\x70\x08\x88\x70\x00" 58 | "\xf8\x20\x20\x20\x20\x20\x20\x00\x88\x88\x88\x88\x88\x88\x70\x00" 59 | "\x88\x88\x88\x88\x50\x50\x20\x00\x88\x88\x88\xa8\xa8\xd8\x88\x00" 60 | "\x88\x88\x50\x20\x50\x88\x88\x00\x88\x88\x88\x70\x20\x20\x20\x00" 61 | "\xf8\x08\x10\x20\x40\x80\xf8\x00\x70\x40\x40\x40\x40\x40\x70\x00" 62 | "\x00\x00\x80\x40\x20\x10\x08\x00\x70\x10\x10\x10\x10\x10\x70\x00" 63 | "\x20\x50\x88\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x00" 64 | "\x40\x20\x10\x00\x00\x00\x00\x00\x00\x00\x70\x08\x78\x88\x78\x00" 65 | "\x80\x80\xb0\xc8\x88\xc8\xb0\x00\x00\x00\x70\x88\x80\x88\x70\x00" 66 | "\x08\x08\x68\x98\x88\x98\x68\x00\x00\x00\x70\x88\xf8\x80\x70\x00" 67 | "\x10\x28\x20\xf8\x20\x20\x20\x00\x00\x00\x68\x98\x98\x68\x08\x70" 68 | "\x80\x80\xf0\x88\x88\x88\x88\x00\x20\x00\x60\x20\x20\x20\x70\x00" 69 | "\x10\x00\x30\x10\x10\x10\x90\x60\x40\x40\x48\x50\x60\x50\x48\x00" 70 | "\x60\x20\x20\x20\x20\x20\x70\x00\x00\x00\xd0\xa8\xa8\xa8\xa8\x00" 71 | "\x00\x00\xb0\xc8\x88\x88\x88\x00\x00\x00\x70\x88\x88\x88\x70\x00" 72 | "\x00\x00\xb0\xc8\xc8\xb0\x80\x80\x00\x00\x68\x98\x98\x68\x08\x08" 73 | "\x00\x00\xb0\xc8\x80\x80\x80\x00\x00\x00\x78\x80\xf0\x08\xf0\x00" 74 | "\x40\x40\xf0\x40\x40\x48\x30\x00\x00\x00\x90\x90\x90\x90\x68\x00" 75 | "\x00\x00\x88\x88\x88\x50\x20\x00\x00\x00\x88\xa8\xa8\xa8\x50\x00" 76 | "\x00\x00\x88\x50\x20\x50\x88\x00\x00\x00\x88\x88\x98\x68\x08\x70" 77 | "\x00\x00\xf8\x10\x20\x40\xf8\x00\x18\x20\x20\x40\x20\x20\x18\x00" 78 | "\x20\x20\x20\x00\x20\x20\x20\x00\xc0\x20\x20\x10\x20\x20\xc0\x00" 79 | "\x40\xa8\x10\x00\x00\x00\x00\x00\x00\x00\x20\x50\xf8\x00\x00\x00" 80 | "\x70\x88\x80\x80\x88\x70\x20\x60\x90\x00\x00\x90\x90\x90\x68\x00" 81 | "\x10\x20\x70\x88\xf8\x80\x70\x00\x20\x50\x70\x08\x78\x88\x78\x00" 82 | "\x48\x00\x70\x08\x78\x88\x78\x00\x20\x10\x70\x08\x78\x88\x78\x00" 83 | "\x20\x00\x70\x08\x78\x88\x78\x00\x00\x70\x80\x80\x80\x70\x10\x60" 84 | "\x20\x50\x70\x88\xf8\x80\x70\x00\x50\x00\x70\x88\xf8\x80\x70\x00" 85 | "\x20\x10\x70\x88\xf8\x80\x70\x00\x50\x00\x00\x60\x20\x20\x70\x00" 86 | "\x20\x50\x00\x60\x20\x20\x70\x00\x40\x20\x00\x60\x20\x20\x70\x00" 87 | "\x50\x00\x20\x50\x88\xf8\x88\x00\x20\x00\x20\x50\x88\xf8\x88\x00" 88 | "\x10\x20\xf8\x80\xf0\x80\xf8\x00\x00\x00\x6c\x12\x7e\x90\x6e\x00" 89 | "\x3e\x50\x90\x9c\xf0\x90\x9e\x00\x60\x90\x00\x60\x90\x90\x60\x00" 90 | "\x90\x00\x00\x60\x90\x90\x60\x00\x40\x20\x00\x60\x90\x90\x60\x00" 91 | "\x40\xa0\x00\xa0\xa0\xa0\x50\x00\x40\x20\x00\xa0\xa0\xa0\x50\x00" 92 | "\x90\x00\x90\x90\xb0\x50\x10\xe0\x50\x00\x70\x88\x88\x88\x70\x00" 93 | "\x50\x00\x88\x88\x88\x88\x70\x00\x20\x20\x78\x80\x80\x78\x20\x20" 94 | "\x18\x24\x20\xf8\x20\xe2\x5c\x00\x88\x50\x20\xf8\x20\xf8\x20\x00" 95 | "\xc0\xa0\xa0\xc8\x9c\x88\x88\x8c\x18\x20\x20\xf8\x20\x20\x20\x40" 96 | "\x10\x20\x70\x08\x78\x88\x78\x00\x10\x20\x00\x60\x20\x20\x70\x00" 97 | "\x20\x40\x00\x60\x90\x90\x60\x00\x20\x40\x00\x90\x90\x90\x68\x00" 98 | "\x50\xa0\x00\xa0\xd0\x90\x90\x00\x28\x50\x00\xc8\xa8\x98\x88\x00" 99 | "\x00\x70\x08\x78\x88\x78\x00\xf8\x00\x60\x90\x90\x90\x60\x00\xf0" 100 | "\x20\x00\x20\x40\x80\x88\x70\x00\x00\x00\x00\xf8\x80\x80\x00\x00" 101 | "\x00\x00\x00\xf8\x08\x08\x00\x00\x84\x88\x90\xa8\x54\x84\x08\x1c" 102 | "\x84\x88\x90\xa8\x58\xa8\x3c\x08\x20\x00\x00\x20\x20\x20\x20\x00" 103 | "\x00\x00\x24\x48\x90\x48\x24\x00\x00\x00\x90\x48\x24\x48\x90\x00" 104 | "\x28\x50\x20\x50\x88\xf8\x88\x00\x28\x50\x70\x08\x78\x88\x78\x00" 105 | "\x28\x50\x00\x70\x20\x20\x70\x00\x28\x50\x00\x20\x20\x20\x70\x00" 106 | "\x28\x50\x00\x70\x88\x88\x70\x00\x50\xa0\x00\x60\x90\x90\x60\x00" 107 | "\x28\x50\x00\x88\x88\x88\x70\x00\x50\xa0\x00\xa0\xa0\xa0\x50\x00" 108 | "\xfc\x48\x48\x48\xe8\x08\x50\x20\x00\x50\x00\x50\x50\x50\x10\x20" 109 | "\xc0\x44\xc8\x54\xec\x54\x9e\x04\x10\xa8\x40\x00\x00\x00\x00\x00" 110 | "\x00\x20\x50\x88\x50\x20\x00\x00\x88\x10\x20\x40\x80\x28\x00\x00" 111 | "\x7c\xa8\xa8\x68\x28\x28\x28\x00\x38\x40\x30\x48\x48\x30\x08\x70" 112 | "\x00\x00\x00\x00\x00\x00\xff\xff\xf0\xf0\xf0\xf0\x0f\x0f\x0f\x0f" 113 | "\x00\x00\xff\xff\xff\xff\xff\xff\xff\xff\x00\x00\x00\x00\x00\x00" 114 | "\x00\x00\x00\x3c\x3c\x00\x00\x00\xff\xff\xff\xff\xff\xff\x00\x00" 115 | "\xc0\xc0\xc0\xc0\xc0\xc0\xc0\xc0\x0f\x0f\x0f\x0f\xf0\xf0\xf0\xf0" 116 | "\xfc\xfc\xfc\xfc\xfc\xfc\xfc\xfc\x03\x03\x03\x03\x03\x03\x03\x03" 117 | "\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x3f\x11\x22\x44\x88\x11\x22\x44\x88" 118 | "\x88\x44\x22\x11\x88\x44\x22\x11\xfe\x7c\x38\x10\x00\x00\x00\x00" 119 | "\x00\x00\x00\x00\x10\x38\x7c\xfe\x80\xc0\xe0\xf0\xe0\xc0\x80\x00" 120 | "\x01\x03\x07\x0f\x07\x03\x01\x00\xff\x7e\x3c\x18\x18\x3c\x7e\xff" 121 | "\x81\xc3\xe7\xff\xff\xe7\xc3\x81\xf0\xf0\xf0\xf0\x00\x00\x00\x00" 122 | "\x00\x00\x00\x00\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x00\x00\x00\x00" 123 | "\x00\x00\x00\x00\xf0\xf0\xf0\xf0\x33\x33\xcc\xcc\x33\x33\xcc\xcc" 124 | "\x00\x20\x20\x50\x50\x88\xf8\x00\x20\x20\x70\x20\x70\x20\x20\x00" 125 | "\x00\x00\x00\x50\x88\xa8\x50\x00\xff\xff\xff\xff\xff\xff\xff\xff" 126 | "\x00\x00\x00\x00\xff\xff\xff\xff\xf0\xf0\xf0\xf0\xf0\xf0\xf0\xf0" 127 | "\x0f\x0f\x0f\x0f\x0f\x0f\x0f\x0f\xff\xff\xff\xff\x00\x00\x00\x00" 128 | "\x00\x00\x68\x90\x90\x90\x68\x00\x30\x48\x48\x70\x48\x48\x70\xc0" 129 | "\xf8\x88\x80\x80\x80\x80\x80\x00\xf8\x50\x50\x50\x50\x50\x98\x00" 130 | "\xf8\x88\x40\x20\x40\x88\xf8\x00\x00\x00\x78\x90\x90\x90\x60\x00" 131 | "\x00\x50\x50\x50\x50\x68\x80\x80\x00\x50\xa0\x20\x20\x20\x20\x00" 132 | "\xf8\x20\x70\xa8\xa8\x70\x20\xf8\x20\x50\x88\xf8\x88\x50\x20\x00" 133 | "\x70\x88\x88\x88\x50\x50\xd8\x00\x30\x40\x40\x20\x50\x50\x50\x20" 134 | "\x00\x00\x00\x50\xa8\xa8\x50\x00\x08\x70\xa8\xa8\xa8\x70\x80\x00" 135 | "\x38\x40\x80\xf8\x80\x40\x38\x00\x70\x88\x88\x88\x88\x88\x88\x00" 136 | "\x00\xf8\x00\xf8\x00\xf8\x00\x00\x20\x20\xf8\x20\x20\x00\xf8\x00" 137 | "\xc0\x30\x08\x30\xc0\x00\xf8\x00\x18\x60\x80\x60\x18\x00\xf8\x00" 138 | "\x10\x28\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\xa0\x40" 139 | "\x00\x20\x00\xf8\x00\x20\x00\x00\x00\x50\xa0\x00\x50\xa0\x00\x00" 140 | "\x00\x18\x24\x24\x18\x00\x00\x00\x00\x30\x78\x78\x30\x00\x00\x00" 141 | "\x00\x00\x00\x00\x30\x00\x00\x00\x3e\x20\x20\x20\xa0\x60\x20\x00" 142 | "\xa0\x50\x50\x50\x00\x00\x00\x00\x40\xa0\x20\x40\xe0\x00\x00\x00" 143 | "\x00\x38\x38\x38\x38\x38\x38\x00\x00\x00\x00\x00\x00\x00\x00"; 144 | 145 | 146 | -------------------------------------------------------------------------------- /app/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Simple kplugin loader by xerpi 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include "debugScreen.h" 10 | 11 | #define MOD_PATH "ux0:app/SKG4V2SW1/naavls.skprx" 12 | 13 | #define printf(...) psvDebugScreenPrintf(__VA_ARGS__) 14 | 15 | void wait_key_press() 16 | { 17 | SceCtrlData pad; 18 | 19 | printf("Press CROSS to change AVLS mode.\n"); 20 | 21 | while (1) { 22 | sceCtrlPeekBufferPositive(0, &pad, 1); 23 | if (pad.buttons & SCE_CTRL_CROSS) 24 | break; 25 | sceKernelDelayThread(200 * 1000); 26 | } 27 | } 28 | 29 | int main(int argc, char *argv[]) 30 | { 31 | int ret; 32 | SceUID mod_id; 33 | psvDebugScreenInit(); 34 | printf("NoAutoAvls v1.0\n"); 35 | wait_key_press(); 36 | printf("\nChanging AVLS mode..."); 37 | tai_module_args_t argg; 38 | argg.size = sizeof(argg); 39 | argg.pid = KERNEL_PID; 40 | argg.args = 0; 41 | argg.argp = NULL; 42 | argg.flags = 0; 43 | mod_id = taiLoadStartKernelModuleForUser(MOD_PATH, &argg); 44 | if (mod_id > 0) { 45 | printf("\nok!, rebooting in 5s\n"); 46 | printf("you can check the log for more info\n"); 47 | sceKernelDelayThread(5 * 1000 * 1000); 48 | scePowerRequestColdReset(); 49 | } else { 50 | printf("\nerr, check log!\n"); 51 | sceKernelDelayThread(5 * 1000 * 1000); 52 | } 53 | return 0; 54 | } 55 | -------------------------------------------------------------------------------- /plugin/naavls.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | #define LOG_LOC "ux0:data/noautoavls.log" 8 | 9 | #define LOG(...) \ 10 | do { \ 11 | char buffer[256]; \ 12 | snprintf(buffer, sizeof(buffer), ##__VA_ARGS__); \ 13 | logg(buffer, strlen(buffer), LOG_LOC, 2); \ 14 | } while (0) 15 | 16 | #define LOG_START(...) \ 17 | do { \ 18 | char buffer[256]; \ 19 | snprintf(buffer, sizeof(buffer), ##__VA_ARGS__); \ 20 | logg(buffer, strlen(buffer), LOG_LOC, 1); \ 21 | } while (0) 22 | 23 | static char leafbuf[512], leafobuf[512]; 24 | static tai_hook_ref_t hook_ref; 25 | static int hook = 0; 26 | 27 | static int logg(void *buffer, int length, const char* logloc, int create) 28 | { 29 | int fd; 30 | if (create == 0) { 31 | fd = ksceIoOpen(logloc, SCE_O_WRONLY | SCE_O_APPEND, 6); 32 | } else if (create == 1) { 33 | fd = ksceIoOpen(logloc, SCE_O_WRONLY | SCE_O_TRUNC | SCE_O_CREAT, 6); 34 | } else if (create == 2) { 35 | fd = ksceIoOpen(logloc, SCE_O_WRONLY | SCE_O_APPEND | SCE_O_CREAT, 6); 36 | } 37 | if (fd < 0) 38 | return 0; 39 | 40 | ksceIoWrite(fd, buffer, length); 41 | ksceIoClose(fd); 42 | return 1; 43 | } 44 | 45 | int siofix(void *func) { 46 | int ret = 0; 47 | int res = 0; 48 | int uid = 0; 49 | ret = uid = ksceKernelCreateThread("siofix", func, 64, 0x10000, 0, 0, 0); 50 | if (ret < 0){ret = -1; goto cleanup;} 51 | if ((ret = ksceKernelStartThread(uid, 0, NULL)) < 0) {ret = -1; goto cleanup;} 52 | if ((ret = ksceKernelWaitThreadEnd(uid, &res, NULL)) < 0) {ret = -1; goto cleanup;} 53 | ret = res; 54 | cleanup: 55 | if (uid > 0) ksceKernelDeleteThread(uid); 56 | return ret; 57 | } 58 | 59 | static int ReOrSet118() { 60 | memset(leafbuf, 0, 0x200); 61 | unsigned int iset = 0, ret; 62 | int xr = ksceIdStorageLookup(0x118, 0, &iset, 1); 63 | if (xr != 0) { 64 | LOG("no leaf, creating... "); 65 | ret = ksceIdStorageCreateLeaf(0x118); 66 | if (ret != 0) { 67 | LOG("0x%X\n", ret); 68 | return 1; 69 | } 70 | LOG("OK!\n"); 71 | LOG("restarting idstorage... "); 72 | ret = ksceIdStorageRestart(1); 73 | if (ret != 0) { 74 | LOG("0x%X\n", ret); 75 | return 1; 76 | } 77 | LOG("OK!\n"); 78 | leafbuf[0] = 1; 79 | LOG("writing data... "); 80 | ret = ksceIdStorageWriteLeaf(0x118, leafbuf, 1); 81 | if (ret != 0) { 82 | LOG("0x%X\n", ret); 83 | return 1; 84 | } 85 | LOG("OK!\n"); 86 | } else if (xr == 0) { 87 | LOG("leaf exists!\n"); 88 | if (iset == 0) { 89 | LOG("AutoAvls disabled, enabling... "); 90 | leafbuf[0] = 1; 91 | ret = ksceIdStorageWriteLeaf(0x118, leafbuf, 1); 92 | if (ret != 0) { 93 | LOG("0x%X\n", ret); 94 | return 2; 95 | } 96 | LOG("OK!\n"); 97 | LOG("restarting idstorage... "); 98 | ret = ksceIdStorageRestart(1); 99 | if (ret != 0) { 100 | LOG("0x%X\n", ret); 101 | return 1; 102 | } 103 | ret = ksceIdStorageReadLeaf(0x118, leafobuf, 1); 104 | if (ret != 0) 105 | return 2; 106 | LOG("byte0: 0x%X\n", leafbuf[0]); 107 | } else { 108 | LOG("AutoAvls enabled, disabling... "); 109 | ret = ksceIdStorageWriteLeaf(0x118, leafbuf, 1); 110 | if (ret != 0) { 111 | LOG("0x%X\n", ret); 112 | return 2; 113 | } 114 | LOG("OK!\n"); 115 | LOG("restarting idstorage... "); 116 | ret = ksceIdStorageRestart(1); 117 | if (ret != 0) { 118 | LOG("0x%X\n", ret); 119 | return 1; 120 | } 121 | ret = ksceIdStorageReadLeaf(0x118, leafobuf, 1); 122 | if (ret != 0) 123 | return 2; 124 | LOG("byte0: 0x%X\n", leafbuf[0]); 125 | } 126 | } 127 | ret = ksceIdStorageRestart(0); 128 | LOG("ReOrSet118: 0x%X, 0x%X\n", xr, ret); 129 | return 0; 130 | } 131 | 132 | static int proxy_ReOrSet118() { 133 | int state = 0, ret = 0; 134 | ENTER_SYSCALL(state); 135 | ret = siofix(ReOrSet118); 136 | EXIT_SYSCALL(state); 137 | return ret; 138 | } 139 | 140 | SceUID is_pm_patched(void *buf) { 141 | *(uint8_t *)buf = 4; 142 | return 0; 143 | } 144 | 145 | void _start() __attribute__ ((weak, alias ("module_start"))); 146 | int module_start(SceSize argc, const void *args) 147 | { 148 | LOG_START("naavls started!\n"); 149 | int sysroot = ksceKernelGetSysbase(); 150 | LOG("fw: 0x%lX\n", *(uint32_t *)(*(int *)(sysroot + 0x6c) + 4)); 151 | hook = taiHookFunctionImportForKernel(KERNEL_PID, &hook_ref, "SceIdStorage", 0xF13F32F9, 0x2AC815A2, is_pm_patched); 152 | proxy_ReOrSet118(); 153 | LOG("naavls finished!\n"); 154 | return SCE_KERNEL_START_SUCCESS; 155 | } 156 | 157 | int module_stop(SceSize argc, const void *args) 158 | { 159 | taiHookReleaseForKernel(hook, hook_ref); 160 | return SCE_KERNEL_STOP_SUCCESS; 161 | } 162 | -------------------------------------------------------------------------------- /plugin/naavls.yml: -------------------------------------------------------------------------------- 1 | not-moth: 2 | attributes: 0 3 | version: 4 | major: 1 5 | minor: 1 6 | main: 7 | start: module_start 8 | stop: module_stop 9 | -------------------------------------------------------------------------------- /res/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SKGleba/VITA-NoAutoAvls/accaf9e72008338e5f3b54f07ca8c79c4053e48e/res/icon0.png --------------------------------------------------------------------------------