Compare commits
39 Commits
Author | SHA1 | Date |
---|---|---|
random() | 2593440911 | |
random() | 9b6b472cef | |
random() | 0862f38d6e | |
SilicaAndPina | 5e3d65d9e1 | |
SilicaAndPina | 6db7d0a124 | |
SilicaAndPina | f467a9e651 | |
SilicaAndPina | 0d11b84536 | |
SilicaAndPina | 8095be6a76 | |
SilicaAndPina | aaa2b239f2 | |
SilicaAndPina | 7e45ff54b0 | |
SilicaAndPina | e33d49994f | |
SilicaAndPina | 4d9ad8949c | |
SilicaAndPina | d5a62d6296 | |
AtelierWindows\SilicaAndPina | f0277c2a2b | |
SilicaAndPina | 3c4ac97316 | |
SilicaAndPina | 751eed0310 | |
SilicaAndPina | ff9692a11b | |
AtelierWindows\SilicaAndPina | 69e1d217bc | |
AtelierWindows\SilicaAndPina | 4c8c7c9633 | |
AtelierWindows\SilicaAndPina | e2eb32beee | |
SilicaAndPina | fcae55b5ec | |
AtelierWindows\SilicaAndPina | b474291ec6 | |
SilicaAndPina | 8bfc5cb9be | |
SilicaAndPina | e5db37c682 | |
AtelierWindows\SilicaAndPina | 0ea9193199 | |
SilicaAndPina | 824ff31c39 | |
SilicaAndPina | 9afba3b735 | |
SilicaAndPina | 51e261de4f | |
AtelierWindows\SilicaAndPina | cce8c4ab73 | |
AtelierWindows\SilicaAndPina | 9ca4219d87 | |
SilicaAndPina | 1e024c1e3b | |
SilicaAndPina | 8e274faf3d | |
SilicaAndPina | b0f1e69519 | |
SilicaAndPina | b171b0aa54 | |
SilicaAndPina | 33124304a4 | |
SilicaAndPina | 95b5dcb045 | |
AtelierWindows\SilicaAndPina | c80070230b | |
AtelierWindows\SilicaAndPina | 1e8243b897 | |
AtelierWindows\SilicaAndPina | 765618585f |
24
README.md
24
README.md
|
@ -1,2 +1,22 @@
|
||||||
# TropHAX-SE
|
|
||||||
TropHAX Standalone Edition
|
# Will i get banned?
|
||||||
|
Probably not, no one has ever gotten banned on vita
|
||||||
|
even in the past when using other trophy hacks such as:
|
||||||
|
TropHAX.suprx TrophyPather or PSVTrophyIsGood
|
||||||
|
|
||||||
|
If you claim "me was banned" - ConsoleID or GTFO
|
||||||
|
give me ur CID and ill check if it really is until then-
|
||||||
|
assume such claims are bullsheet
|
||||||
|
|
||||||
|
# TropHAXSE
|
||||||
|
TropHAX Standalone Edition
|
||||||
|
A homebrew app that can unlock trophys for any game.
|
||||||
|
Unlike the original TropHAX.SUPRX however, this is compadible with 100% of games!
|
||||||
|
You simply need the game installed and the trophy files inside ur0:/trophy and you can unlock stuffs!
|
||||||
|
|
||||||
|
# Credits
|
||||||
|
Li - Lead developer, - working out how trophys work and stuff.
|
||||||
|
TheFlow (vitashell) - For trop_dat0: mounting code
|
||||||
|
Princess Of Sleeping - For helping me with trop_dat0: mounting
|
||||||
|
AnalogMan - for doing UI Stuffs
|
||||||
|
Zecoaxco - ksceRtcSetCurrentTick();
|
|
@ -20,7 +20,7 @@ set(VITA_VERSION "01.00")
|
||||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
||||||
|
|
||||||
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1")
|
set(VITA_MKSFOEX_FLAGS "${VITA_MKSFOEX_FLAGS} -d PARENTAL_LEVEL=1 -s CATEGORY=gdb")
|
||||||
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2808000000000000")
|
set(VITA_MAKE_FSELF_FLAGS "${VITA_MAKE_FSELF_FLAGS} -a 0x2808000000000000")
|
||||||
|
|
||||||
include_directories(
|
include_directories(
|
||||||
|
@ -61,8 +61,8 @@ vita_create_vpk(${PROJECT_NAME}.vpk ${VITA_TITLEID} eboot.bin
|
||||||
FILE kernel.skprx module/kernel.skprx
|
FILE kernel.skprx module/kernel.skprx
|
||||||
FILE user.suprx module/user.suprx
|
FILE user.suprx module/user.suprx
|
||||||
|
|
||||||
#FILE sce_sys/icon0.png sce_sys/icon0.png
|
FILE sce_sys/icon0.png sce_sys/icon0.png
|
||||||
#FILE sce_sys/livearea/contents/bg.png sce_sys/livearea/contents/bg.png
|
FILE sce_sys/livearea/contents/bg0.png sce_sys/livearea/contents/bg0.png
|
||||||
#FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
|
FILE sce_sys/livearea/contents/startup.png sce_sys/livearea/contents/startup.png
|
||||||
#FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
|
FILE sce_sys/livearea/contents/template.xml sce_sys/livearea/contents/template.xml
|
||||||
)
|
)
|
Binary file not shown.
After Width: | Height: | Size: 11 KiB |
Binary file not shown.
After Width: | Height: | Size: 172 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
|
@ -0,0 +1,23 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
|
||||||
|
<livearea style="a1" format-ver="01.00" content-rev="1">
|
||||||
|
<livearea-background>
|
||||||
|
<image>bg0.png</image>
|
||||||
|
</livearea-background>
|
||||||
|
|
||||||
|
<gate>
|
||||||
|
<startup-image>startup.png</startup-image>
|
||||||
|
</gate>
|
||||||
|
|
||||||
|
<frame id="frame1">
|
||||||
|
</frame>
|
||||||
|
|
||||||
|
<frame id="frame2">
|
||||||
|
</frame>
|
||||||
|
|
||||||
|
<frame id="frame3">
|
||||||
|
</frame>
|
||||||
|
|
||||||
|
</livearea>
|
||||||
|
|
||||||
|
|
818
app/src/main.c
818
app/src/main.c
|
@ -14,6 +14,7 @@
|
||||||
|
|
||||||
#include "debugScreen.h"
|
#include "debugScreen.h"
|
||||||
#include "np.h"
|
#include "np.h"
|
||||||
|
#include "rtc.h"
|
||||||
|
|
||||||
#define printf psvDebugScreenPrintf
|
#define printf psvDebugScreenPrintf
|
||||||
#define F psvDebugScreenFont
|
#define F psvDebugScreenFont
|
||||||
|
@ -214,7 +215,6 @@ int pfsMount(const char *path) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void sceNpTrophySetupDialogParamInit(SceNpTrophySetupDialogParam* param)
|
void sceNpTrophySetupDialogParamInit(SceNpTrophySetupDialogParam* param)
|
||||||
{
|
{
|
||||||
sceClibMemset( param, 0x0, sizeof(SceNpTrophySetupDialogParam) );
|
sceClibMemset( param, 0x0, sizeof(SceNpTrophySetupDialogParam) );
|
||||||
|
@ -227,6 +227,31 @@ void sceNpTrophySetupDialogParamInit(SceNpTrophySetupDialogParam* param)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
int setSecureTick(unsigned long long int psTime)
|
||||||
|
{
|
||||||
|
|
||||||
|
printf("setSecureTick: %llx\n",psTime);
|
||||||
|
|
||||||
|
printf("Creating splits..\n");
|
||||||
|
char hexint[15];
|
||||||
|
memset(hexint,0,15);
|
||||||
|
|
||||||
|
sprintf(hexint,"%llx",psTime);
|
||||||
|
|
||||||
|
char ts1[7] = {hexint[0],hexint[1],hexint[2],hexint[3],hexint[4],hexint[5],0x00};
|
||||||
|
unsigned long long int split1 = (unsigned int)strtoul(ts1, NULL, 16);
|
||||||
|
printf("Split1: %llx\n",split1);
|
||||||
|
|
||||||
|
|
||||||
|
char ts2[10] = {hexint[6],hexint[7],hexint[8],hexint[9],hexint[10],hexint[11],hexint[12],hexint[13],hexint[14],0x00};
|
||||||
|
unsigned long long int split2 = (unsigned int)strtoul(ts2, NULL, 16);
|
||||||
|
printf("Split2: %llx\n",split2);
|
||||||
|
|
||||||
|
return SetTrophyTimes(split2,split1);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
gxm_init();
|
gxm_init();
|
||||||
psvDebugScreenInit();
|
psvDebugScreenInit();
|
||||||
|
@ -378,7 +403,7 @@ start:
|
||||||
SceUChar8 commsign[160];
|
SceUChar8 commsign[160];
|
||||||
memset(commsign,0,160);
|
memset(commsign,0,160);
|
||||||
|
|
||||||
char path[1024];
|
char path[0x1128];
|
||||||
|
|
||||||
SceUID fd;
|
SceUID fd;
|
||||||
int len;
|
int len;
|
||||||
|
@ -428,33 +453,6 @@ start:
|
||||||
memset(location,0x0,0x1028);
|
memset(location,0x0,0x1028);
|
||||||
char checkPath[0x1028];
|
char checkPath[0x1028];
|
||||||
|
|
||||||
memset(checkPath,0x00,0x1028);
|
|
||||||
sprintf(checkPath,"ux0:/patch/%s/sce_sys/trophy/%s/TROPHY.TRP",titleidOfGame,commid);
|
|
||||||
|
|
||||||
if(getFileSize(checkPath) >=0)
|
|
||||||
{
|
|
||||||
sprintf(location,"ux0:/patch");
|
|
||||||
goto Found;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(checkPath,0x00,0x1028);
|
|
||||||
sprintf(checkPath,"grw0:/patch/%s/sce_sys/trophy/%s/TROPHY.TRP",titleidOfGame,commid);
|
|
||||||
|
|
||||||
if(getFileSize(checkPath) >=0)
|
|
||||||
{
|
|
||||||
sprintf(location,"grw0:/patch");
|
|
||||||
goto Found;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(checkPath,0x00,0x1028);
|
|
||||||
sprintf(checkPath,"ur0:/patch/%s/sce_sys/trophy/%s/TROPHY.TRP",titleidOfGame,commid);
|
|
||||||
|
|
||||||
if(getFileSize(checkPath) >=0)
|
|
||||||
{
|
|
||||||
sprintf(location,"ur0:/patch");
|
|
||||||
goto Found;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(checkPath,0x00,0x1028);
|
memset(checkPath,0x00,0x1028);
|
||||||
sprintf(checkPath,"ux0:/app/%s/sce_sys/trophy/%s/TROPHY.TRP",titleidOfGame,commid);
|
sprintf(checkPath,"ux0:/app/%s/sce_sys/trophy/%s/TROPHY.TRP",titleidOfGame,commid);
|
||||||
|
|
||||||
|
@ -490,8 +488,12 @@ start:
|
||||||
goto Found;
|
goto Found;
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("Cound not find %s\n",titleidOfGame);
|
printf("Cound not find %s (Possibly game not installed?)\n",titleidOfGame);
|
||||||
while(1){};
|
while(1){
|
||||||
|
sceCtrlPeekBufferPositive(0, &pad, 1)
|
||||||
|
if(pad.buttons == SCE_CTRL_CIRCLE)
|
||||||
|
goto start;
|
||||||
|
};
|
||||||
|
|
||||||
Found:
|
Found:
|
||||||
|
|
||||||
|
@ -499,17 +501,13 @@ Found:
|
||||||
|
|
||||||
|
|
||||||
sprintf(path,"%s/%s",location,titleidOfGame);
|
sprintf(path,"%s/%s",location,titleidOfGame);
|
||||||
ret = sceAppMgrGameDataMount(path,0,0,g_currentMount);
|
ret = sceAppMgrGameDataMount(path,0,0,g_currentMount); //GameDataMount mounts WITH patches, so no need to check for them
|
||||||
if(ret < 0){
|
if(ret < 0){
|
||||||
printf("sceAppMgrGameDataMount() failed. ret = 0x%x\n", ret);
|
printf("sceAppMgrGameDataMount() failed. ret = 0x%x\n", ret);
|
||||||
while(1){};
|
while(1){};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(path,0,0x1128);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
memset(path,0,1024);
|
|
||||||
sprintf(path,"%s/sce_sys/trophy/%s/TROPHY.TRP",g_currentMount,commid);
|
sprintf(path,"%s/sce_sys/trophy/%s/TROPHY.TRP",g_currentMount,commid);
|
||||||
size = getFileSize(path);
|
size = getFileSize(path);
|
||||||
if (size >=0)
|
if (size >=0)
|
||||||
|
@ -527,7 +525,7 @@ Found:
|
||||||
while(1){};
|
while(1){};
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(path,0,1024);
|
memset(path,0,0x1128);
|
||||||
sprintf(path,"ux0:app/%s/sce_sys",titleid);
|
sprintf(path,"ux0:app/%s/sce_sys",titleid);
|
||||||
sceIoMkdir(path,0006);
|
sceIoMkdir(path,0006);
|
||||||
sprintf(path,"ux0:app/%s/sce_sys/trophy",titleid);
|
sprintf(path,"ux0:app/%s/sce_sys/trophy",titleid);
|
||||||
|
@ -561,7 +559,7 @@ Found:
|
||||||
|
|
||||||
// remount app0
|
// remount app0
|
||||||
// CelesteBlue TAKE NOTES.
|
// CelesteBlue TAKE NOTES.
|
||||||
memset(path,0,1024);
|
memset(path,0,0x1128);
|
||||||
sprintf(path,"ux0:/app/%s",titleid);
|
sprintf(path,"ux0:/app/%s",titleid);
|
||||||
ret = pfsMount(path);
|
ret = pfsMount(path);
|
||||||
if(ret < 0){
|
if(ret < 0){
|
||||||
|
@ -727,7 +725,544 @@ TrophyMenu:
|
||||||
sceKernelDelayThread(150000);
|
sceKernelDelayThread(150000);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pad.buttons == SCE_CTRL_CIRCLE)
|
if(pad.buttons == SCE_CTRL_CIRCLE)
|
||||||
|
{
|
||||||
|
psvDebugScreenClear();
|
||||||
|
ret = sceNpTrophyDestroyContext(trophyContext);
|
||||||
|
if(ret < 0){
|
||||||
|
printf("sceNpTrophyDestroyContext() failed. ret = 0x%x\n", ret);
|
||||||
|
while(1){};
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = sceNpTrophyDestroyHandle(handle);
|
||||||
|
if(ret < 0){
|
||||||
|
printf("sceNpTrophyDestroyHandle() failed. ret = 0x%x\n", ret);
|
||||||
|
while(1){};
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = sceNpTrophyTerm();
|
||||||
|
if(ret < 0){
|
||||||
|
printf("sceNpTrophyTerm() failed. ret = 0x%x\n", ret);
|
||||||
|
while(1){};
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
sceKernelStopUnloadModule(user_modid, 0, NULL, 0, NULL, NULL);
|
||||||
|
taiStopUnloadKernelModule(kernel_modid, 0, NULL, 0, NULL, NULL);
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
goto start;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pad.buttons == SCE_CTRL_CROSS)
|
||||||
|
{
|
||||||
|
|
||||||
|
if(selection == 0)
|
||||||
|
{
|
||||||
|
//Show trophy selection menu
|
||||||
|
x = 1, y = 1, selection = 0, window = 0;
|
||||||
|
psvDebugScreenClear();
|
||||||
|
printf("Obtaining trophy count..");
|
||||||
|
SceNpTrophyGameDetails gameDetails = {0};
|
||||||
|
gameDetails.size = sizeof(SceNpTrophyGameDetails);
|
||||||
|
sceNpTrophyGetGameInfo(trophyContext,handle,&gameDetails,NULL);
|
||||||
|
size = gameDetails.numTrophies;
|
||||||
|
printf(" %i\n",size);
|
||||||
|
|
||||||
|
paths *trophy_list = malloc(sizeof(paths)*size);
|
||||||
|
SceNpTrophyDetails trophyDetails = {0};
|
||||||
|
trophyDetails.size = sizeof(SceNpTrophyDetails);
|
||||||
|
printf("Obtaining trophy names...");
|
||||||
|
for (int i=0; i < size; i++)
|
||||||
|
{
|
||||||
|
sceNpTrophyGetTrophyInfo(trophyContext,handle,i,&trophyDetails,NULL);
|
||||||
|
if(strcmp((char *)trophyDetails.name,"") !=0)
|
||||||
|
{
|
||||||
|
sprintf(trophy_list[i].path,"%.50s (%i)",trophyDetails.name,i);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sprintf(trophy_list[i].path,"Hidden Trophy (%i)",i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
printf("OK!\n");
|
||||||
|
sceKernelDelayThread(500000);
|
||||||
|
selectTrophyMenu:
|
||||||
|
psvDebugScreenClear();
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
char buf[256];
|
||||||
|
strncpy(buf, "**** TropHax StandAlone Edition ****", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s", 1, CENTERX(buf), buf);
|
||||||
|
strncpy(buf, "Choose a trophy:", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s", 2, CENTERX(buf), buf);
|
||||||
|
y = 3;
|
||||||
|
int max = (size < WINDOW_HEIGHT) ? size : WINDOW_HEIGHT;
|
||||||
|
for (int i=0; i < max; i++) {
|
||||||
|
if (i+window == selection)
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
printf("\e[%i;%iH%s", y, x, trophy_list[i+window].path);
|
||||||
|
y += 1;
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
}
|
||||||
|
strncpy(buf, "U/D: Select Trophy X: Unlock O: Return", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s", SCREEN_ROW, CENTERX(buf), buf);
|
||||||
|
memset(&pad, 0, sizeof(pad));
|
||||||
|
sceCtrlPeekBufferPositive(0, &pad, 1);
|
||||||
|
|
||||||
|
if (pad.buttons == SCE_CTRL_UP)
|
||||||
|
{
|
||||||
|
if (selection <= size - WINDOW_HEIGHT){
|
||||||
|
window -= 1;
|
||||||
|
}
|
||||||
|
if (window < 0){
|
||||||
|
window = 0;
|
||||||
|
}
|
||||||
|
selection -= 1;
|
||||||
|
if (selection < 0)
|
||||||
|
selection = 0;
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
if (pad.buttons == SCE_CTRL_DOWN)
|
||||||
|
{
|
||||||
|
if (selection >= WINDOW_HEIGHT - 1){
|
||||||
|
window += 1;
|
||||||
|
}
|
||||||
|
if (window > size - WINDOW_HEIGHT){
|
||||||
|
window = (size - WINDOW_HEIGHT < 0) ? 0 : size - WINDOW_HEIGHT;
|
||||||
|
}
|
||||||
|
selection += 1;
|
||||||
|
if (selection + 1 > size - 1)
|
||||||
|
selection = size - 1;
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
if (pad.buttons == SCE_CTRL_CROSS)
|
||||||
|
{
|
||||||
|
|
||||||
|
psvDebugScreenClear(); // Clear the screen!
|
||||||
|
sceKernelDelayThread(200000);
|
||||||
|
|
||||||
|
x = 1, y = 1;
|
||||||
|
int selection2 = 0;
|
||||||
|
int window2 = 0;
|
||||||
|
|
||||||
|
int size2 = 2;
|
||||||
|
paths *timeList = malloc(sizeof(paths)*size2);
|
||||||
|
|
||||||
|
|
||||||
|
//set options
|
||||||
|
strcpy(timeList[0].path, "Use Real SecureTick");
|
||||||
|
strcpy(timeList[1].path, "Use Fake SecureTick");
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
char buf[256];
|
||||||
|
strncpy(buf, "**** TropHax StandAlone Edition ****", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s", 1, CENTERX(buf), buf);
|
||||||
|
strncpy(buf, "Choose an Option:", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s", 2, CENTERX(buf), buf);
|
||||||
|
y = 3;
|
||||||
|
int max = (size2 < WINDOW_HEIGHT) ? size2 : WINDOW_HEIGHT;
|
||||||
|
for (int i=0; i < max; i++) {
|
||||||
|
if (i+window2 == selection2)
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
printf("\e[%i;%iH%s", y, x, timeList[i+window2].path);
|
||||||
|
y += 1;
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
}
|
||||||
|
strncpy(buf, "U/D: Select Option X: Confirm", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s", SCREEN_ROW, CENTERX(buf), buf);
|
||||||
|
memset(&pad, 0, sizeof(pad));
|
||||||
|
sceCtrlPeekBufferPositive(0, &pad, 1);
|
||||||
|
|
||||||
|
if (pad.buttons == SCE_CTRL_UP)
|
||||||
|
{
|
||||||
|
if (selection2 <= size2 - WINDOW_HEIGHT){
|
||||||
|
window2 -= 1;
|
||||||
|
}
|
||||||
|
if (window2 < 0){
|
||||||
|
window2 = 0;
|
||||||
|
}
|
||||||
|
selection2 -= 1;
|
||||||
|
if (selection2 < 0)
|
||||||
|
selection2 = 0;
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
if (pad.buttons == SCE_CTRL_DOWN)
|
||||||
|
{
|
||||||
|
if (selection2 >= WINDOW_HEIGHT - 1){
|
||||||
|
window2 += 1;
|
||||||
|
}
|
||||||
|
if (window2 > size2 - WINDOW_HEIGHT){
|
||||||
|
window2 = (size2 - WINDOW_HEIGHT < 0) ? 0 : size2 - WINDOW_HEIGHT;
|
||||||
|
}
|
||||||
|
selection2 += 1;
|
||||||
|
if (selection2 + 1 > size2 - 1)
|
||||||
|
selection2 = size2 - 1;
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
if (pad.buttons == SCE_CTRL_CROSS)
|
||||||
|
{
|
||||||
|
if(selection2 == 0)
|
||||||
|
{
|
||||||
|
psvDebugScreenClear();
|
||||||
|
printf("Unlocking trophy %i\n",selection);
|
||||||
|
SceNpTrophyId id = selection;
|
||||||
|
SceNpTrophyId platid;
|
||||||
|
|
||||||
|
ret = sceNpTrophyUnlockTrophy(trophyContext,handle,id,&platid);
|
||||||
|
if(ret < 0){
|
||||||
|
if(ret == 0x8055160f)
|
||||||
|
{
|
||||||
|
printf("Trophy %li is allready unlocked.\n",id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("sceNpTrophyUnlockTrophy() failed. ret = 0x%x\n", ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Successfully unlocked trophy %li\n",id);
|
||||||
|
|
||||||
|
SceNpTrophyDetails trophyDetails = {0};
|
||||||
|
trophyDetails.size = sizeof(SceNpTrophyDetails);
|
||||||
|
sceNpTrophyGetTrophyInfo(trophyContext,handle,id,&trophyDetails,NULL);
|
||||||
|
memset(trophy_list[id].path,0x00,sizeof(trophy_list[id].path));
|
||||||
|
sprintf(trophy_list[id].path,"%.50s (%li)",trophyDetails.name,id);
|
||||||
|
|
||||||
|
}
|
||||||
|
sceKernelDelayThread(500000);
|
||||||
|
goto selectTrophyMenu;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(selection2 == 1)
|
||||||
|
{
|
||||||
|
psvDebugScreenClear();
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
int selectedPartOfTime = 0;
|
||||||
|
|
||||||
|
SceDateTime dateTime;
|
||||||
|
memset(&dateTime,0x00,sizeof(SceDateTime));
|
||||||
|
|
||||||
|
SceRtcTick fakeTime = {0};
|
||||||
|
sceRtcGetCurrentTick(&fakeTime);
|
||||||
|
sceRtcConvertUtcToLocalTime(&fakeTime,&fakeTime);
|
||||||
|
|
||||||
|
sceRtcSetTick(&dateTime,&fakeTime);
|
||||||
|
|
||||||
|
while(1)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
char buf[256];
|
||||||
|
strncpy(buf, "**** TropHax StandAlone Edition ****", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s\n", 1, CENTERX(buf), buf);
|
||||||
|
printf("Set SecureTick: (DD/MM/YY H:M:S)\n");
|
||||||
|
|
||||||
|
|
||||||
|
if(selectedPartOfTime == 0)
|
||||||
|
{
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
}
|
||||||
|
printf("%02d",dateTime.day);
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
printf("/");
|
||||||
|
|
||||||
|
if(selectedPartOfTime == 1)
|
||||||
|
{
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
}
|
||||||
|
printf("%02d",dateTime.month);
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
printf("/");
|
||||||
|
|
||||||
|
if(selectedPartOfTime == 2)
|
||||||
|
{
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
}
|
||||||
|
printf("%02d",dateTime.year);
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
printf(" ");
|
||||||
|
|
||||||
|
if(selectedPartOfTime == 3)
|
||||||
|
{
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
}
|
||||||
|
printf("%02d",dateTime.hour);
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
printf(":");
|
||||||
|
|
||||||
|
if(selectedPartOfTime == 4)
|
||||||
|
{
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
}
|
||||||
|
printf("%02d",dateTime.minute);
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
printf(":");
|
||||||
|
|
||||||
|
if(selectedPartOfTime == 5)
|
||||||
|
{
|
||||||
|
psvDebugScreenSetFgColor(0xFF0000);
|
||||||
|
}
|
||||||
|
printf("%02d",dateTime.second);
|
||||||
|
psvDebugScreenSetFgColor(0xFFFFFF);
|
||||||
|
printf("\n\nResulting timestamp:\n");
|
||||||
|
|
||||||
|
printf("%llx",fakeTime.tick);
|
||||||
|
|
||||||
|
strncpy(buf, "U/D: Increment/Decrement L/R: Part of Date X: Confirm", sizeof(buf));
|
||||||
|
printf("\e[%i;%iH%s", SCREEN_ROW, CENTERX(buf), buf);
|
||||||
|
|
||||||
|
memset(&pad, 0, sizeof(pad));
|
||||||
|
sceCtrlPeekBufferPositive(0, &pad, 1);
|
||||||
|
if(pad.buttons == SCE_CTRL_RIGHT)
|
||||||
|
{
|
||||||
|
selectedPartOfTime ++;
|
||||||
|
|
||||||
|
if(selectedPartOfTime >= 5)
|
||||||
|
{
|
||||||
|
selectedPartOfTime = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
if(pad.buttons == SCE_CTRL_LEFT)
|
||||||
|
{
|
||||||
|
selectedPartOfTime --;
|
||||||
|
|
||||||
|
if(selectedPartOfTime <= 0)
|
||||||
|
{
|
||||||
|
selectedPartOfTime = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pad.buttons == SCE_CTRL_UP)
|
||||||
|
{
|
||||||
|
if(selectedPartOfTime == 0)
|
||||||
|
{
|
||||||
|
dateTime.day ++;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.day --;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 1)
|
||||||
|
{
|
||||||
|
dateTime.month ++;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.month --;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 2)
|
||||||
|
{
|
||||||
|
dateTime.year ++;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.year --;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 3)
|
||||||
|
{
|
||||||
|
dateTime.hour ++;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.hour --;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 4)
|
||||||
|
{
|
||||||
|
dateTime.minute ++;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.minute --;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 5)
|
||||||
|
{
|
||||||
|
dateTime.second ++;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.second --;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pad.buttons == SCE_CTRL_DOWN)
|
||||||
|
{
|
||||||
|
if(selectedPartOfTime == 0)
|
||||||
|
{
|
||||||
|
dateTime.day --;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.day ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 1)
|
||||||
|
{
|
||||||
|
dateTime.month --;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.month ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 2)
|
||||||
|
{
|
||||||
|
dateTime.year --;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.year ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 3)
|
||||||
|
{
|
||||||
|
dateTime.hour --;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.hour ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 4)
|
||||||
|
{
|
||||||
|
dateTime.minute --;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.minute ++;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if(selectedPartOfTime == 5)
|
||||||
|
{
|
||||||
|
dateTime.second --;
|
||||||
|
|
||||||
|
ret = sceRtcGetTick(&dateTime, &fakeTime);
|
||||||
|
if(ret < 0)
|
||||||
|
{
|
||||||
|
dateTime.second ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(pad.buttons == SCE_CTRL_CROSS)
|
||||||
|
{
|
||||||
|
psvDebugScreenClear();
|
||||||
|
printf("Unlocking trophy %i\n",selection);
|
||||||
|
SceNpTrophyId id = selection;
|
||||||
|
SceNpTrophyId platid;
|
||||||
|
FakeTimes(1);
|
||||||
|
|
||||||
|
sceRtcConvertLocalTimeToUtc(&fakeTime, &fakeTime);
|
||||||
|
setSecureTick(fakeTime.tick);
|
||||||
|
|
||||||
|
ret = sceNpTrophyUnlockTrophy(trophyContext,handle,id,&platid);
|
||||||
|
if(ret < 0){
|
||||||
|
if(ret == 0x8055160f)
|
||||||
|
{
|
||||||
|
printf("Trophy %li is allready unlocked.\n",id);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("sceNpTrophyUnlockTrophy() failed. ret = 0x%x\n", ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Successfully unlocked trophy %li\n",id);
|
||||||
|
|
||||||
|
SceNpTrophyDetails trophyDetails = {0};
|
||||||
|
trophyDetails.size = sizeof(SceNpTrophyDetails);
|
||||||
|
sceNpTrophyGetTrophyInfo(trophyContext,handle,id,&trophyDetails,NULL);
|
||||||
|
memset(trophy_list[id].path,0x00,sizeof(trophy_list[id].path));
|
||||||
|
sprintf(trophy_list[id].path,"%.50s (%li)",trophyDetails.name,id);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
FakeTimes(0);
|
||||||
|
|
||||||
|
sceKernelDelayThread(500000);
|
||||||
|
goto selectTrophyMenu;
|
||||||
|
}
|
||||||
|
;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (pad.buttons == SCE_CTRL_CIRCLE)
|
||||||
|
{
|
||||||
|
sceKernelDelayThread(150000);
|
||||||
|
goto TrophyMenu;
|
||||||
|
}
|
||||||
|
if(window != oWindow)
|
||||||
|
{
|
||||||
|
psvDebugScreenClear();
|
||||||
|
oWindow = window;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
else if(selection == 1)
|
||||||
|
{
|
||||||
|
psvDebugScreenClear(); //clear screen
|
||||||
|
SceNpTrophyId id = 0;
|
||||||
|
SceNpTrophyId platid;
|
||||||
|
|
||||||
|
while (1)
|
||||||
|
{
|
||||||
|
ret = sceNpTrophyUnlockTrophy(trophyContext,handle,id,&platid);
|
||||||
|
if(ret < 0){
|
||||||
|
if(ret == 0x8055160f)
|
||||||
|
{
|
||||||
|
printf("Trophy %li is allready unlocked.\n",id);
|
||||||
|
}
|
||||||
|
else if(ret == 0x8055160e)
|
||||||
|
{
|
||||||
|
printf("All trophys unlocked!\n");
|
||||||
|
sceKernelDelayThread(500000);
|
||||||
|
goto TrophyMenu;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("sceNpTrophyUnlockTrophy() failed. ret = 0x%x\n", ret);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
printf("Successfully unlocked trophy %li\n",id);
|
||||||
|
}
|
||||||
|
id ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if(selection == 2)
|
||||||
{
|
{
|
||||||
psvDebugScreenClear();
|
psvDebugScreenClear();
|
||||||
ret = sceNpTrophyDestroyContext(trophyContext);
|
ret = sceNpTrophyDestroyContext(trophyContext);
|
||||||
|
@ -754,208 +1289,21 @@ TrophyMenu:
|
||||||
sceKernelDelayThread(150000);
|
sceKernelDelayThread(150000);
|
||||||
goto start;
|
goto start;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pad.buttons == SCE_CTRL_CROSS)
|
|
||||||
{
|
|
||||||
|
|
||||||
if(selection == 0)
|
|
||||||
{
|
|
||||||
//Show trophy selection menu
|
|
||||||
x = 1, y = 1, selection = 0, window = 0;
|
|
||||||
psvDebugScreenClear();
|
|
||||||
printf("Obtaining trophy count..");
|
|
||||||
SceNpTrophyGameDetails gameDetails = {0};
|
|
||||||
gameDetails.size = sizeof(SceNpTrophyGameDetails);
|
|
||||||
sceNpTrophyGetGameInfo(trophyContext,handle,&gameDetails,NULL);
|
|
||||||
size = gameDetails.numTrophies;
|
|
||||||
printf(" %i\n",size);
|
|
||||||
|
|
||||||
paths *trophy_list = malloc(sizeof(paths)*size);
|
|
||||||
SceNpTrophyDetails trophyDetails = {0};
|
|
||||||
trophyDetails.size = sizeof(SceNpTrophyDetails);
|
|
||||||
printf("Obtaining trophy names...");
|
|
||||||
for (int i=0; i < size; i++)
|
|
||||||
{
|
|
||||||
sceNpTrophyGetTrophyInfo(trophyContext,handle,i,&trophyDetails,NULL);
|
|
||||||
if(strcmp((char *)trophyDetails.name,"") !=0)
|
|
||||||
{
|
|
||||||
sprintf(trophy_list[i].path,"%.50s (%i)",trophyDetails.name,i);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sprintf(trophy_list[i].path,"Hidden Trophy (%i)",i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
printf("OK!\n");
|
|
||||||
sceKernelDelayThread(500000);
|
|
||||||
selectTrophyMenu:
|
|
||||||
psvDebugScreenClear();
|
|
||||||
while(1)
|
|
||||||
{
|
|
||||||
char buf[256];
|
|
||||||
strncpy(buf, "**** TropHax StandAlone Edition ****", sizeof(buf));
|
|
||||||
printf("\e[%i;%iH%s", 1, CENTERX(buf), buf);
|
|
||||||
strncpy(buf, "Choose a trophy:", sizeof(buf));
|
|
||||||
printf("\e[%i;%iH%s", 2, CENTERX(buf), buf);
|
|
||||||
y = 3;
|
|
||||||
int max = (size < WINDOW_HEIGHT) ? size : WINDOW_HEIGHT;
|
|
||||||
for (int i=0; i < max; i++) {
|
|
||||||
if (i+window == selection)
|
|
||||||
psvDebugScreenSetFgColor(0xFF0000);
|
|
||||||
printf("\e[%i;%iH%s", y, x, trophy_list[i+window].path);
|
|
||||||
y += 1;
|
|
||||||
psvDebugScreenSetFgColor(0xFFFFFF);
|
|
||||||
}
|
|
||||||
strncpy(buf, "U/D: Select Trophy X: Unlock O: Return", sizeof(buf));
|
|
||||||
printf("\e[%i;%iH%s", SCREEN_ROW, CENTERX(buf), buf);
|
|
||||||
memset(&pad, 0, sizeof(pad));
|
|
||||||
sceCtrlPeekBufferPositive(0, &pad, 1);
|
|
||||||
|
|
||||||
if (pad.buttons == SCE_CTRL_UP)
|
|
||||||
{
|
|
||||||
if (selection <= size - WINDOW_HEIGHT){
|
|
||||||
window -= 1;
|
|
||||||
}
|
|
||||||
if (window < 0){
|
|
||||||
window = 0;
|
|
||||||
}
|
|
||||||
selection -= 1;
|
|
||||||
if (selection < 0)
|
|
||||||
selection = 0;
|
|
||||||
sceKernelDelayThread(150000);
|
|
||||||
}
|
|
||||||
if (pad.buttons == SCE_CTRL_DOWN)
|
|
||||||
{
|
|
||||||
if (selection >= WINDOW_HEIGHT - 1){
|
|
||||||
window += 1;
|
|
||||||
}
|
|
||||||
if (window > size - WINDOW_HEIGHT){
|
|
||||||
window = (size - WINDOW_HEIGHT < 0) ? 0 : size - WINDOW_HEIGHT;
|
|
||||||
}
|
|
||||||
selection += 1;
|
|
||||||
if (selection + 1 > size - 1)
|
|
||||||
selection = size - 1;
|
|
||||||
sceKernelDelayThread(150000);
|
|
||||||
}
|
|
||||||
if (pad.buttons == SCE_CTRL_CROSS)
|
|
||||||
{
|
|
||||||
psvDebugScreenClear();
|
|
||||||
printf("Unlocking trophy %i\n",selection);
|
|
||||||
SceNpTrophyId id = selection;
|
|
||||||
SceNpTrophyId platid;
|
|
||||||
|
|
||||||
ret = sceNpTrophyUnlockTrophy(trophyContext,handle,id,&platid);
|
|
||||||
if(ret < 0){
|
|
||||||
if(ret == 0x8055160f)
|
|
||||||
{
|
|
||||||
printf("Trophy %li is allready unlocked.\n",id);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("sceNpTrophyUnlockTrophy() failed. ret = 0x%x\n", ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("Successfully unlocked trophy %li\n",id);
|
|
||||||
|
|
||||||
SceNpTrophyDetails trophyDetails = {0};
|
|
||||||
trophyDetails.size = sizeof(SceNpTrophyDetails);
|
|
||||||
sceNpTrophyGetTrophyInfo(trophyContext,handle,id,&trophyDetails,NULL);
|
|
||||||
memset(trophy_list[id].path,0x00,sizeof(trophy_list[id].path));
|
|
||||||
sprintf(trophy_list[id].path,"%.50s (%li)",trophyDetails.name,id);
|
|
||||||
|
|
||||||
}
|
|
||||||
sceKernelDelayThread(500000);
|
|
||||||
goto selectTrophyMenu;
|
|
||||||
}
|
|
||||||
if (pad.buttons == SCE_CTRL_CIRCLE)
|
|
||||||
{
|
|
||||||
sceKernelDelayThread(150000);
|
|
||||||
goto TrophyMenu;
|
|
||||||
}
|
|
||||||
if(window != oWindow)
|
|
||||||
{
|
|
||||||
psvDebugScreenClear();
|
|
||||||
oWindow = window;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(selection == 1)
|
|
||||||
{
|
|
||||||
psvDebugScreenClear(); //clear screen
|
|
||||||
SceNpTrophyId id = 0;
|
|
||||||
SceNpTrophyId platid;
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
ret = sceNpTrophyUnlockTrophy(trophyContext,handle,id,&platid);
|
|
||||||
if(ret < 0){
|
|
||||||
if(ret == 0x8055160f)
|
|
||||||
{
|
|
||||||
printf("Trophy %li is allready unlocked.\n",id);
|
|
||||||
}
|
|
||||||
else if(ret == 0x8055160e)
|
|
||||||
{
|
|
||||||
printf("All trophys unlocked!\n");
|
|
||||||
sceKernelDelayThread(500000);
|
|
||||||
goto TrophyMenu;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("sceNpTrophyUnlockTrophy() failed. ret = 0x%x\n", ret);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
printf("Successfully unlocked trophy %li\n",id);
|
|
||||||
}
|
|
||||||
id ++;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(selection == 2)
|
|
||||||
{
|
|
||||||
psvDebugScreenClear();
|
|
||||||
ret = sceNpTrophyDestroyContext(trophyContext);
|
|
||||||
if(ret < 0){
|
|
||||||
printf("sceNpTrophyDestroyContext() failed. ret = 0x%x\n", ret);
|
|
||||||
while(1){};
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = sceNpTrophyDestroyHandle(handle);
|
|
||||||
if(ret < 0){
|
|
||||||
printf("sceNpTrophyDestroyHandle() failed. ret = 0x%x\n", ret);
|
|
||||||
while(1){};
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = sceNpTrophyTerm();
|
|
||||||
if(ret < 0){
|
|
||||||
printf("sceNpTrophyTerm() failed. ret = 0x%x\n", ret);
|
|
||||||
while(1){};
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
sceKernelStopUnloadModule(user_modid, 0, NULL, 0, NULL, NULL);
|
|
||||||
taiStopUnloadKernelModule(kernel_modid, 0, NULL, 0, NULL, NULL);
|
|
||||||
sceKernelDelayThread(150000);
|
|
||||||
goto start;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(window != oWindow)
|
||||||
|
{
|
||||||
|
psvDebugScreenClear();
|
||||||
|
oWindow = window;
|
||||||
}
|
}
|
||||||
if(window != oWindow)
|
|
||||||
{
|
|
||||||
psvDebugScreenClear();
|
|
||||||
oWindow = window;
|
|
||||||
}
|
|
||||||
|
|
||||||
}while (pad.buttons != SCE_CTRL_CIRCLE);
|
}while (pad.buttons != SCE_CTRL_CIRCLE);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
//Defines functions relating to changing timestamps
|
||||||
|
|
||||||
|
int SetTrophyTimes(unsigned int timestamp1,unsigned int timestamp2);
|
||||||
|
int FakeTimes(int value);
|
|
@ -25,6 +25,8 @@ target_link_libraries(${PROJECT_NAME}
|
||||||
SceModulemgrForDriver_stub
|
SceModulemgrForDriver_stub
|
||||||
SceThreadmgrForDriver_stub
|
SceThreadmgrForDriver_stub
|
||||||
SceProcessmgrForDriver_stub
|
SceProcessmgrForDriver_stub
|
||||||
|
SceRtcForDriver_stub
|
||||||
|
SceDebugForDriver_stub
|
||||||
#SceNpDrmForDriver_stub
|
#SceNpDrmForDriver_stub
|
||||||
taihenForKernel_stub
|
taihenForKernel_stub
|
||||||
taihenModuleUtils_stub
|
taihenModuleUtils_stub
|
||||||
|
|
|
@ -10,4 +10,6 @@ SceAppMgrKernel2:
|
||||||
SceAppMgrKernel2Library:
|
SceAppMgrKernel2Library:
|
||||||
syscall: true
|
syscall: true
|
||||||
functions:
|
functions:
|
||||||
- sceAppMgrKernelMountById
|
- sceAppMgrKernelMountById
|
||||||
|
- kSetTrophyTimes
|
||||||
|
- kFakeTimes
|
|
@ -17,11 +17,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include <psp2kern/kernel/cpu.h>
|
#include <vitasdkkern.h>
|
||||||
#include <psp2kern/kernel/modulemgr.h>
|
|
||||||
#include <psp2kern/kernel/sysmem.h>
|
|
||||||
#include <psp2kern/kernel/threadmgr.h>
|
|
||||||
#include <psp2kern/io/fcntl.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
@ -30,6 +26,8 @@
|
||||||
|
|
||||||
#include "appmgr_kernel.h"
|
#include "appmgr_kernel.h"
|
||||||
|
|
||||||
|
#define printf ksceDebugPrintf
|
||||||
|
|
||||||
int module_get_export_func(SceUID pid, const char *modname, uint32_t libnid, uint32_t funcnid, uintptr_t *func);
|
int module_get_export_func(SceUID pid, const char *modname, uint32_t libnid, uint32_t funcnid, uintptr_t *func);
|
||||||
int module_get_offset(SceUID pid, SceUID modid, int segidx, size_t offset, uintptr_t *addr);
|
int module_get_offset(SceUID pid, SceUID modid, int segidx, size_t offset, uintptr_t *addr);
|
||||||
|
|
||||||
|
@ -37,8 +35,50 @@ void *(* sceAppMgrFindProcessInfoByPid)(void *data, SceUID pid);
|
||||||
int (* sceAppMgrMountById)(SceUID pid, void *info, int id, const char *titleid, const char *path, const char *desired_mount_point, const void *klicensee, char *mount_point);
|
int (* sceAppMgrMountById)(SceUID pid, void *info, int id, const char *titleid, const char *path, const char *desired_mount_point, const void *klicensee, char *mount_point);
|
||||||
int (* _ksceKernelGetModuleInfo)(SceUID pid, SceUID modid, SceKernelModuleInfo *info);
|
int (* _ksceKernelGetModuleInfo)(SceUID pid, SceUID modid, SceKernelModuleInfo *info);
|
||||||
|
|
||||||
|
int ksceRtcSetCurrentSecureTick(unsigned int* timestamp);
|
||||||
|
int ksceRtcGetCurrentSecureTick(unsigned int* timestamp);
|
||||||
|
|
||||||
|
static int hook = -1;
|
||||||
|
static tai_hook_ref_t ref_hook;
|
||||||
|
|
||||||
tai_module_info_t tai_info;
|
tai_module_info_t tai_info;
|
||||||
|
|
||||||
|
int fakeTime[2];
|
||||||
|
int spoofTime = 0;
|
||||||
|
|
||||||
|
int getTimePatched(unsigned int* timestamp)
|
||||||
|
{
|
||||||
|
|
||||||
|
int ret;
|
||||||
|
ret = TAI_CONTINUE(int, ref_hook,timestamp);
|
||||||
|
if(spoofTime)
|
||||||
|
{
|
||||||
|
printf("[TROPHAXSE] Faking timestamp to %x%x and Return 0",fakeTime[1],fakeTime[0]);
|
||||||
|
timestamp[0] = fakeTime[0];
|
||||||
|
timestamp[1] = fakeTime[1];
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int kFakeTimes(int value)
|
||||||
|
{
|
||||||
|
spoofTime = value;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int kSetTrophyTimes(unsigned int timestamp1, unsigned int timestamp2)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
fakeTime[0] = timestamp1;
|
||||||
|
fakeTime[1] = timestamp2;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
int _sceAppMgrKernelMountById(SceAppMgrMountIdArgs *args) {
|
int _sceAppMgrKernelMountById(SceAppMgrMountIdArgs *args) {
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
@ -105,8 +145,14 @@ int sceAppMgrKernelMountById(SceAppMgrMountIdArgs *args) {
|
||||||
|
|
||||||
void _start() __attribute__ ((weak, alias("module_start")));
|
void _start() __attribute__ ((weak, alias("module_start")));
|
||||||
int module_start(SceSize args, void *argp) {
|
int module_start(SceSize args, void *argp) {
|
||||||
|
printf("TrophaxSE Kernel Module loaded!\n");
|
||||||
|
hook = taiHookFunctionExportForKernel(KERNEL_PID,
|
||||||
|
&ref_hook,
|
||||||
|
"SceRtc",
|
||||||
|
0x0351D827, // SceRtcForDriver
|
||||||
|
0x401C0954, // ksceRtcGetCurrentSecureTick
|
||||||
|
getTimePatched);
|
||||||
|
printf("[TROPHAXSE] hook: %x\n",hook);
|
||||||
|
|
||||||
// Get tai module info
|
// Get tai module info
|
||||||
|
|
||||||
|
@ -132,16 +178,24 @@ int module_start(SceSize args, void *argp) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 0x321E4852: // 3.69 retail
|
case 0x321E4852: // 3.69 retail
|
||||||
|
case 0x700DA0CD: // 3.70 retail
|
||||||
|
case 0xF7846B4E: // 3.71 retail
|
||||||
|
case 0xA8E80BA8: // 3.72 retail
|
||||||
|
case 0xB299D195: // 3.73 retail
|
||||||
|
default:
|
||||||
module_get_offset(KERNEL_PID, tai_info.modid, 0, 0x2DE9, (uintptr_t *)&sceAppMgrFindProcessInfoByPid);
|
module_get_offset(KERNEL_PID, tai_info.modid, 0, 0x2DE9, (uintptr_t *)&sceAppMgrFindProcessInfoByPid);
|
||||||
module_get_offset(KERNEL_PID, tai_info.modid, 0, 0x19E95, (uintptr_t *)&sceAppMgrMountById);
|
module_get_offset(KERNEL_PID, tai_info.modid, 0, 0x19E95, (uintptr_t *)&sceAppMgrMountById);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return SCE_KERNEL_START_SUCCESS;
|
return SCE_KERNEL_START_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
int module_stop(SceSize args, void *argp) {
|
int module_stop(SceSize args, void *argp) {
|
||||||
|
if (hook >= 0) taiHookReleaseForKernel(hook, ref_hook);
|
||||||
return SCE_KERNEL_STOP_SUCCESS;
|
return SCE_KERNEL_STOP_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ target_link_libraries(${PROJECT_NAME}
|
||||||
SceLibKernel_stub
|
SceLibKernel_stub
|
||||||
SceIofilemgr_stub
|
SceIofilemgr_stub
|
||||||
SceAppMgrKernel2_stub
|
SceAppMgrKernel2_stub
|
||||||
|
SceLibc_stub
|
||||||
)
|
)
|
||||||
|
|
||||||
vita_create_self(user.suprx ${PROJECT_NAME} CONFIG exports.yml UNSAFE)
|
vita_create_self(user.suprx ${PROJECT_NAME} CONFIG exports.yml UNSAFE)
|
||||||
|
|
|
@ -10,4 +10,6 @@ SceAppMgrUser:
|
||||||
SceAppMgrUserLibrary:
|
SceAppMgrUserLibrary:
|
||||||
syscall: false
|
syscall: false
|
||||||
functions:
|
functions:
|
||||||
- sceAppMgrUserMountById
|
- sceAppMgrUserMountById
|
||||||
|
- SetTrophyTimes
|
||||||
|
- FakeTimes
|
|
@ -1,3 +1,5 @@
|
||||||
#include <appmgr_kernel.h>
|
#include <appmgr_kernel.h>
|
||||||
|
|
||||||
int sceAppMgrUserMountById(SceAppMgrMountIdArgs *args);
|
int sceAppMgrUserMountById(SceAppMgrMountIdArgs *args);
|
||||||
|
int kSetTrophyTimes(unsigned int timestamp1, unsigned int timestamp2);
|
||||||
|
int kFakeTimes(int value);
|
|
@ -18,9 +18,20 @@
|
||||||
|
|
||||||
|
|
||||||
#include <psp2/kernel/modulemgr.h>
|
#include <psp2/kernel/modulemgr.h>
|
||||||
|
#include <vitasdk.h>
|
||||||
#include "appmgr_user.h"
|
#include "appmgr_user.h"
|
||||||
|
|
||||||
|
|
||||||
|
int SetTrophyTimes(unsigned int timestamp1,unsigned int timestamp2)
|
||||||
|
{
|
||||||
|
return kSetTrophyTimes(timestamp1,timestamp2);
|
||||||
|
}
|
||||||
|
|
||||||
|
int FakeTimes(int value)
|
||||||
|
{
|
||||||
|
return kFakeTimes(value);
|
||||||
|
}
|
||||||
|
|
||||||
int sceAppMgrUserMountById(SceAppMgrMountIdArgs *args) {
|
int sceAppMgrUserMountById(SceAppMgrMountIdArgs *args) {
|
||||||
return sceAppMgrKernelMountById(args);
|
return sceAppMgrKernelMountById(args);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue