-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
54bf58b
commit 9b0ed7d
Showing
5 changed files
with
50 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include <orbis/libkernel.h> | ||
|
||
int dynlib_get_obj_member(int module_id, int which, void** out); | ||
|
||
//obtain the target firmware of libkernel.sprx. should be the same as the current firmware, and bypasses spoofs | ||
uint32_t get_fw_version(void) | ||
{ | ||
int libkernel = sceKernelLoadStartModule("libkernel.sprx", 0, 0, 0, 0, 0); | ||
if(libkernel < 0) | ||
return -1; | ||
void* sce_proc_param; | ||
if(dynlib_get_obj_member(libkernel, 8, &sce_proc_param)) | ||
return -1; | ||
uint32_t* spp = sce_proc_param; | ||
return spp[4]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,34 @@ | ||
#include <unistd.h> | ||
#include <fcntl.h> | ||
#include "libjbc/utils.h" | ||
#include <errno.h> | ||
#include <orbis/libkernel.h> | ||
|
||
void load_tun_tsr(int); | ||
void load_uhack_tsr(int); | ||
int open(const char*, int); | ||
int close(int); | ||
|
||
int maybe_load_tun(void) | ||
uint32_t get_fw_version(void); | ||
|
||
static void do_maybe_load_tun(void* p_status) | ||
{ | ||
int* status = p_status; | ||
*status = 0; | ||
int fd = open("/dev/tun", 0); | ||
if(fd < 0) | ||
{ | ||
if(errno == ENOENT) | ||
{ | ||
OrbisKernelSwVersion sw_ver; | ||
sceKernelGetSystemSwVersion(&sw_ver); | ||
load_tun_tsr(sw_ver.i_version >> 16); | ||
return 0; | ||
load_tun_tsr(get_fw_version() >> 16); | ||
*status = 0; | ||
} | ||
return -1; | ||
*status = -1; | ||
return; | ||
} | ||
close(fd); | ||
return 0; | ||
return; | ||
} | ||
|
||
int maybe_load_tun(void) | ||
{ | ||
int status; | ||
jbc_run_as_root(do_maybe_load_tun, &status, CWD_RESET); | ||
return status; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters