diff --git a/CMakeLists.txt b/CMakeLists.txt index d97273b..c1cccb4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ if(NOT DEFINED CMAKE_TOOLCHAIN_FILE) endif() endif() -set(PLUGIN_PROJECT CoreUnlocker80000H) +set(PLUGIN_PROJECT CapUnlocker) project(${PLUGIN_PROJECT}) include("${DOLCESDK}/share/dolce.cmake" REQUIRED) @@ -28,6 +28,6 @@ set_target_properties(${PLUGIN_PROJECT} PROPERTIES LINK_FLAGS "-nostdlib" ) -dolce_create_self(CoreUnlocker80000H.skprx ${PLUGIN_PROJECT} - CONFIG ${CMAKE_SOURCE_DIR}/CoreUnlocker80000H.yml +dolce_create_self(CapUnlocker.skprx ${PLUGIN_PROJECT} + CONFIG ${CMAKE_SOURCE_DIR}/CapUnlocker.yml ) diff --git a/CapUnlocker.yml b/CapUnlocker.yml new file mode 100644 index 0000000..c2dc2a7 --- /dev/null +++ b/CapUnlocker.yml @@ -0,0 +1,8 @@ +CapUnlocker: + attributes: 0 + version: + major: 0 + minor: 1 + main: + start: module_start + stop: module_stop diff --git a/main.c b/main.c index 06338fe..68b8584 100644 --- a/main.c +++ b/main.c @@ -5,10 +5,14 @@ #include #include -static tai_hook_ref_t hook_ref; -static SceUID hook_id; +static tai_hook_ref_t hook_ref[2]; +static SceUID hook_id[2]; + +static int isAllowedToMount_patched(int a1) +{ + return 1; +} -// yes, it is really that easy static int isIllegalAffinity_patched(int a1, int a2, int a3) { return 0; @@ -19,15 +23,26 @@ int module_start(SceSize argc, const void *args) { tai_module_info_t info; info.size = sizeof(tai_module_info_t); - taiGetModuleInfoForKernel(KERNEL_PID, "SceKernelThreadMgr", &info); + taiGetModuleInfoForKernel(KERNEL_PID, "SceAppMgr", &info); - hook_id = taiHookFunctionOffsetForKernel( + hook_id[0] = taiHookFunctionOffsetForKernel( KERNEL_PID, - &hook_ref, + &hook_ref[0], info.modid, 0, - 0x114C, + 0x15d54, 1, + isAllowedToMount_patched); + + taiGetModuleInfoForKernel(KERNEL_PID, "SceKernelThreadMgr", &info); + + hook_id[1] = taiHookFunctionOffsetForKernel( + KERNEL_PID, + &hook_ref[1], + info.modid, + 0, + 0x114C, + 1, isIllegalAffinity_patched); return SCE_KERNEL_START_SUCCESS; @@ -35,6 +50,7 @@ int module_start(SceSize argc, const void *args) int module_stop(SceSize argc, const void *args) { - if(hook_id >= 0) taiHookReleaseForKernel(hook_id, hook_ref); + if(hook_id[0] >= 0) taiHookReleaseForKernel(hook_id[0], hook_ref[0]); + if(hook_id[1] >= 0) taiHookReleaseForKernel(hook_id[1], hook_ref[1]); return SCE_KERNEL_STOP_SUCCESS; }