diff --git a/source/init.c b/source/init.c index 143abc8..885402e 100644 --- a/source/init.c +++ b/source/init.c @@ -60,14 +60,8 @@ int init_devices(void) { struct stat s; memset(&s, 0, sizeof(struct stat)); - // mount required devices into sandbox - if (jbc_mount_in_sandbox("/dev/", "rootdev") != 0) { - LOG("Failed to mount devices"); - return -1; - } - // create devices - if (stat("/rootdev/pfsctldev", &s) == -1) { + if (stat("/dev/pfsctldev", &s) == -1) { LOG("err stat pfsctldev"); return -2; } @@ -80,7 +74,7 @@ int init_devices(void) { memset(&s, 0, sizeof(struct stat)); - if (stat("/rootdev/lvdctl", &s) == -1) { + if (stat("/dev/lvdctl", &s) == -1) { LOG("err stat lvdctl"); return -3; } @@ -93,7 +87,7 @@ int init_devices(void) { memset(&s, 0, sizeof(struct stat)); - if (stat("/rootdev/sbl_srv", &s) == -1) { + if (stat("/dev/sbl_srv", &s) == -1) { LOG("err stat sbl_srv"); return -4; } @@ -104,11 +98,6 @@ int init_devices(void) { } } - // now unmount devices - if (jbc_unmount_in_sandbox("rootdev") != 0) { - LOG("Failed to unmount rootdev"); - } - // get max keyset that can be decrypted getMaxKeySet(); diff --git a/source/sd.c b/source/sd.c index 7871450..4f344a5 100644 --- a/source/sd.c +++ b/source/sd.c @@ -23,21 +23,10 @@ void (*statfs)(); // must be loaded upon setup int loadPrivLibs(void) { - const char privDir[] = "/system/priv/lib"; - const char commonDir[] = "/system/common/lib"; int sys; int kernel_sys; - if (jbc_mount_in_sandbox(privDir, "priv") != 0) { - LOG("Failed to mount system/priv/lib directory"); - return -1; - } - - sys = sceKernelLoadStartModule("/priv/libSceFsInternalForVsh.sprx", 0, NULL, 0, NULL, NULL); - if (jbc_unmount_in_sandbox("priv") != 0) { - LOG("Failed to unmount priv"); - } - + sys = sceKernelLoadStartModule("/system/priv/lib/libSceFsInternalForVsh.sprx", 0, NULL, 0, NULL, NULL); if (sys >= 0) { sceKernelDlsym(sys, "sceFsInitCreatePfsSaveDataOpt", (void **)&sceFsInitCreatePfsSaveDataOpt); sceKernelDlsym(sys, "sceFsCreatePfsSaveDataImage", (void **)&sceFsCreatePfsSaveDataImage); @@ -52,15 +41,7 @@ int loadPrivLibs(void) { return -2; } - if (jbc_mount_in_sandbox(commonDir, "common") != 0) { - LOG("Failed to mount /system/common/lib directory"); - return -3; - } - kernel_sys = sceKernelLoadStartModule("/common/libkernel_sys.sprx", 0, NULL, 0, NULL, NULL); - if (jbc_unmount_in_sandbox("common") != 0) { - LOG("Failed to unmount common"); - } - + kernel_sys = sceKernelLoadStartModule("/system/common/lib/libkernel_sys.sprx", 0, NULL, 0, NULL, NULL); if (kernel_sys >= 0) { sceKernelDlsym(kernel_sys, "statfs", (void **)&statfs); } @@ -244,7 +225,8 @@ int umountSave(const char *mountPath, int handle, bool ignoreErrors) { return sceFsUmountSaveData(&opt, mountPath, handle, ignoreErrors); } -uint16_t maxKeyset = 0; +static uint16_t maxKeyset = 0; + uint16_t getMaxKeySet(void) { if (maxKeyset > 0) { return maxKeyset;