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 

Need help loading an ELF from an ELF :)

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
PrimeTime



Joined: 19 Aug 2004
Posts: 25

PostPosted: Thu Aug 19, 2004 8:03 pm    Post subject: Need help loading an ELF from an ELF :) Reply with quote

hi, I'm pretty new to this, but for the past couple of days I've been trying
to load an ELF from a location on my memory card.

the location of the program is mc0:/BOOT/SHARED/JPG.ELF
I uploaded it there myself.

my problem is whenever I call SifLoadElf() it tell me it cannot open this elf file.

Code:

char *path = "mc0:/BOOT/SHARED/JPG.ELF";
ret = SifLoadElf(path, &elfdata);
if (elfdata.epc == 0) {
     scr_printf("EE: Could not load file\n");
     return -1;
    }



I've also tried loading the mcman and and sio2man modules before loading the elf, but that didn't help.

Thanks,
Ryan
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Thu Aug 19, 2004 8:26 pm    Post subject: Reply with quote

Can you try to only open the file ? Only to see if everything is okay with your module loadings...
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
Raizor



Joined: 18 Jan 2004
Posts: 60
Location: out there

PostPosted: Thu Aug 19, 2004 10:13 pm    Post subject: Reply with quote

I could be wrong, but I seem to recall loading elf files from memcard is not allowed. You need to use MrBrown's sbv patches to allow it...

Please correct me if I'm wrong ;)

raizor
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Fri Aug 20, 2004 3:05 am    Post subject: Reply with quote

You're right, you need to use sbv if you use SifLoadElf(), or one of the alternative loading methods (see altimit or Independence).
_________________
"He was warned..."
Back to top
View user's profile Send private message
pixel



Joined: 30 Jan 2004
Posts: 791

PostPosted: Fri Aug 20, 2004 5:41 am    Post subject: Reply with quote

Argh, yes, of course :) Why didn't I thought of it ?
_________________
pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department.
Back to top
View user's profile Send private message
PrimeTime



Joined: 19 Aug 2004
Posts: 25

PostPosted: Fri Aug 20, 2004 6:30 am    Post subject: Reply with quote

Thanks for your replies.

I've tried using the sbv-lite library to fix the sif problem, however, it doesn't seem to work, I am still getting the same results as before.

Code:

// Initialise
SifInitRpc(0);
init_scr();
hddPreparePoweroff();
hddSetUserPoweroffCallback((void *)poweroffHandler,(void *)pid);
scr_printf("Loading poweroff.irx %i bytes\n", size_poweroff_irx);
sbv_patch_enable_lmb();
sbv_patch_disable_prefix_check();
SifExecModuleBuffer(&poweroff_irx, size_poweroff_irx, 0, NULL, &ret);
scr_printf("Loading %s\n",HDDpath);
pid = pkoLoadElf("mc0:/BOOT/SHARED/JPG.ELF");
scr_printf("pkoLoadElf returned %i\n",pid);
if (pid < 0)
{
  scr_printf("Could not execute file %s\n", HDDpath);
  return -1;
}


my pid is < 0 which returns the error. Inside the pkoLoadElf, which I got from a bit of the ps2menu code, the elfdata.epc, elfdata.gp and elfdata.sp are all 0.

I'm not sure what I should do.

Thanks,
Ryan
Back to top
View user's profile Send private message
PrimeTime



Joined: 19 Aug 2004
Posts: 25

PostPosted: Fri Aug 20, 2004 7:14 am    Post subject: Reply with quote

I found part of the solution to my problem:

Originally, I have been uploading my ELF file via ftp.
for example my program is named TEST.ELF and this program
calls JPG.ELF.

By default my ps2 calls PS2 Key Launcher upon booting. I configured PS2 Key Launcher to call my TEST.ELF program and then my TEST.ELF calls JPG.ELF. kinda crazy

anyway, when I tried to execute TEST.ELF using ps2link instead of PS2 Key Launcher; everything worked fine. I suppose it may be something with PS2 Key Launcher.

Ryan
Back to top
View user's profile Send private message
MrSiir[S]



Joined: 14 Sep 2004
Posts: 32

PostPosted: Wed Sep 15, 2004 11:40 am    Post subject: Reply with quote

PrimeTime wrote:
I found part of the solution to my problem:

Originally, I have been uploading my ELF file via ftp.
for example my program is named TEST.ELF and this program
calls JPG.ELF.

By default my ps2 calls PS2 Key Launcher upon booting. I configured PS2 Key Launcher to call my TEST.ELF program and then my TEST.ELF calls JPG.ELF. kinda crazy

anyway, when I tried to execute TEST.ELF using ps2link instead of PS2 Key Launcher; everything worked fine. I suppose it may be something with PS2 Key Launcher.

Ryan


Hi, Though PS2 KeyLauncher does not work very well ;-) , it can be that is not a his fault, ps2link it loads modules in memory and does that the execution of the program not her same from MC or from ps2link

MrSiir
Back to top
View user's profile Send private message Send e-mail
L-Burna



Joined: 20 Sep 2004
Posts: 4

PostPosted: Mon Sep 20, 2004 6:01 pm    Post subject: Reply with quote

Hi I know this probably isn't in the right location on the forum here,but I was wondering MrSiir[S] is it possible to launch apps from the keylauncher from the R3 and L3 buttons.I am currently using the keylauncher for my memory card exploit and I do have to say it works like a charm.I am having problems typing in my R3 and L3 buttons though.The example given in the keylauncher exploit doesn't give a example or really explain how to type in the command used for the L3 and R3 buttons for the KL.DAT file.I can get all the other buttons to work except for these two buttons.I used this command for the R3 and L3 buttons,but it seems to always fail me when I try to type it in like this.

Example:
L3=mc0:/BADATA_SYSTEM/PS2LINK.ELF;PS2LINK V1.23

I would appreciate it alot if you could give me an example or tell me where I am going wrong when typing in my command.Thanks in advance and nice exploit MrSiir[S] I appreciate it and it seems to work for me.I have also asked numerous questions all over the place trying to find the answer,but no one that knows is willing to help out or just doesn't know the answer.
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 -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
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