This commit is contained in:
SilicaAndPina 2019-11-13 17:06:09 +13:00
parent 5ea85a0c72
commit 3784cff547
1 changed files with 8 additions and 11 deletions

View File

@ -270,7 +270,7 @@ void main() {
printf("Finding expiration start date..."); printf("Finding expiration start date...");
unsigned char startDate[0x4]; unsigned int startDate;
fd = sceIoOpen("tm0:/activate/act.dat",SCE_O_RDONLY, 0444); fd = sceIoOpen("tm0:/activate/act.dat",SCE_O_RDONLY, 0444);
if(fd <= -1) if(fd <= -1)
{ {
@ -281,28 +281,25 @@ void main() {
sceIoRead(fd,&startDate,0x04); sceIoRead(fd,&startDate,0x04);
sceIoClose(fd); sceIoClose(fd);
printf(" found: 0x%02X%02X%02X%02X\n",startDate[0],startDate[1],startDate[2],startDate[3]); printf(" found: %x\n",startDate);
backup_act(); backup_act();
if(vshSblAimgrIsTool()) //devkit if(vshSblAimgrIsTool()) //devkit
{ {
unsigned int timestamp = *((unsigned int*)&startDate); printf("Updating CPRTC to %x\n",startDate);
printf("Updating CPRTC to %x\n",timestamp); ret = silSblPostSsMgrSetCpRtc(startDate);
ret = silSblPostSsMgrSetCpRtc(timestamp);
sceRegMgrSetKeyInt("/CONFIG/DATE", "set_automatically", 0); sceRegMgrSetKeyInt("/CONFIG/DATE", "set_automatically", 0);
printf("has ret 0x%x\n",ret); printf("has ret 0x%x\n",ret);
} }
else if(vshSblAimgrIsDEX()) //testkit else if(vshSblAimgrIsDEX()) //testkit
{ {
printf("Calculating PSTime: ");
unsigned int _startDate = *((unsigned int*)&startDate); unsigned long long int timestamp = startDate;
timestamp = ((timestamp * 1000) + 62135596800000) * 1000;
uint64_t timestamp = 0;
timestamp = ((_startDate * 1000) + 62135596800000) * 1000;
printf("PSTIME: %llx\n",timestamp); printf("PSTIME: %llx\n",timestamp);
if(_startDate < 1420070400); if(startDate <= 0x54A48E00)
{ {
printf("Warn: Start Date is Before 1/1/2015\n"); printf("Warn: Start Date is Before 1/1/2015\n");
printf("It's impossible to set the time before 1/1/2015.\n"); printf("It's impossible to set the time before 1/1/2015.\n");