forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Load ELF files with sceKernelLoadExec
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Wed Jun 15, 2005 8:34 am    Post subject: Load ELF files with sceKernelLoadExec Reply with quote

Code:
STUB_FUNC 0xBD2F1094 sceKernelLoadExec

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

Code:
sceKernelLoadExec("disc0:/PSP_GAME/SYSDIR/BOOT.BIN", 0);
Back to top
View user's profile Send private message
Lex



Joined: 11 May 2005
Posts: 27
Location: Germany

PostPosted: Wed Jun 15, 2005 8:47 am    Post subject: Reply with quote

Hi Vampire,

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

0x27932388 sceKernelBootFrom
Back to top
View user's profile Send private message
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Wed Jun 15, 2005 4:37 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
laichung



Joined: 06 May 2005
Posts: 123

PostPosted: Thu Jun 16, 2005 11:29 am    Post subject: Re: Load ELF files with sceKernelLoadExec Reply with quote

I think these functions have same features with secKernelLoadExec

Code:


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
Back to top
View user's profile Send private message
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Thu Jun 16, 2005 12:50 pm    Post subject: Reply with quote

Vampire did u try to load ms0:/PSP_GAME/SYSDIR/BOOT.BIN
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Jun 16, 2005 2:27 pm    Post subject: Reply with quote

Cpasjuste:

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

You know, before the rules state I kick some arses.
Back to top
View user's profile Send private message Visit poster's website
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Thu Jun 16, 2005 3:05 pm    Post subject: Reply with quote

why not just delete the post if you're going to get rid of the example code?
_________________
Chaosmachine Studios: High Quality Homebrew.
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Jun 16, 2005 3:17 pm    Post subject: Reply with quote

Nothing was edited out. The post remains a virgin.
Back to top
View user's profile Send private message Visit poster's website
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Thu Jun 16, 2005 3:25 pm    Post subject: Reply with quote

odd. i know there was more text when i read it this morning.
_________________
Chaosmachine Studios: High Quality Homebrew.
Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Thu Jun 16, 2005 3:38 pm    Post subject: Reply with quote

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

I can't say I notice anything missing, though.
Back to top
View user's profile Send private message Visit poster's website
Cpasjuste



Joined: 29 May 2005
Posts: 214

PostPosted: Thu Jun 16, 2005 10:51 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Thu Jun 16, 2005 11:37 pm    Post subject: Reply with quote

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?
Back to top
View user's profile Send private message
santosdominic



Joined: 07 Jun 2005
Posts: 3

PostPosted: Fri Jun 17, 2005 1:44 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
subbie



Joined: 05 May 2005
Posts: 122

PostPosted: Fri Jun 17, 2005 4:57 am    Post subject: Reply with quote

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).
Back to top
View user's profile Send private message
Yoshihiro



Joined: 14 May 2005
Posts: 12

PostPosted: Fri Jun 17, 2005 10:54 pm    Post subject: Reply with quote

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

Code:

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:


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::..
_________________
Back to top
View user's profile Send private message
MrSiir[S]



Joined: 14 Sep 2004
Posts: 32

PostPosted: Sat Jun 18, 2005 12:38 am    Post subject: Reply with quote

Yoshihiro wrote:
Code:
//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.
Back to top
View user's profile Send private message Send e-mail
Vampire



Joined: 12 Apr 2005
Posts: 138

PostPosted: Sat Jun 18, 2005 2:13 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Sat Jun 18, 2005 2:31 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sat Jun 18, 2005 3:11 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
steddy



Joined: 04 Apr 2005
Posts: 139

PostPosted: Sun Jun 19, 2005 4:01 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Warren



Joined: 24 Jan 2004
Posts: 173
Location: San Diego, CA

PostPosted: Sun Jun 19, 2005 7:27 am    Post subject: Reply with quote

So uhh where are you guys getting these error codes from?
If I missed a post about this can someone link me?
Back to top
View user's profile Send private message
gotxp



Joined: 19 Jun 2005
Posts: 11

PostPosted: Sun Jun 19, 2005 7:37 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sun Jun 19, 2005 7:45 am    Post subject: Reply with quote

Then don't post them here as it could be construed as just as illegal.
Back to top
View user's profile Send private message
gotxp



Joined: 19 Jun 2005
Posts: 11

PostPosted: Sun Jun 19, 2005 7:49 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
0xdeadface



Joined: 31 May 2005
Posts: 62

PostPosted: Sun Jun 19, 2005 8:01 am    Post subject: Reply with quote

"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
Back to top
View user's profile Send private message
TyRaNiD



Joined: 18 Jan 2004
Posts: 918

PostPosted: Sun Jun 19, 2005 8:04 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Sun Jun 19, 2005 8:05 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
gotxp



Joined: 19 Jun 2005
Posts: 11

PostPosted: Sun Jun 19, 2005 8:22 am    Post subject: Reply with quote

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...
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sun Jun 19, 2005 11:09 am    Post subject: Reply with quote

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..."
Back to top
View user's profile Send private message
djhuevo



Joined: 10 Mar 2005
Posts: 47

PostPosted: Tue Jun 21, 2005 4:39 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group