Change by Graphene: Doesn't load in system/homebrew apps, only checks every 15 frames
This commit is contained in:
parent
5248d0315a
commit
36ed28af3f
@ -14,11 +14,13 @@
|
||||
|
||||
int sceShellUtilTextClipboardRead(void* data, SceSize size, SceSize *textlen);
|
||||
int sceShellUtilTextClipboardWrite(const void* data, SceSize size);
|
||||
int sceAppMgrIsGameProgram(int);
|
||||
|
||||
int hook[2];
|
||||
static tai_hook_ref_t screenshot_hook;
|
||||
static tai_hook_ref_t screen_disable_hook;
|
||||
const static int done_magic = DONE_MAGIC;
|
||||
static int frames = 0;
|
||||
|
||||
void sceScreenShotDisable_patched() {
|
||||
printf("INFO TrophyShot: Prevented disabling screenshot. \n");
|
||||
@ -26,7 +28,11 @@ void sceScreenShotDisable_patched() {
|
||||
|
||||
int sceDisplaySetFrameBuf_patched(const SceDisplayFrameBuf* pParam, SceDisplaySetBufSync sync) {
|
||||
|
||||
int read_data;
|
||||
int read_data, screenshot_ret;
|
||||
|
||||
if (frames == 15) {
|
||||
|
||||
frames = 0;
|
||||
sceShellUtilTextClipboardRead(&read_data, sizeof(int), NULL);
|
||||
|
||||
if (read_data == TROPHY_MAGIC) {
|
||||
@ -35,12 +41,15 @@ int sceDisplaySetFrameBuf_patched(const SceDisplayFrameBuf* pParam, SceDisplaySe
|
||||
|
||||
SceScreenShotCaptureFileInfo captureFileInfo;
|
||||
sceClibMemset(&captureFileInfo, 0, sizeof(captureFileInfo));
|
||||
int screenshot_ret = sceScreenShotCapture(1, &captureFileInfo, NULL, NULL);
|
||||
screenshot_ret = sceScreenShotCapture(1, &captureFileInfo, NULL, NULL);
|
||||
|
||||
printf("INFO TrophyShot: sceScreenShotCapture() : 0x%08x path='%s'\n", screenshot_ret, captureFileInfo.path);
|
||||
|
||||
sceShellUtilTextClipboardWrite(&done_magic, sizeof(int));
|
||||
}
|
||||
}
|
||||
|
||||
frames++;
|
||||
|
||||
return TAI_CONTINUE(int, screenshot_hook, pParam, sync);
|
||||
}
|
||||
@ -49,6 +58,10 @@ void _start() __attribute__((weak, alias("module_start")));
|
||||
int module_start(SceSize args, void *argp) {
|
||||
printf("TrophyShot APP PART 2.0 SALVO FIRE\n");
|
||||
|
||||
int ret = sceAppMgrIsGameProgram(-2);
|
||||
printf("APP TYPE: %d\n", ret);
|
||||
|
||||
if (ret == 1) {
|
||||
sceSysmoduleLoadModule(SCE_SYSMODULE_SCREEN_SHOT);
|
||||
hook[1] = taiHookFunctionExport(
|
||||
&screen_disable_hook,
|
||||
@ -65,6 +78,8 @@ int module_start(SceSize args, void *argp) {
|
||||
sceDisplaySetFrameBuf_patched);
|
||||
|
||||
printf("hooks: 0x%x 0x%x\n", hook[0], hook[1]);
|
||||
}
|
||||
|
||||
return SCE_KERNEL_START_SUCCESS;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user