Vous êtes sur la page 1sur 2

// umd4homebrew.prx // #include #include #include #include <pspkernel.h> <systemctrl.h> <pspinit.h> <string.

h>

// PSP_MODULE_INFO("umd4homebrew", 0x1000, 0, 1); // STMOD_HANDLER previous = NULL; // void ClearCaches(void) { sceKernelDcacheWritebackAll(); sceKernelIcacheClearAll(); } // int OnModuleStart(SceModule2 *mod) { if(strcmp(mod->modname, "sceUmdMan_driver") == 0) { _sw(0x24020020, mod->text_addr + 0x431C); ClearCaches(); } return previous ? previous(mod) ? 0; } // int module_start(SceSize args, void *argp) { if(args != 0) { previous = sctrlHENSetStartModuleHandler(OnModuleStart); } if(sceKernelInitKeyConfig() == PSP_INIT_KEYCONFIG_VSH) { SceUID fd = sceIoOpen((char *)argp, PSP_O_RDONLY, 0); if(fd < 0) return -1; int size = sceIoLseek(fd, 0, PSP_SEEK_END); sceIoLseek(fd, 0, PSP_SEEK_SET); int memid = sceKernelAllocPartitionMemory(1, "", 0, size, NULL); if(memid < 0) { sceIoClose(fd); return -1; } void *buff = sceKernelGetBlockHeadAddr(memid); sceIoRead(fd, buff, size);

// li, 32

sctrlHENLoadModuleOnReboot("/kd/umdman.prx", buff, size, 2); sceIoClose(fd); return 0; } return 0; }