Load ELF files with sceKernelLoadExec

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

Moderators: cheriff, TyRaNiD

Vampire
Posts: 138
Joined: Tue Apr 12, 2005 8:16 am

Load ELF files with sceKernelLoadExec

Post by Vampire »

Code: Select all

STUB_FUNC 0xBD2F1094 sceKernelLoadExec

Code: Select all

void sceKernelLoadExec(const char *file, int zero);

Code: Select all

sceKernelLoadExec("disc0:/PSP_GAME/SYSDIR/BOOT.BIN", 0);
Lex
Posts: 27
Joined: Wed May 11, 2005 8:25 pm
Location: Germany

Post by Lex »

Hi Vampire,

what do you think about booting from MS :-; with this:

0x27932388 sceKernelBootFrom
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

so i remember reading someone was able to call the thread sleep fucntion using an overflow in the browser.. what about calling this function instead? you'd have to get the variables on the stack first, i guess?
Chaosmachine Studios: High Quality Homebrew.
laichung
Posts: 123
Joined: Fri May 06, 2005 2:02 pm

Re: Load ELF files with sceKernelLoadExec

Post by laichung »

I think these functions have same features with secKernelLoadExec

Code: Select all


sceKernelLoadModule(name, 0, NULL)

sceKernelStartModule(uid, 0, NULL, &res, NULL)

sceKernelQueryModuleInfo(uid, &info)

Load Module can load PRX and ELF. This may be useful for making a REAL Loader for 1.x firmware. But still have a long way to go ~

Thx
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Vampire did u try to load ms0:/PSP_GAME/SYSDIR/BOOT.BIN
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Cpasjuste:

Let's stop trying to load games from the memorycard, shall we?

You know, before the rules state I kick some arses.
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

why not just delete the post if you're going to get rid of the example code?
Chaosmachine Studios: High Quality Homebrew.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Nothing was edited out. The post remains a virgin.
chaos
Posts: 135
Joined: Sun Apr 10, 2005 5:05 pm

Post by chaos »

odd. i know there was more text when i read it this morning.
Chaosmachine Studios: High Quality Homebrew.
ooPo
Site Admin
Posts: 2023
Joined: Sat Jan 17, 2004 9:56 am
Location: Canada
Contact:

Post by ooPo »

Well, if there was... it wasn't me who removed it.

I can't say I notice anything missing, though.
Cpasjuste
Posts: 214
Joined: Sun May 29, 2005 8:28 am

Post by Cpasjuste »

Yes sorry my mistake ... will not happen again.

I dont know where i could ask this questions so i put them here .. i would like to ask if we already know the function to load and play a mp4 file from ms0 so i could call it in my little prog. If yes a sample code would be very apreciate, if no i would like to know why it cant be done actually.
Last edited by Cpasjuste on Fri Jun 17, 2005 12:26 am, edited 1 time in total.
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

I'm Currious. What do you think are the posibilitys of in an external program changing the clock speed to 333 then using this function to execute a game or a demo? Think it would stick or be reseted back to 222?
santosdominic
Posts: 3
Joined: Tue Jun 07, 2005 3:41 am

Post by santosdominic »

Reset I would say. Since the games are made with a function in them that automatically sets it at 222MHz instead of 333MHz. It's how sony capped the processor speed, by building into the dev-kit thingy.
subbie
Posts: 122
Joined: Thu May 05, 2005 4:14 am

Post by subbie »

sorry if this sounds piracy wise but its in good meaning.

Does it fully work with letting you execute the boot bin on the umd? Like have you tested it and it work? I am currious if this could be used as a method to make a 1.51 game boot around. So people with a 1.0 can still play UMD games that require the 1.51 or 1.52 firmware (unless there ends up being too much modified via firmware for the 1.0 firmware to be able to handle it, as well if it really will alow it to bypass the 1.51 check the bios does when the game is inserted).
User avatar
Yoshihiro
Posts: 12
Joined: Sat May 14, 2005 12:17 am

Post by Yoshihiro »

hi that work just your call with the void* it's wrong you cant run nothing with .

Code: Select all

typedef struct LoadELF{
unsigned int size;
void *unknow;
}LoadELF;

int sceKernelLoadExec(const char *appzpath, LoadELF *unknow);

//you can use it like that 

sceKernelLoadExec("ms0:/psp/game/test/my_exec.elf",0);

now you can add in your main :=)

Code: Select all


ctrl_data_t mypad;

void ReturnToLauncher()
{
if((mypad.buttons & CTRL_LTRIGGER&&mypad.buttons & CTRL_RTRIGGER&&mypad.buttons & CTRL_START))
{
sceKernelLoadExec("ms0:/psp/game/test/my_exec.elf",0);
}
// for return under your launcher  for load another ELF without reboot

}


..::Yoshihiro::..
Image
MrSiir[S]
Posts: 32
Joined: Tue Sep 14, 2004 11:08 am

Post by MrSiir[S] »

Yoshihiro wrote:

Code: Select all

//you can use it like that 
sceKernelLoadExec("ms0:/psp/game/test/my_exec.elf",0);

This don't work in 1.5 PSP, i get 80020146 error.
Vampire
Posts: 138
Joined: Tue Apr 12, 2005 8:16 am

Post by Vampire »

Yoshihiro wrote:hi that work just your call with the void* it's wrong you cant run nothing with .
sorry, but there is no difference...
0xdeadface
Posts: 62
Joined: Tue May 31, 2005 5:11 am

Post by 0xdeadface »

Yoshihiro, did you actually test this from MS?

I've had more luck loading executable code from UMD (that's to say, without it returning an error code) than from MS.

0xdf
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

It won't work from the memory stick, that error code means "invalid device".

We had a similiar call on the PS2, that wouldn't work from memory cards, and we had to patch it to get it working for memory cards.
steddy
Posts: 139
Joined: Mon Apr 04, 2005 3:53 am

Post by steddy »

Have you tried this from a thread running in kernel mode? It may behave diffrently then. After all, the VSH has to be able to load it this way from an EBOOT.PBP.

Steddy
Warren
Posts: 175
Joined: Sat Jan 24, 2004 8:26 am
Location: San Diego, CA

Post by Warren »

So uhh where are you guys getting these error codes from?
If I missed a post about this can someone link me?
gotxp
Posts: 11
Joined: Sun Jun 19, 2005 12:38 am

Post by gotxp »

these error codes are listed in the kerror.h... (this is a header from the leaked SDK lib)... however, dont ask for the file b/c it is illegal
See The Future... Feel The Future...
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Then don't post them here as it could be construed as just as illegal.
gotxp
Posts: 11
Joined: Sun Jun 19, 2005 12:38 am

Post by gotxp »

the error codes wouldnt be considered illegal because they are more reference knowledge... It would be the same way as if you tested different things to learn how the errors work...
See The Future... Feel The Future...
0xdeadface
Posts: 62
Joined: Tue May 31, 2005 5:11 am

Post by 0xdeadface »

"the error codes wouldnt be considered illegal because they are more reference knowledge... It would be the same way as if you tested different things to learn how the errors work..."

They were obtained illegally, and reverse engineering the meaning of some error codes is nearly impossible (because they could be mapped to custom processor responses...say encryption modules).

Reconstructing the meaning of error messages by testing, given the quite impressive amount of error messages there is would be near insane, you'd be better off dumping and examining the code returning those error codes.

But don't say they're not illegal, they are, and if they indeed can be reconstructed as easy as you say then they don't need to be posted from leaked source.

Of course, the cat's out of the bag regardless so the pondering is pointless, but don't use flawed logic to justify something illegal.

Just my 2 cents.

0xdf
TyRaNiD
Posts: 907
Joined: Sun Jan 18, 2004 12:23 am

Post by TyRaNiD »

Knowing the error code values is one thing, knowing their real names is another. Now sometimes people embed them in executables such as in print statements so we can tell from that, however if they are just copy and pasted from the SDK docs then they are likely illegal. But then I am not a lawyer.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

Error code posts taken from official SDK removed.

steddy, brad_irc, you two are on my watch list. If you give me ANY further reason I will not hesitate to ban either/both of you.
Shoot Pixels Not People!
Makeshift Development
gotxp
Posts: 11
Joined: Sun Jun 19, 2005 12:38 am

Post by gotxp »

TyRaNiD wrote:Knowing the error code values is one thing, knowing their real names is another. Now sometimes people embed them in executables such as in print statements so we can tell from that, however if they are just copy and pasted from the SDK docs then they are likely illegal. But then I am not a lawyer.
yea, I agree. If they are just copy and pasted it would be illegal. However, saying: 'oh, that error code means invalid prx'. that would be different...
See The Future... Feel The Future...
mrbrown
Site Admin
Posts: 1537
Joined: Sat Jan 17, 2004 11:24 am

Post by mrbrown »

gotxp wrote:yea, I agree. If they are just copy and pasted it would be illegal. However, saying: 'oh, that error code means invalid prx'. that would be different...
Whatever - it's against the rules to provide any information you obtained from the SDK. We clearly state that, so we avoid any grey-area legal entanglements. We don't need to get into a whole legal thing, since this is part of the site rules. gotxp you haven't really contributed anything since you've been here. I think you would probably do better somewhere else.

I banned one person yesterday for blantantly disregarding the rules w.r.t the official SDK. Looks like I need to make more examples out of more folks. gotxp has been banned.

If anyone else wants to try posting information obtained from the official SDK, I will ban you outright.
"He was warned..."
djhuevo
Posts: 47
Joined: Thu Mar 10, 2005 3:50 pm

Post by djhuevo »

MrSiir[S] wrote:
Yoshihiro wrote://you can use it like that
sceKernelLoadExec("ms0:/psp/game/test/my_exec.elf",0);

This don't work in 1.5 PSP, i get 80020146 error.
to load executables from ms in 1.5 PSP you need to set the kernel mode flag in module info and run sceKernelLoadExec from a thread with flags 0x0000 (0x8000 don't work).

dunno if is the same in 1.0 PSP
sobreviviendo en la tierra de los trolldev
Post Reply