Backup act data from NVS
This commit is contained in:
parent
d4344ae572
commit
d4021ee02b
17
app/main.c
17
app/main.c
|
@ -225,11 +225,22 @@ void main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//backup nvs
|
||||||
|
|
||||||
|
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, 0, 0, 0);
|
||||||
vshIoUmount(0xC00, 1, 0, 0);
|
vshIoUmount(0xC00, 1, 0, 0);
|
||||||
_vshIoMount(0xC00, 0, 1, buf);
|
_vshIoMount(0xC00, 0, 1, buf);
|
||||||
|
|
||||||
printf("Done, backup at pd0:/data and ux0:/data\n");
|
printf("Done, backup at pd0:/data and ux0:/data\n\nPLEASE KEEP THESE FILES SAFE!!!");
|
||||||
|
|
||||||
|
|
||||||
if(vshSblAimgrIsTool())
|
if(vshSblAimgrIsTool())
|
||||||
|
@ -270,10 +281,6 @@ void main() {
|
||||||
ret = silRtcSetCurrentSecureTick(split2,split1);
|
ret = silRtcSetCurrentSecureTick(split2,split1);
|
||||||
printf("has ret 0x%x\n",ret);
|
printf("has ret 0x%x\n",ret);
|
||||||
|
|
||||||
printf("Updating NetworkTick.. ");
|
|
||||||
ret = silRtcSetCurrentNetworkTick(0xe256fc7,0x8eba240);
|
|
||||||
printf("has ret 0x%x\n",ret);
|
|
||||||
|
|
||||||
sceRegMgrSetKeyInt("/CONFIG/DATE", "set_automatically", 0);
|
sceRegMgrSetKeyInt("/CONFIG/DATE", "set_automatically", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
int silRtcSetCurrentTick(unsigned int timestamp1, unsigned int timestamp2);
|
int silRtcSetCurrentTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int silRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2);
|
int silRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int silRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
int silRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int silSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
int silSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
||||||
|
int silDumpNvsAct(unsigned int filenos);
|
|
@ -33,6 +33,7 @@ target_link_libraries(${PROJECT_NAME}
|
||||||
SceRtcForDriver_stub
|
SceRtcForDriver_stub
|
||||||
SceSblPostSsMgrForDriver_stub
|
SceSblPostSsMgrForDriver_stub
|
||||||
SceCpuForDriver_stub
|
SceCpuForDriver_stub
|
||||||
|
SceSblSsMgrForKernel_stub
|
||||||
taihenForKernel_stub
|
taihenForKernel_stub
|
||||||
gcc
|
gcc
|
||||||
-nostdlib
|
-nostdlib
|
||||||
|
|
|
@ -13,4 +13,5 @@ kern_clockset:
|
||||||
- ksilRtcSetCurrentSecureTick
|
- ksilRtcSetCurrentSecureTick
|
||||||
- ksilRtcSetCurrentNetworkTick
|
- ksilRtcSetCurrentNetworkTick
|
||||||
- ksilRtcSetCurrentTick
|
- ksilRtcSetCurrentTick
|
||||||
- ksilSblPostSsMgrSetCpRtc
|
- ksilSblPostSsMgrSetCpRtc
|
||||||
|
- ksilDumpNvsAct
|
|
@ -9,10 +9,21 @@
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <vitasdk.h>
|
#include <vitasdkkern.h>
|
||||||
#include <taihen.h>
|
#include <taihen.h>
|
||||||
#include "rtc.h"
|
#include "rtc.h"
|
||||||
|
|
||||||
|
int WriteFile(char *file, void *buf, int size) {
|
||||||
|
SceUID fd = ksceIoOpen(file, SCE_O_RDWR | SCE_O_CREAT, 0777);
|
||||||
|
if (fd < 0)
|
||||||
|
return fd;
|
||||||
|
|
||||||
|
int written = ksceIoWrite(fd, buf, size);
|
||||||
|
|
||||||
|
ksceIoClose(fd);
|
||||||
|
return written;
|
||||||
|
}
|
||||||
|
|
||||||
int ksilRtcSetCurrentTick(unsigned int timestamp1,unsigned int timestamp2)
|
int ksilRtcSetCurrentTick(unsigned int timestamp1,unsigned int timestamp2)
|
||||||
{
|
{
|
||||||
unsigned int timestamp[2];
|
unsigned int timestamp[2];
|
||||||
|
@ -48,6 +59,22 @@ int ksilSblPostSsMgrSetCpRtc(unsigned int timestamp)
|
||||||
return ksceSblPostSsMgrSetCpRtc(timestamp);
|
return ksceSblPostSsMgrSetCpRtc(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int ksilDumpNvsAct(int fileno)
|
||||||
|
{
|
||||||
|
char nvsBuf[0x20];
|
||||||
|
memset(nvsBuf,0x00,0x520);
|
||||||
|
|
||||||
|
int ret = ksceSblNvsReadData(0x520,nvsBuf,0x20);
|
||||||
|
if(fileno == 1)
|
||||||
|
{
|
||||||
|
WriteFile("ux0:/data/act-nvs.dat",nvsBuf,0x20);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
WriteFile("pd0:/data/act-nvs.dat",nvsBuf,0x20);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void _start() __attribute__ ((weak, alias ("module_start")));
|
void _start() __attribute__ ((weak, alias ("module_start")));
|
||||||
|
@ -55,6 +82,8 @@ int module_start(SceSize argc, const void *args)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* 1/1/2015 check BTFO'd
|
* 1/1/2015 check BTFO'd
|
||||||
|
*
|
||||||
|
* Vita checks elsewhere though :'(
|
||||||
*/
|
*/
|
||||||
|
|
||||||
tai_module_info_t info;
|
tai_module_info_t info;
|
||||||
|
|
|
@ -2,4 +2,6 @@ int ksceRtcSetCurrentTick(unsigned int* timestamp);
|
||||||
int ksceRtcSetCurrentNetworkTick(unsigned int* timestamp);
|
int ksceRtcSetCurrentNetworkTick(unsigned int* timestamp);
|
||||||
int ksceRtcSetCurrentSecureTick(unsigned int* timestamp);
|
int ksceRtcSetCurrentSecureTick(unsigned int* timestamp);
|
||||||
|
|
||||||
int ksceSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
int ksceSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
||||||
|
|
||||||
|
int ksceSblNvsReadData(int offset,void* buffer,int size);
|
|
@ -1,4 +1,5 @@
|
||||||
int ksilRtcSetCurrentTick(unsigned int timestamp1, unsigned int timestamp2);
|
int ksilRtcSetCurrentTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int ksilRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2);
|
int ksilRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int ksilRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
int ksilRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int ksilSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
int ksilSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
||||||
|
int ksilDumpNvsAct(unsigned int fileno);
|
|
@ -14,3 +14,4 @@ user_clockset:
|
||||||
- silRtcSetCurrentTick
|
- silRtcSetCurrentTick
|
||||||
- silRtcSetCurrentSecureTick
|
- silRtcSetCurrentSecureTick
|
||||||
- silSblPostSsMgrSetCpRtc
|
- silSblPostSsMgrSetCpRtc
|
||||||
|
- silDumpNvsAct
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
int ksilRtcSetCurrentTick(unsigned int timestamp1, unsigned int timestamp2);
|
int ksilRtcSetCurrentTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int ksilRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2);
|
int ksilRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int ksilRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
int ksilRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
int ksilSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
int ksilSblPostSsMgrSetCpRtc(unsigned int timestamp);
|
||||||
|
int ksilDumpNvsAct(unsigned int fileno);
|
|
@ -1,3 +0,0 @@
|
||||||
int ksilRtcSetCurrentTick(unsigned int timestamp1, unsigned int timestamp2);
|
|
||||||
int ksilRtcSetCurrentNetworkTick(unsigned int timestamp1, unsigned int timestamp2);
|
|
||||||
int ksilRtcSetCurrentSecureTick(unsigned int timestamp1, unsigned int timestamp2);
|
|
|
@ -27,6 +27,10 @@ int silSblPostSsMgrSetCpRtc(unsigned int timestamp)
|
||||||
return ksilSblPostSsMgrSetCpRtc(timestamp);
|
return ksilSblPostSsMgrSetCpRtc(timestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int silDumpNvsAct(unsigned int fileno)
|
||||||
|
{
|
||||||
|
return ksilDumpNvsAct(fileno);
|
||||||
|
}
|
||||||
|
|
||||||
int module_start(SceSize argc, const void *args) {
|
int module_start(SceSize argc, const void *args) {
|
||||||
return SCE_KERNEL_START_SUCCESS;
|
return SCE_KERNEL_START_SUCCESS;
|
||||||
|
|
Loading…
Reference in New Issue