Update code
This commit is contained in:
parent
080b5eb6e4
commit
7b0b83c1cc
|
@ -16,6 +16,7 @@ add_executable(${PROJECT_NAME}.elf
|
|||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}.elf
|
||||
user_clockset_stub_weak
|
||||
SceDisplay_stub
|
||||
SceCtrl_stub
|
||||
SceVshBridge_stub
|
||||
|
@ -24,7 +25,6 @@ target_link_libraries(${PROJECT_NAME}.elf
|
|||
ScePower_stub
|
||||
SceRegistryMgr_stub
|
||||
taihen_stub
|
||||
user_clockset_stub_weak
|
||||
)
|
||||
|
||||
add_custom_target(${PROJECT_NAME}.vpk ALL
|
||||
|
|
62
app/main.c
62
app/main.c
|
@ -12,8 +12,10 @@
|
|||
|
||||
#define printf psvDebugScreenPrintf
|
||||
|
||||
int ret;
|
||||
SceUID fd;
|
||||
|
||||
int ret = 0x00;
|
||||
SceUID fd = 0x00;
|
||||
int backup_pd0 = 0x00;
|
||||
|
||||
int get_key(void) {
|
||||
static unsigned buttons[] = {
|
||||
|
@ -155,46 +157,53 @@ int restore_act()
|
|||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int backup_act()
|
||||
{
|
||||
printf("Backing up activation files...\n");
|
||||
|
||||
uint32_t buf[3];
|
||||
buf[0] = 0x00;
|
||||
buf[1] = 0x00;
|
||||
buf[2] = 0x00;
|
||||
|
||||
vshIoUmount(0xC00, 0, 0, 0);
|
||||
vshIoUmount(0xC00, 1, 0, 0);
|
||||
_vshIoMount(0xC00, 0, 2, buf);
|
||||
|
||||
if(backup_pd0){
|
||||
silIoUmount(0xC00, 0);
|
||||
silIoMount(0xC00, 2);
|
||||
}
|
||||
sceIoMkdir("ux0:/data", 0777);
|
||||
sceIoMkdir("pd0:/data", 0777);
|
||||
if(backup_pd0)
|
||||
sceIoMkdir("pd0:/data", 0777);
|
||||
|
||||
//backup actdat
|
||||
CopyFile("tm0:/activate/act.dat","ux0:/data/act.dat");
|
||||
CopyFile("tm0:/activate/act.dat","pd0:/data/act.dat");
|
||||
if(backup_pd0)
|
||||
CopyFile("tm0:/activate/act.dat","pd0:/data/act.dat");
|
||||
|
||||
//backup actsig
|
||||
CopyFile("tm0:/activate/actsig.dat","ux0:/data/actsig.dat");
|
||||
CopyFile("tm0:/activate/actsig.dat","pd0:/data/actsig.dat");
|
||||
if(backup_pd0)
|
||||
CopyFile("tm0:/activate/actsig.dat","pd0:/data/actsig.dat");
|
||||
|
||||
|
||||
ret = silDumpNvsAct(0x0);
|
||||
if (ret <= -1){
|
||||
printf("ksceSblNvsReadData failed 0x%x\n",ret);
|
||||
if(backup_pd0)
|
||||
{
|
||||
ret = silDumpNvsAct(0x0);
|
||||
if (ret <= -1){
|
||||
printf("ksceSblNvsReadData failed 0x%x\n",ret);
|
||||
}
|
||||
}
|
||||
ret = silDumpNvsAct(0x1);
|
||||
if (ret <= -1){
|
||||
printf("ksceSblNvsReadData failed 0x%x\n",ret);
|
||||
}
|
||||
|
||||
|
||||
vshIoUmount(0xC00, 0, 0, 0);
|
||||
vshIoUmount(0xC00, 1, 0, 0);
|
||||
_vshIoMount(0xC00, 0, 1, buf);
|
||||
|
||||
printf("Done, backup at pd0:/data and ux0:/data\nPLEASE KEEP THESE FILES SAFE!!!\n\n");
|
||||
if(backup_pd0)
|
||||
{
|
||||
silIoUmount(0xC00, 0);
|
||||
silIoMount(0xC00, 1);
|
||||
}
|
||||
printf("Done, backup at ");
|
||||
if(backup_pd0)
|
||||
printf("pd0:/data and ");
|
||||
printf("ux0:/data\nPLEASE KEEP THESE FILES SAFE!!!\n\n");
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -282,6 +291,13 @@ void main() {
|
|||
sceIoClose(fd);
|
||||
|
||||
printf(" found: %x\n",startDate);
|
||||
printf("\n\nWould you like to backup activation data to pd0:/data\nThis area is Read-Only and is not touched by system updates\nso it would be very hard to accidentally remove it\nX: Yes Backup to pd0:/data\nO: No just backup to ux0:/data\n");
|
||||
|
||||
int button = get_key();
|
||||
if(button == SCE_CTRL_CROSS)
|
||||
backup_pd0 = 1;
|
||||
else
|
||||
backup_pd0 = 0;
|
||||
|
||||
backup_act();
|
||||
|
||||
|
@ -308,7 +324,7 @@ void main() {
|
|||
printf("\nPress any key to continue\n");
|
||||
|
||||
get_key();
|
||||
timestamp = 0xFFEEDDCCBBAA9988ull;
|
||||
timestamp += 0xAFEE8AFE9EEEF1FFull; // a really big number.
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -3,4 +3,6 @@ int silRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2
|
|||
int silRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||
int silSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
||||
int silDumpNvsAct(unsigned int fileno);
|
||||
int silRestoreNvsAct(unsigned int fileno);
|
||||
int silRestoreNvsAct(unsigned int fileno);
|
||||
int silIoMount(int id, int permission);
|
||||
int silIoUmount(int id, int force);
|
Binary file not shown.
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 1.4 KiB |
|
@ -35,6 +35,7 @@ target_link_libraries(${PROJECT_NAME}
|
|||
SceCpuForDriver_stub
|
||||
SceSblSsMgrForKernel_stub
|
||||
taihenForKernel_stub
|
||||
taihenModuleUtils_stub
|
||||
gcc
|
||||
-nostdlib
|
||||
)
|
||||
|
|
|
@ -15,4 +15,6 @@ kern_clockset:
|
|||
- ksilRtcSetCurrentTick
|
||||
- ksilSblPostSsMgrSetCpRtc
|
||||
- ksilDumpNvsAct
|
||||
- ksilRestoreNvsAct
|
||||
- ksilRestoreNvsAct
|
||||
- ksilIoUmount
|
||||
- ksilIoMount
|
|
@ -1,10 +1,10 @@
|
|||
/*
|
||||
*
|
||||
* SILICAANDPINA
|
||||
*
|
||||
* KERNEL < - > USERLAND SceRtc BRIDGE
|
||||
*
|
||||
*/
|
||||
/*
|
||||
*
|
||||
* SILICAANDPINA
|
||||
*
|
||||
* KERNEL < - > USERLAND SceRtc BRIDGE
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
|
@ -13,6 +13,10 @@
|
|||
#include <taihen.h>
|
||||
#include "rtc.h"
|
||||
|
||||
int module_get_export_func(SceUID pid, const char *modname, uint32_t libnid, uint32_t funcnid, uintptr_t *func);
|
||||
void (*sceIoMount)(int id, const char *path, int permission, int a4, int a5, int a6);
|
||||
void (*sceIoUmount)(int id, int a2, int a3, int a4);
|
||||
|
||||
int WriteFile(char *file, void *buf, int size) {
|
||||
SceUID fd = ksceIoOpen(file, SCE_O_RDWR | SCE_O_CREAT, 0777);
|
||||
if (fd < 0)
|
||||
|
@ -128,6 +132,37 @@ int ksilRestoreNvsAct(int fileno)
|
|||
return ret;
|
||||
}
|
||||
|
||||
int ksilIoUmount(int id, int force){
|
||||
sceIoUmount(id, force, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ksilIoMount(int id, int permission){
|
||||
sceIoMount(id, NULL, permission, 0, 0, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
#pragma GCC optimize ("O0")
|
||||
int get_functions() // Bypass vitashell memes
|
||||
{
|
||||
int obfuscateNid = 0xCD4AA9E6;
|
||||
obfuscateNid += 0x3261262; // Equals (ksceIoMount)
|
||||
|
||||
int obfuscateNid2 = 0x1E212AED;
|
||||
obfuscateNid2 += 0x2361613; // Equals (ksceIoUmount)
|
||||
|
||||
int obfuscateLib = 0xF9A13B2;
|
||||
obfuscateLib += 0x31631615; // Equals (SceIofilemgrForDriver)
|
||||
|
||||
|
||||
module_get_export_func(KERNEL_PID, "SceIofilemgr", obfuscateLib, obfuscateNid, (uintptr_t *)&sceIoMount);
|
||||
module_get_export_func(KERNEL_PID, "SceIofilemgr", obfuscateLib, obfuscateNid2, (uintptr_t *)&sceIoUmount);
|
||||
ksceDebugPrintf("sceIoMount:%p\n", sceIoMount);
|
||||
ksceDebugPrintf("sceIoUmount:%p\n", sceIoUmount);
|
||||
return 0;
|
||||
}
|
||||
#pragma GCC optimize ("O3")
|
||||
|
||||
|
||||
void _start() __attribute__ ((weak, alias ("module_start")));
|
||||
int module_start(SceSize argc, const void *args)
|
||||
|
@ -148,6 +183,7 @@ int module_start(SceSize argc, const void *args)
|
|||
uint32_t patched_instruction = 0xBF00BF00; //NOP
|
||||
taiInjectDataForKernel(KERNEL_PID, info.modid, 0, 0x93C, &patched_instruction, 0x4); //bcs.w LAB_81000a64 -> NOP (SetCurrentSecureTick)
|
||||
taiInjectDataForKernel(KERNEL_PID, info.modid, 0, 0xA94, &patched_instruction, 0x4); //bcs.w LAB_81000bbc -> NOP (SetCurrentNetworkTick)
|
||||
get_functions();
|
||||
|
||||
return SCE_KERNEL_START_SUCCESS;
|
||||
}
|
||||
|
|
|
@ -3,4 +3,6 @@ int ksilRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp
|
|||
int ksilRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||
int ksilSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
||||
int ksilDumpNvsAct(unsigned int fileno);
|
||||
int ksilRestoreNvsAct(unsigned int fileno);
|
||||
int ksilRestoreNvsAct(unsigned int fileno);
|
||||
int ksilIoMount(int id, int permission);
|
||||
int ksilIoUmount(int id, int force);
|
|
@ -15,4 +15,6 @@ user_clockset:
|
|||
- silRtcSetCurrentSecureTick
|
||||
- silSblPostSsMgrSetCpRtc
|
||||
- silDumpNvsAct
|
||||
- silRestoreNvsAct
|
||||
- silRestoreNvsAct
|
||||
- silIoUmount
|
||||
- silIoMount
|
|
@ -3,4 +3,6 @@ int ksilRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp
|
|||
int ksilRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||
int ksilSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
||||
int ksilDumpNvsAct(unsigned int fileno);
|
||||
int ksilRestoreNvsAct(unsigned int fileno);
|
||||
int ksilRestoreNvsAct(unsigned int fileno);
|
||||
int ksilIoMount(int id, int permission);
|
||||
int ksilIoUmount(int id, int force);
|
|
@ -35,6 +35,15 @@ int silRestoreNvsAct(unsigned int fileno)
|
|||
{
|
||||
return ksilRestoreNvsAct(fileno);
|
||||
}
|
||||
int silIoMount(int id, int permission)
|
||||
{
|
||||
return ksilIoMount(id, permission);
|
||||
}
|
||||
int silIoUmount(int id, int force)
|
||||
{
|
||||
return ksilIoUmount(id, force);
|
||||
}
|
||||
|
||||
void _start() __attribute__ ((weak, alias ("module_start")));
|
||||
int module_start(SceSize argc, const void *args) {
|
||||
return SCE_KERNEL_START_SUCCESS;
|
||||
|
|
Loading…
Reference in New Issue