int main(int argc, const char *argv[]) { char *titleid = get_title_id(PACKAGE_DIR "/sce_sys/param.sfo"); if (titleid && strcmp(titleid, "VITASHELL") == 0) { if (promote(PACKAGE_DIR) >= 0) launchAppByUriExit("VITASHELL"); } return sceKernelExitProcess(0); }
int VIsoFile::open(const char *path, int flags) { file_stat_t st; char gameCode[128]; char volumeName[32]; if (flags != O_RDONLY) return -1; if (fsBuf) { close(); } if (stat_file(path, &st) != 0) { return -1; } if ((st.mode & S_IFDIR) != S_IFDIR) { return -1; } if (ps3Mode) { if (!get_title_id(path, gameCode)) return -1; strcpy(volumeName, "PS3VOLUME"); } else { const char *dn = strrchr(path, '/'); if (dn) dn++; else dn = path; snprintf(volumeName, sizeof(volumeName), "%s", dn); } if (!generate((char *)path, volumeName, gameCode)) return -1; return 0; }