Execute Eboot

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

Moderators: cheriff, TyRaNiD

Post Reply
Cheater
Posts: 2
Joined: Sun Jul 09, 2006 1:23 am

Execute Eboot

Post by Cheater »

I am trying to execute another eboot from within my eboot. I read about sceKernelLoadExec, but that didn't work. I read somewhere that the eboot needed to be kxploited. When I enter 'make', it gives me a single eboot.pbp. I assume this is not kxploited and is meant for 1.0 (which works fine with custom firmware). 'Make Kxploit' causes it not to show up in the list. If I execute it from irshell, it won't load.

Currently, here is my test source code:

Code: Select all

#include <pspkernel.h>
#include <pspdebug.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <pspdisplay.h>
#include <pspctrl.h>
#include <psploadexec.h>

//I know I have a lot of #include, but I'm leaving them for later

PSP_MODULE_INFO&#40;"Ebooy", 0x1000, 0, 1&#41;;
#define printf pspDebugScreenPrintf /* Exit callback */
int exit_callback&#40;int arg1, int arg2, void *common&#41; &#123;
          sceKernelExitGame&#40;&#41;;
          return 0;
&#125;

/* Callback thread */
int CallbackThread&#40;SceSize args, void *argp&#41; &#123;
          int cbid;

          cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
          sceKernelRegisterExitCallback&#40;cbid&#41;;

          sceKernelSleepThreadCB&#40;&#41;;

          return 0;
&#125;

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks&#40;void&#41; &#123;
          int thid = 0;

          thid = sceKernelCreateThread&#40;"update_thread", CallbackThread, 0x11, 0xFA0, 0, 0&#41;;
          if&#40;thid >= 0&#41; &#123;
                    sceKernelStartThread&#40;thid, 0, 0&#41;;
          &#125;

          return thid;
&#125;

int main &#40;void&#41; &#123;
	pspDebugScreenInit&#40;&#41;;
	SetupCallbacks&#40;&#41;;
	printf&#40;"Loading Eboot...\n"&#41;;
	sceKernelLoadExec&#40;"ms0&#58;/PSP/GAME/hello/EBOOT.PBP", NULL&#41;;
	printf&#40;"Eboot loaded\n"&#41;;
	return 0;
&#125;

It is meant to execute the hello world app in the hello folder. This app isn't kxploited. When I run it, it gets past the printf statement, and then crashse (sends me back to the xmb).

Please don't tell me to search. I've read every thread on PSPUpdates (as well as stuff found on google and this forum) that has anything to do with it. I think my problem has something to do with the hello world eboot (even though it runs fine by itself).

Thanks in advance.
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

You can't loadexec an eboot just like this. You first have to extract the ELF file inside it and then execute that one.
Cheater
Posts: 2
Joined: Sun Jul 09, 2006 1:23 am

Post by Cheater »

Is there any way to do that in c? Or do I need to do it manually?
adrahil
Posts: 274
Joined: Thu Mar 16, 2006 1:55 am

Post by adrahil »

I had seen some example of it in C, so just search around the older posts in this forum :)
Post Reply