Running EBOOT.PBP from homebrew

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
gradew
Posts: 7
Joined: Thu May 04, 2006 7:13 pm

Running EBOOT.PBP from homebrew

Post by gradew »

Hey all,

sorry about this totally noob question, but is there a way I could launch a homebrew from another homebrew? I thought sceKernelLoadExec could do that, but I keep getting the 0x80020147 (prohibitLoadEx ecdevice) error.
Any thoughts?

(PS: I searched this forum for answers, but it seems people are trying to run ELFs...)
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

You need kernel mode to execute a file from the memory stick.
gradew
Posts: 7
Joined: Thu May 04, 2006 7:13 pm

Post by gradew »

hello moonlight,

thank you for your reply. Is

PSP_MODULE_INFO("blahblah",0x1000,1,1);
PSP_MAIN_THREAD_ATTR(0);

enough to run my app in kernel mode? because if it is, then I'm probably missing something else; it still doesn't work... :(
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

gradew wrote:hello moonlight,

thank you for your reply. Is

PSP_MODULE_INFO("blahblah",0x1000,1,1);
PSP_MAIN_THREAD_ATTR(0);

enough to run my app in kernel mode? because if it is, then I'm probably missing something else; it still doesn't work... :(
Yes, that's enough for kernel mode.
It's strange, at least in 1.50, with kernel mode and a line of code like this:

sceKernelLoadExec("my_app.elf", NULL);

it works for me.

Btw, you may use this another function: LoadExecForKernel_28D0D249
It's not defined in the headers of the pspsdk, so you have to add some lines of code like this:

Code: Select all

struct SceKernelLoadExecVSHParam 
{
/* Size of structure in bytes */
    SceSize     size; 
/* Size of the arguments string */
    SceSize     args;
/* Pointer to the arguments strings */
    void * argp;
/* "game", "updater" or "vsh" ("game" when loading homebrews) */
    const char * key;
/* unknown, it seems to be some kind of flag. the firmware set it to 
   0x00000400. it looks like is related with the next fields of the 
   structure, it's better to set it to 0 if we don't know how to use 
   those fields */
    u32 unk1;
/* unknown, the firmware always set it to 0x09CF344C, which seems to 
   be a pointer */
    void *unk2;
/* unknown. the firmware sets it to 0 */
    u32 unk3;
/* unknown. the firmware sets it to 0 */
    u32 unk4;
/* unknown. the firmware sets it to 0 */
    u32 unk5
};

int LoadExecForKernel_28D0D249(const char *file, struct SceKernelLoadExecVSHParam *param);
and then use it like you would do with loadexec.
gradew
Posts: 7
Joined: Thu May 04, 2006 7:13 pm

Post by gradew »

ok I think I've seen it somewhere in the forum. The reason I haven't tried it is because I'm not trying to run an ELF, but an EBOOT.PBP file. Does that make any difference?

In the meantime, I'll try out the declaration you've given me. Thanks for the help! :-)
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

gradew wrote:ok I think I've seen it somewhere in the forum. The reason I haven't tried it is because I'm not trying to run an ELF, but an EBOOT.PBP file. Does that make any difference?

In the meantime, I'll try out the declaration you've given me. Thanks for the help! :-)
The PBP in a kxploited application is an ELF.

A true PBP (usually called "1.00" PBP) won't work with loadexec in 1.50, if i don't remember bad.
gradew
Posts: 7
Joined: Thu May 04, 2006 7:13 pm

Post by gradew »

Tried out your "holy function of homebrew" (that's where I saw it! ;-)), didn't work out. Only this time, the return value was 0....

As I'm totally new to PSP programming, I'm not sure I understand what you mean by "kxploited"... My app is a simple C++ program I've built from a sample (compiled using the latest PSPSDK toolchain) from which I'm trying to launch another sample. I must be missing something here, but what?....
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

gradew wrote:Tried out your "holy function of homebrew" (that's where I saw it! ;-)), didn't work out. Only this time, the return value was 0....

As I'm totally new to PSP programming, I'm not sure I understand what you mean by "kxploited"... My app is a simple C++ program I've built from a sample (compiled using the latest PSPSDK toolchain) from which I'm trying to launch another sample. I must be missing something here, but what?....
A kxploited app is one that uses the kxploit, neccesary to run homebrew in 1.50 (you know, the ones with two folders, one of them with %)

Btw, what firmware do you have?
gradew
Posts: 7
Joined: Thu May 04, 2006 7:13 pm

Post by gradew »

moonlight wrote:
gradew wrote:Tried out your "holy function of homebrew" (that's where I saw it! ;-)), didn't work out. Only this time, the return value was 0....

As I'm totally new to PSP programming, I'm not sure I understand what you mean by "kxploited"... My app is a simple C++ program I've built from a sample (compiled using the latest PSPSDK toolchain) from which I'm trying to launch another sample. I must be missing something here, but what?....
A kxploited app is one that uses the kxploit, neccesary to run homebrew in 1.50 (you know, the ones with two folders, one of them with %)

Btw, what firmware do you have?
hee hee... this is where you'll probably start laughing ^^ I have the 2.60 fw, using Fanjita's EBOOT loader. I know it looks desperately useless to run a homebrew from another homebrew since Fanjita's loader does this already (and a WHOLE LOT BETTER ^^), but I'm just fiddling around with the API, trying to figure out how the whole thing works. :-)
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

2.60 has no kernel support yet :)
gradew
Posts: 7
Joined: Thu May 04, 2006 7:13 pm

Post by gradew »

ok! ^^ I'll have to wait for that, then.... Thanks a lot for your time, moonlight!! :-))
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

You might have a very long wait. Noone knows how to load kernel mode apps from user mode, if it's possible at all.

Jim
gradew
Posts: 7
Joined: Thu May 04, 2006 7:13 pm

Post by gradew »

Ok, now that I've managed to get my hands on a 1.5 PSP. I'm trying to run a kxploited homebrew from my homebrew and it still doesn't work. Only this time, the PSP crashes (black screen, then powers off after 10 seconds or so...).
Which EBOOT.PBP should I run? the one in the % directory? Does my homebrew have to be kxploited as well?

(btw, great work on NOKXPLOIT moonlight!! :-))
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

Posted: Thu May 04, 2006 ok! ^^ I'll have to wait for that, then....
Posted: Tue May 09, 2006 Ok, now that I've managed to get my hands on a 1.5 PSP.
You must be a pretty good fighter then :D
The % folder is the KXPLOIT folder, the other one contains the program.
Maybe it's confusing because the 1.50 PSP appears to run the KXPLOIT eboot.
Post Reply