Install a bootstrap and return to application... how?
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
Excuse me,
I've builted a prx for load all the executables, but when I try to load another module from the loaded prx I have error 0x80020143 ( MODULE_MRG_BUSY)!
I think is because I'm load a module from a loaded prx, so I've to unload it for load another module or I can load it with another function from main program?
( I've to pass arguments to the module );
Thanks in advance!
EDIT:
Can I use a simple sceKernelLoadExec?
I can use all the user mode funct for load the prx because there's not patch loaded!
Ok, I'm working on pspSdkLoadStartModule ( maybe resolved )! :D
I've builted a prx for load all the executables, but when I try to load another module from the loaded prx I have error 0x80020143 ( MODULE_MRG_BUSY)!
I think is because I'm load a module from a loaded prx, so I've to unload it for load another module or I can load it with another function from main program?
( I've to pass arguments to the module );
Thanks in advance!
EDIT:
Can I use a simple sceKernelLoadExec?
I can use all the user mode funct for load the prx because there's not patch loaded!
Ok, I'm working on pspSdkLoadStartModule ( maybe resolved )! :D
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
Code: Select all
SceUID mod = sceKernelLoadModuleMs2(arguments[2], 0, data);
if (mod >= 0)
{
mod = sceKernelStartModule(mod, 0, NULL, NULL, NULL);
if (mod < 0)
printf("\nError 0x%08X starting module.\n", mod);
sleep(3000000);
}
else
{
if (mod == SCE_KERNEL_ERROR_EXCLUSIVE_LOAD)
{
// Ignore this error, it means the module loaded on reboot
}
else
{
printf("\nError 0x%08X loading module.\n", mod); <---- Here I get the error
sleep(3000000);
}
}
Last edited by darkness on Thu Jul 03, 2008 4:55 am, edited 1 time in total.
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 10
- Joined: Mon Nov 12, 2007 7:48 pm
Pirata Nervo, I have not deleted any of my posts. The last one I had was the one with the sample. Yeah, Ive seen the 4.01 sdk sample. It works pretty good :)Pirata Nervo wrote:you deleted your other post and you made me look dumb.
don't it again with me please or I won't help you anymore.
but psp.padawan also deleted his post
yeh set the heap and try again
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
@psp.padawan I am sure there was post by you above the one (mine) which says:
No it's not true because he is using the load module * functions and not load exec* functions
@psp.padawan, 4.0 sdk comes with a better sample :) and even with loadexec (the patch is not lost on 4.0 or higher), I needed to create a 3xxkernel.prx to use the load module functions
And there was a post by by darkness too but he deleted it.
O.o
@darkness, if you dont post your code I cant help you :/
No it's not true because he is using the load module * functions and not load exec* functions
@psp.padawan, 4.0 sdk comes with a better sample :) and even with loadexec (the patch is not lost on 4.0 or higher), I needed to create a 3xxkernel.prx to use the load module functions
And there was a post by by darkness too but he deleted it.
O.o
@darkness, if you dont post your code I cant help you :/
-
- Posts: 10
- Joined: Mon Nov 12, 2007 7:48 pm
Nope I have not responded in this thread until today where I said I did not delete any of my posts. I might be wrong, but I dont think posts can be deleted. The text can be edited but I have not seen a delete option. Anyway, the name of the person should still be there even if the post has been edited.Pirata Nervo wrote:@psp.padawan I am sure there was post by you above the one (mine) which says:
No it's not true because he is using the load module * functions and not load exec* functions
@psp.padawan, 4.0 sdk comes with a better sample :) and even with loadexec (the patch is not lost on 4.0 or higher), I needed to create a 3xxkernel.prx to use the load module functions
??? I've already posted the code!!
Maybe you want a complete src!
(I've never delete a post, maybe I've edit it for add info or else...)
However thanks!
Maybe you want a complete src!
Code: Select all
PSP_MODULE_INFO("Xp", 0x1000, 1, 0);
PSP_HEAP_SIZE_KB(1024);
#define printf pspDebugScreenPrintf
#define sleep(n) sceKernelDelayThread(n)
u32 orig_funcs[2];
int ExitPatched()
{
int k1 = pspSdkSetK1(0);
char *program = "ms0:/PSP/GAME/Xplora_v1.0/EBOOT.PBP";
struct SceKernelLoadExecVSHParam param;
memset(¶m, 0, sizeof(param));
param.size = sizeof(param);
param.args = strlen(program)+1;
param.argp = program;
param.key = "game";
int res = sctrlKernelLoadExecVSHMs2(program, ¶m);
pspSdkSetK1(k1);
return res;
}
int ExitPatched2()
{
return ExitPatched();
}
int RestoreExitGame()
{
int k1 = pspSdkSetK1(0);
sctrlHENPatchSyscall((u32)ExitPatched, (void *)orig_funcs[0]);
sctrlHENPatchSyscall((u32)ExitPatched2, (void *)orig_funcs[1]);
pspSdkSetK1(k1);
return 0;
}
void SetConfFile(int n)
{
int k1 = pspSdkSetK1(0);
sctrlSESetBootConfFileIndex(n);
pspSdkSetK1(k1);
}
void SetUmdFile(char *umdfile)
{
int k1 = pspSdkSetK1(0);
sctrlSESetUmdFile(umdfile);
pspSdkSetK1(k1);
}
int main_thread(SceSize args, void *argp)
{
pspDebugScreenInit();
// Patcher function
orig_funcs[0] = sctrlHENFindFunction("sceLoadExec", "LoadExecForUser", 0x05572A5F);
orig_funcs[1] = sctrlHENFindFunction("sceLoadExec", "LoadExecForUser", 0x2AC9954B);
sctrlHENPatchSyscall(orig_funcs[0], ExitPatched);
sctrlHENPatchSyscall(orig_funcs[1], ExitPatched2);
// Loader funcions
SceUID mod = sceKernelLoadModuleMs2("ms0:/PSP/GAME/Filer_5.0/EBOOT.PBP", 0, NULL);
// Starter function
if (mod >= 0)
{
mod = sceKernelStartModule(mod, 0, NULL, NULL, NULL);
if (mod < 0)
printf("\nError 0x%08X starting module.\n", mod);
sleep(3000000);
}
else
{
if (mod == SCE_KERNEL_ERROR_EXCLUSIVE_LOAD)
{
// Ignore this error, it means the module loaded on reboot
}
else
{
printf("\nError 0x%08X loading module.\n", mod);
sleep(3000000);
}
}
return 0;
}
int module_start(SceSize args, void *argp)
{
SceUID th = sceKernelCreateThread("main_thread", main_thread, 8, 4*1024, 0, NULL);
if (th >= 0)
{
sceKernelStartThread(th, args, argp);
}
return 0;
}
int module_stop(SceSize args, void *argp)
{
return 0;
}
However thanks!
-
- Posts: 10
- Joined: Mon Nov 12, 2007 7:48 pm
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am
-
- Posts: 409
- Joined: Tue Oct 09, 2007 4:22 am