Skip to content

Commit

Permalink
remove sandbox
Browse files Browse the repository at this point in the history
  • Loading branch information
bucanero committed Dec 12, 2024
1 parent 51641bc commit c5a112a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 36 deletions.
17 changes: 3 additions & 14 deletions source/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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;
}
Expand All @@ -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();

Expand Down
26 changes: 4 additions & 22 deletions source/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
}
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c5a112a

Please sign in to comment.