├── henkaku ├── .gitignore ├── config.h ├── user.yml ├── kernel.yml ├── LICENSE ├── henkaku.h ├── taihen.json ├── CMakeLists.txt ├── henkaku_settings.xml ├── system_settings.xml ├── kernel.c ├── language.h └── user.c ├── installer ├── .gitignore ├── res │ └── pkg │ │ ├── bg0.png │ │ ├── icon0.png │ │ ├── startup.png │ │ └── template.xml ├── src │ ├── kernel2.yml │ ├── kernel_exports.yml │ ├── user_exports.yml │ ├── enso.h │ ├── sha256.h │ ├── kernel2.c │ ├── user.c │ ├── pspdebug.h │ ├── crc32.c │ ├── sha256.c │ ├── scr_printf.c │ ├── font.c │ └── main.c ├── LICENSE └── CMakeLists.txt ├── enso ├── .gitignore ├── fat.tpl ├── first.x ├── second.x ├── Makefile ├── README.md ├── LICENSE ├── gen.py ├── first.c ├── nsbl.h ├── second.c └── logo.h └── README.md /henkaku/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /installer/.gitignore: -------------------------------------------------------------------------------- 1 | build 2 | -------------------------------------------------------------------------------- /enso/.gitignore: -------------------------------------------------------------------------------- 1 | *.bin 2 | *.o 3 | first 4 | second 5 | fat.bin 6 | -------------------------------------------------------------------------------- /enso/fat.tpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOfficialFloW/update365/HEAD/enso/fat.tpl -------------------------------------------------------------------------------- /installer/res/pkg/bg0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOfficialFloW/update365/HEAD/installer/res/pkg/bg0.png -------------------------------------------------------------------------------- /installer/res/pkg/icon0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOfficialFloW/update365/HEAD/installer/res/pkg/icon0.png -------------------------------------------------------------------------------- /installer/res/pkg/startup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TheOfficialFloW/update365/HEAD/installer/res/pkg/startup.png -------------------------------------------------------------------------------- /henkaku/config.h: -------------------------------------------------------------------------------- 1 | #define BETA_RELEASE 0 2 | #define ENSO_RELEASE 1 3 | #define HENKAKU_RELEASE 1 4 | #define PSN_PASSPHRASE "" 5 | -------------------------------------------------------------------------------- /henkaku/user.yml: -------------------------------------------------------------------------------- 1 | HENkakuUser: 2 | attributes: 0 3 | version: 4 | major: 1 5 | minor: 1 6 | main: 7 | start: module_start 8 | stop: module_stop 9 | -------------------------------------------------------------------------------- /installer/src/kernel2.yml: -------------------------------------------------------------------------------- 1 | kernel2: 2 | attributes: 0 3 | version: 4 | major: 1 5 | minor: 1 6 | main: 7 | start: module_start 8 | stop: module_stop 9 | -------------------------------------------------------------------------------- /installer/src/kernel_exports.yml: -------------------------------------------------------------------------------- 1 | kernel: 2 | attributes: 0 3 | version: 4 | major: 1 5 | minor: 1 6 | main: 7 | start: module_start 8 | stop: module_stop 9 | -------------------------------------------------------------------------------- /installer/src/user_exports.yml: -------------------------------------------------------------------------------- 1 | user: 2 | attributes: 0 3 | version: 4 | major: 1 5 | minor: 1 6 | main: 7 | start: module_start 8 | stop: module_stop 9 | -------------------------------------------------------------------------------- /henkaku/kernel.yml: -------------------------------------------------------------------------------- 1 | HENkaku: 2 | attributes: 0 3 | version: 4 | major: 1 5 | minor: 1 6 | main: 7 | start: module_start 8 | stop: module_stop 9 | modules: 10 | HENkaku: 11 | syscall: true 12 | functions: 13 | - henkaku_reload_config 14 | -------------------------------------------------------------------------------- /enso/first.x: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | 4 | ENTRY(start) 5 | 6 | SECTIONS 7 | { 8 | . = 0x51167220; 9 | .text : { *(.text.start) *(.text .text.* .gnu.linkonce.t.*) *(.sceStub.text.*) } 10 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 11 | .data : { *(.data .data.* .gnu.linkonce.d.*) } 12 | .bss : { *(.bss .bss.* .gnu.linkonce.b.*) *(COMMON) } 13 | } 14 | -------------------------------------------------------------------------------- /enso/second.x: -------------------------------------------------------------------------------- 1 | OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm") 2 | OUTPUT_ARCH(arm) 3 | 4 | ENTRY(start) 5 | 6 | SECTIONS 7 | { 8 | . = 0x51e00000; 9 | .text : { *(.text.start) *(.text .text.* .gnu.linkonce.t.*) *(.sceStub.text.*) } 10 | .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } 11 | .data : { *(.data .data.* .gnu.linkonce.d.*) } 12 | .bss : { *(.bss .bss.* .gnu.linkonce.b.*) *(COMMON) } 13 | } 14 | -------------------------------------------------------------------------------- /enso/Makefile: -------------------------------------------------------------------------------- 1 | CC=arm-vita-eabi-gcc 2 | CFLAGS=-Os -fno-builtin-printf -fPIC -fno-builtin-memset -Wall -Wextra -Wno-unused-variable -DFW_365 3 | OBJCOPY=arm-vita-eabi-objcopy 4 | LDFLAGS=-nodefaultlibs -nostdlib 5 | 6 | fat.bin: first.bin second.bin 7 | ./gen.py fat.tpl first.bin second.bin fat.bin 8 | 9 | first.bin: first 10 | $(OBJCOPY) -O binary $^ $@ 11 | 12 | second.bin: second 13 | $(OBJCOPY) -O binary $^ $@ 14 | 15 | first: first.o 16 | $(CC) -o $@ $^ $(LDFLAGS) -T first.x 17 | 18 | second: second.o 19 | $(CC) -o $@ $^ $(LDFLAGS) -T second.x 20 | 21 | clean: 22 | -rm -f first first.bin second second.bin fat.bin *.o 23 | -------------------------------------------------------------------------------- /installer/src/enso.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // user prototypes 4 | int ensoCheckOs0(void); 5 | int ensoCheckMBR(void); 6 | int ensoCheckBlocks(void); 7 | int ensoWriteConfig(void); 8 | int ensoWriteBlocks(void); 9 | int ensoWriteMBR(void); 10 | int ensoCheckRealMBR(void); 11 | int ensoUninstallMBR(void); 12 | int ensoCleanUpBlocks(void); 13 | 14 | // kernel prototypes 15 | int k_ensoCheckOs0(void); 16 | int k_ensoCheckMBR(void); 17 | int k_ensoCheckBlocks(void); 18 | int k_ensoWriteConfig(void); 19 | int k_ensoWriteBlocks(void); 20 | int k_ensoWriteMBR(void); 21 | int k_ensoCheckRealMBR(void); 22 | int k_ensoUninstallMBR(void); 23 | int k_ensoCleanUpBlocks(void); 24 | 25 | enum { 26 | E_PREVIOUS_INSTALL = 1, 27 | E_MBR_BUT_UNKNOWN = 2, 28 | E_UNKNOWN_DATA = 3, 29 | }; 30 | 31 | #define BLOCKS_OUTPUT "ux0:data/blocks.bin" 32 | -------------------------------------------------------------------------------- /enso/README.md: -------------------------------------------------------------------------------- 1 | You need [vitasdk](https://vitasdk.org/). 2 | 3 | 1. `make` the payload 4 | 2. Copy `fat.bin` to `installer/res` 5 | 3. CMake the installer `mkdir build && cd build && cmake .. && make` 6 | 7 | Firmware specific offsets are in first.c and nsbl.h. Logo is raw framebuffer data gzipped. If you make this too big (bigger than original logo size), you WILL perma-brick your Vita. 8 | 9 | The source is for advanced users only. Users should download the [prebuilt package](https://enso.henkaku.xyz/). If something goes wrong, you WILL perma-brick your Vita. There is no recovery, even if you have a hardware mod. The only possible recovery is if you have a hardware mod and you dump the eMMC _before_ getting bricked, then you can restore the dump. Dumps are device-specific and encrypted with a device-specific key. 10 | 11 | Again, even if you just change the logo, there's a good chance you will perma-brick your Vita. You have been warned. 12 | -------------------------------------------------------------------------------- /installer/res/pkg/template.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | bg0.png 6 | 7 | 8 | 9 | startup.png 10 | 11 | 12 | 13 | 14 | 15 | HENkaku Ensō 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 3.65 Updater 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | v1.0 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /enso/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 molecule 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /henkaku/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 molecule 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /installer/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 molecule 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /henkaku/henkaku.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief Internal functions and defines 3 | */ 4 | #ifndef HENKAKU_HEADER 5 | #define HENKAKU_HEADER 6 | 7 | #include 8 | 9 | // TODO: Move to sdk 10 | int sceClibPrintf(const char *fmt, ...); 11 | int sceClibSnprintf(char *buf, size_t len, const char *fmt, ...); 12 | 13 | int henkaku_reload_config(void); 14 | int taiReloadConfig(void); 15 | 16 | /** Logging function */ 17 | #ifdef ENABLE_LOGGING 18 | #ifdef __VITA_KERNEL__ 19 | #define LOG(fmt, ...) printf("[%s:%d] " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) 20 | #else 21 | #define LOG(fmt, ...) sceClibPrintf("[%s:%d] " fmt "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) 22 | #endif 23 | #else 24 | #define LOG(fmt, ...) 25 | #endif 26 | 27 | /** Config */ 28 | typedef struct { 29 | uint32_t magic; 30 | uint32_t version; 31 | uint32_t use_psn_spoofing; 32 | uint32_t allow_unsafe_hb; 33 | uint32_t use_spoofed_version; 34 | uint32_t spoofed_version; 35 | } __attribute__((packed)) henkaku_config_t; 36 | 37 | #define HENKAKU_CONFIG_MAGIC (0x4C434C4D) 38 | #define CONFIG_PATH "ur0:tai/henkaku_config.bin" 39 | #define OLD_CONFIG_PATH "ux0:temp/app_work/MLCL00001/rec/config.bin" 40 | #define SPOOF_VERSION (0x3670000) 41 | 42 | #endif // HENKAKU_HEADER 43 | -------------------------------------------------------------------------------- /installer/src/sha256.h: -------------------------------------------------------------------------------- 1 | /********************************************************************* 2 | * Filename: sha256.h 3 | * Author: Brad Conte (brad AT bradconte.com) 4 | * Copyright: 5 | * Disclaimer: This code is presented "as is" without any guarantees. 6 | * Details: Defines the API for the corresponding SHA1 implementation. 7 | *********************************************************************/ 8 | 9 | #ifndef SHA256_H 10 | #define SHA256_H 11 | 12 | /*************************** HEADER FILES ***************************/ 13 | #include 14 | 15 | /****************************** MACROS ******************************/ 16 | #define SHA256_BLOCK_SIZE 32 // SHA256 outputs a 32 byte digest 17 | 18 | /**************************** DATA TYPES ****************************/ 19 | typedef unsigned char BYTE; // 8-bit byte 20 | typedef unsigned int WORD; // 32-bit word, change to "long" for 16-bit machines 21 | 22 | typedef struct { 23 | BYTE data[64]; 24 | WORD datalen; 25 | unsigned long long bitlen; 26 | WORD state[8]; 27 | } SHA256_CTX; 28 | 29 | /*********************** FUNCTION DECLARATIONS **********************/ 30 | void sha256_init(SHA256_CTX *ctx); 31 | void sha256_update(SHA256_CTX *ctx, const BYTE data[], size_t len); 32 | void sha256_final(SHA256_CTX *ctx, BYTE hash[]); 33 | 34 | #endif // SHA256_H 35 | -------------------------------------------------------------------------------- /henkaku/taihen.json: -------------------------------------------------------------------------------- 1 | { 2 | "taihen": { 3 | "nid": 910080232, 4 | "modules": { 5 | "taihen": { 6 | "nid": 540875304, 7 | "kernel": false, 8 | "functions": { 9 | "taiHookFunctionExportForUser": 2269553102, 10 | "taiHookFunctionImportForUser": 1399025245, 11 | "taiHookFunctionOffsetForUser": 87368282, 12 | "taiGetModuleInfo": 2777256836, 13 | "taiHookRelease": 472967065, 14 | "taiInjectAbs": 1247316228, 15 | "taiInjectDataForUser": 3458578876, 16 | "taiInjectRelease": 564447398 17 | }, 18 | "variables": { 19 | } 20 | }, 21 | "taihenForKernel": { 22 | "nid": 3487819968, 23 | "kernel": true, 24 | "functions": { 25 | "taiHookFunctionAbs": 3605329551, 26 | "taiHookFunctionExportForKernel": 1171062720, 27 | "taiHookFunctionImportForKernel": 1159321730, 28 | "taiHookFunctionOffsetForKernel": 2402393463, 29 | "taiGetModuleInfoForKernel": 1855132055, 30 | "taiHookReleaseForKernel": 3525736650, 31 | "taiInjectAbsForKernel": 4230976111, 32 | "taiInjectDataForKernel": 2678390840, 33 | "taiInjectReleaseForKernel": 1371225801, 34 | "taiLoadPluginsForTitleForKernel": 2621581546 35 | }, 36 | "variables": { 37 | } 38 | }, 39 | "taihenUnsafe": { 40 | "nid": 2998301478, 41 | "kernel": false, 42 | "functions": { 43 | "taiLoadKernelModule": 3603990244, 44 | "taiStartKernelModuleForUser": 2850755214, 45 | "taiLoadStartKernelModuleForUser": 2559617235, 46 | "taiLoadStartModuleForPidForUser": 3897797579, 47 | "taiStopUnloadKernelModuleForUser": 1277030648, 48 | "taiUnloadKernelModule": 1275696130, 49 | "taiMemcpyUserToKernel": 4138861294, 50 | "taiMemcpyKernelToUser": 2310758437 51 | }, 52 | "variables": { 53 | } 54 | } 55 | } 56 | } 57 | } -------------------------------------------------------------------------------- /enso/gen.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | 3 | from sys import argv, exit 4 | import struct 5 | 6 | def p32(x): 7 | return struct.pack("= 0x180: 29 | print "your first payload is too big!" 30 | exit(-1) 31 | if len(second_bin) >= 0x2000: 32 | print "your second payload is too big!" 33 | exit(-1) 34 | 35 | temp_store = 0x511671A0 36 | pivot = 0x5101504C # e890b672 ldm r0, {r1, r4, r5, r6, r9, sl, ip, sp, pc} 37 | pop_pc = 0x5100155F 38 | pop_r0_pc = 0x5100E4D1 39 | pop_r1_r2_r4_r6_pc = 0x51024C53 40 | blx_r3_pop_r3_pc = 0x510058AF 41 | pop_r3_pc = 0x510058B1 42 | flush_icache = 0x51014691 # ICIALLUIS 43 | clean_dcache = 0x510146DD 44 | debug_printf = 0x51012D45 45 | 46 | pivot_args = [0, 0, 0, 0, 0, 0, 0, temp_store + 0x40, pop_pc] 47 | rop = [ 48 | pop_r0_pc, 49 | temp_store, # r0 50 | 51 | pop_r1_r2_r4_r6_pc, 52 | 0x800, # r1 53 | 0, # r2 54 | 0, # r4 55 | 0, # r6 56 | 57 | pop_r3_pc, 58 | clean_dcache, # r3 59 | 60 | blx_r3_pop_r3_pc, 61 | flush_icache, # r3 62 | 63 | blx_r3_pop_r3_pc, 64 | 0, # r3 65 | temp_store + 0x80|1, 66 | ] 67 | 68 | BASE = 0x5400 69 | 70 | # write pivot_args to temp_store 71 | ins(fat_tpl, BASE, pivot_args) 72 | # write rop to temp_store + 0x40 73 | ins(fat_tpl, BASE + 0x40, rop) 74 | # write payload to temp_store + 0x80 75 | ins(fat_tpl, BASE + 0x80, first_bin) 76 | # write second payload starting from block 5 77 | ins(fat_tpl, 5 * 0x200, second_bin) 78 | # write func ptr 79 | ins(fat_tpl, BASE + 0x638, [pivot]) 80 | # write R0 arg to func ptr 81 | ins(fat_tpl, BASE + 0x63C, [temp_store]) 82 | 83 | with open(argv[4], "wb") as fout: 84 | fout.write(fat_tpl) 85 | 86 | 87 | if __name__ == "__main__": 88 | main() 89 | -------------------------------------------------------------------------------- /installer/src/kernel2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | 7 | #include 8 | #include 9 | 10 | #define MOD_LIST_SIZE 128 11 | 12 | int module_get_export_func(SceUID pid, const char *modname, uint32_t libnid, uint32_t funcnid, uintptr_t *func); 13 | 14 | int (* _ksceKernelGetModuleList)(SceUID pid, int flags1, int flags2, SceUID *modids, size_t *num); 15 | int (* _ksceKernelGetModuleInfo)(SceUID pid, SceUID modid, SceKernelModuleInfo *info); 16 | 17 | void _start() __attribute__ ((weak, alias("module_start"))); 18 | int module_start(SceSize args, void *argp) { 19 | int ret; 20 | SceKernelModuleInfo info; 21 | SceUID modlist[MOD_LIST_SIZE]; 22 | int count = MOD_LIST_SIZE; 23 | int i; 24 | 25 | ret = module_get_export_func(KERNEL_PID, "SceKernelModulemgr", 0xC445FA63, 0x97CF7B4E, (uintptr_t *)&_ksceKernelGetModuleList); 26 | if (ret < 0) 27 | ret = module_get_export_func(KERNEL_PID, "SceKernelModulemgr", 0x92C9FFC2, 0xB72C75A4, (uintptr_t *)&_ksceKernelGetModuleList); 28 | if (ret < 0) 29 | return SCE_KERNEL_START_FAILED; 30 | 31 | ret = module_get_export_func(KERNEL_PID, "SceKernelModulemgr", 0xC445FA63, 0xD269F915, (uintptr_t *)&_ksceKernelGetModuleInfo); 32 | if (ret < 0) 33 | ret = module_get_export_func(KERNEL_PID, "SceKernelModulemgr", 0x92C9FFC2, 0xDAA90093, (uintptr_t *)&_ksceKernelGetModuleInfo); 34 | if (ret < 0) 35 | return SCE_KERNEL_START_FAILED; 36 | 37 | ret = _ksceKernelGetModuleList(KERNEL_PID, 0x7FFFFFFF, 1, modlist, &count); 38 | if (ret < 0) 39 | return SCE_KERNEL_START_FAILED; 40 | 41 | info.size = sizeof(SceKernelModuleInfo); 42 | ret = _ksceKernelGetModuleInfo(KERNEL_PID, modlist[1], &info); 43 | if (ret < 0) 44 | return SCE_KERNEL_START_FAILED; 45 | 46 | // second last kernel module must be either taihen or HENkaku 47 | if (strcmp(info.module_name, "taihen") != 0 && strcmp(info.module_name, "HENkaku") != 0) 48 | return SCE_KERNEL_START_FAILED; 49 | 50 | ret = _ksceKernelGetModuleList(ksceKernelGetProcessId(), 0x7FFFFFFF, 1, modlist, &count); 51 | if (ret < 0) 52 | return SCE_KERNEL_START_FAILED; 53 | 54 | info.size = sizeof(SceKernelModuleInfo); 55 | ret = _ksceKernelGetModuleInfo(ksceKernelGetProcessId(), modlist[0], &info); 56 | if (ret < 0) 57 | return SCE_KERNEL_START_FAILED; 58 | 59 | // last user module must be SceAppUtil 60 | if (strcmp(info.module_name, "SceAppUtil") != 0) 61 | return SCE_KERNEL_START_FAILED; 62 | 63 | return SCE_KERNEL_START_SUCCESS; 64 | } 65 | 66 | int module_stop(SceSize args, void *argp) { 67 | return SCE_KERNEL_STOP_SUCCESS; 68 | } -------------------------------------------------------------------------------- /henkaku/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(HENkaku) 12 | include("${VITASDK}/share/vita.cmake" REQUIRED) 13 | 14 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wl,-q -Wall -fshort-wchar -O3 -std=gnu99") 15 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fno-rtti -fno-exceptions") 16 | 17 | include_directories( 18 | ) 19 | 20 | link_directories( 21 | ${CMAKE_CURRENT_BINARY_DIR}/henkaku-stubs 22 | ) 23 | 24 | if (NOT ${RELEASE}) 25 | add_definitions(-DENABLE_LOGGING) 26 | endif() 27 | 28 | # Builds 29 | function(ADD_RESOURCES out_var) 30 | set(result) 31 | foreach(in_f ${ARGN}) 32 | set(out_f "${CMAKE_CURRENT_BINARY_DIR}/${in_f}.o") 33 | get_filename_component(out_dir ${out_f} DIRECTORY) 34 | add_custom_command(OUTPUT ${out_f} 35 | COMMAND ${CMAKE_COMMAND} -E make_directory ${out_dir} 36 | COMMAND ${CMAKE_LINKER} -r -b binary -o ${out_f} ${in_f} 37 | DEPENDS ${in_f} 38 | WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} 39 | COMMENT "Building resource ${out_f}" 40 | VERBATIM 41 | ) 42 | list(APPEND result ${out_f}) 43 | endforeach() 44 | set(${out_var} "${result}" PARENT_SCOPE) 45 | endfunction() 46 | 47 | file(GLOB res_files RELATIVE ${CMAKE_SOURCE_DIR} *.xml) 48 | add_resources(xml_res ${res_files}) 49 | 50 | add_executable(user 51 | ${xml_res} 52 | user.c 53 | ) 54 | 55 | add_executable(kernel 56 | kernel.c 57 | ) 58 | 59 | target_link_libraries(user 60 | taihen_stub 61 | HENkaku_stub 62 | SceLibKernel_stub 63 | SceIofilemgr_stub 64 | SceRegistryMgr_stub 65 | ScePower_stub 66 | SceVshBridge_stub 67 | ) 68 | 69 | target_link_libraries(kernel 70 | gcc 71 | taihenForKernel_stub 72 | SceSysmemForDriver_stub 73 | SceSysclibForDriver_stub 74 | SceIofilemgrForDriver_stub 75 | SceDebugForDriver_stub 76 | SceModulemgrForDriver_stub 77 | SceThreadmgrForDriver_stub 78 | SceSysrootForKernel_stub 79 | ) 80 | 81 | add_dependencies(user henkaku-stubs) 82 | 83 | set_target_properties(kernel 84 | PROPERTIES LINK_FLAGS "-nostdlib" 85 | COMPILE_FLAGS "-D__VITA_KERNEL__" 86 | ) 87 | 88 | set_target_properties(user 89 | PROPERTIES LINK_FLAGS "-nostdlib" 90 | ) 91 | 92 | vita_create_self(henkaku.skprx kernel 93 | UNSAFE 94 | CONFIG ${CMAKE_SOURCE_DIR}/kernel.yml 95 | ) 96 | vita_create_stubs(henkaku-stubs kernel ${CMAKE_SOURCE_DIR}/kernel.yml 97 | KERNEL 98 | ) 99 | vita_create_self(henkaku.suprx user 100 | UNSAFE 101 | CONFIG ${CMAKE_SOURCE_DIR}/user.yml 102 | ) 103 | 104 | install(DIRECTORY ${CMAKE_BINARY_DIR}/henkaku-stubs/ 105 | DESTINATION lib 106 | FILES_MATCHING PATTERN "*.a" 107 | ) 108 | -------------------------------------------------------------------------------- /henkaku/henkaku_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 18 | 19 | 20 | 24 | 25 | 26 | 32 | 33 | 34 | 38 | 41 | 44 | 45 | 46 | 47 | 53 | 54 | 55 | 56 | 57 |