cleanup, add umdiff magic

This commit is contained in:
TheSola10 2025-04-04 21:26:58 +02:00
parent 8c8b71293d
commit b058056f88
Signed by: thesola10
GPG Key ID: 89245619BEBB95BA
2 changed files with 12 additions and 1 deletions

7
main.c
View File

@ -70,6 +70,8 @@ int lp_catchUmdCallback(int cbid)
Kprintf("Caught request to register UMD callback 0x%08x\n", cbid);
vshCallbackId = cbid;
sceKernelNotifyCallback(cbid, PSP_UMD_NOT_PRESENT);
return 0;
}
/**
@ -120,8 +122,9 @@ int lp_discChangeWatcher(SceSize argc, void *argp)
REDIRECT_FUNCTION(fn_RegisterUmdCallback, lp_catchUmdCallback);
}
sceKernelSleepThreadCB();
return 1; // This should be unreachable
}
int module_start(SceSize argc, void *argp)
@ -164,6 +167,8 @@ int module_stop(void)
sceUmdUnRegisterUMDCallBack(umdCallbackId);
sceKernelDeleteCallback(umdCallbackId);
sceKernelDeleteThread(umdCallbackThread);
// put things back where we found them
_sw((u32) &reserveRegisterUmdCallback, fn_RegisterUmdCallback);
_sw((u32) &reserveRegisterUmdCallback + 4, fn_RegisterUmdCallback + 4);

6
umdiff/umdiff.magic Normal file
View File

@ -0,0 +1,6 @@
# umdiff: file(1) magic for UMDiff format
# URL: https://github.com/thesola10/umd-livepatch
0 string \x7fUMDiff UMDiff patch file
>0x07 byte 0 v0,
>>0x08 belong x %d commands,
>>0x0c belong x data starts at offset %d