View previous topic :: View next topic |
Author |
Message |
jgrimm
Joined: 29 Nov 2009 Posts: 27
|
Posted: Tue Dec 01, 2009 10:45 am Post subject: Run ELF within an ELF? |
|
|
i want to embed code that will run an ELF file like ULaunchELF but automaticly (without user interaction) any ideas? |
|
Back to top |
|
|
barf
Joined: 14 Aug 2008 Posts: 8 Location: Norway
|
Posted: Wed Dec 02, 2009 5:42 am Post subject: |
|
|
I suggest intersecting uLauncELF |
|
Back to top |
|
|
jgrimm
Joined: 29 Nov 2009 Posts: 27
|
Posted: Wed Dec 02, 2009 6:09 am Post subject: |
|
|
yes, thats what i was thinking, but how exactly do i do that? im kinda noob at this. im guessing i include some header or .c from ulauncheELF source right? i just need to know wich file |
|
Back to top |
|
|
cosmito
Joined: 04 Mar 2007 Posts: 314 Location: Portugal
|
Posted: Wed Dec 02, 2009 8:14 pm Post subject: |
|
|
It's not that simple. You have to understand ULaunchELF source code. We will not do it for it, of course :) . If you don't, the only way is to start learning programming. |
|
Back to top |
|
|
jgrimm
Joined: 29 Nov 2009 Posts: 27
|
Posted: Thu Dec 03, 2009 6:45 am Post subject: |
|
|
ok, im not i t much of a c or c++ person but i can program my ps2, havent looked at ulaunchelf source much though i dont need u to do it for me, but could u tell me how? or at least give me a vauge idea? thx |
|
Back to top |
|
|
dlanor
Joined: 28 Oct 2004 Posts: 269 Location: Stockholm, Sweden
|
Posted: Sat Dec 05, 2009 8:42 am Post subject: |
|
|
jgrimm wrote: | ok, im not i t much of a c or c++ person but i can program my ps2, havent looked at ulaunchelf source much though i dont need u to do it for me, but could u tell me how? or at least give me a vauge idea? thx
| If you want the ability to do generic elf launching exactly like uLE, to get the same degree of compatibility to other elfs, then you will need to copy quite a lot of the methods used by uLE into your own program. This includes, but is not limited to, a special 'loader' subprogram that is compiled as a separate elf file which is embedded as data inside the main uLE program file.
uLE normally does not launch an external target elf directly, but instead does it by preparing the full pathname of that target elf and passing this as an argument in launching the 'loader' elf from embedded storage. It is this 'loader' program that then launches the real target elf.
The advantage of such a method, widely used in other PS2 homebrews as well, is that all the memory spaces normally used by uLE are freed up before the real target elf is launched. Thus there will be no memory conflicts with any such elfs, unless they happen to use the same memory segments in which the tiny 'loader' program resides. And those memory segments were of course chosen so as to avoid overlapping any area used by normal programs, including both commercial games and homebrews.
Inside the uLE source package you will find the "loader" subprogram source code in a subfolder with the same name, and the code of the main program that invokes this 'loader' is found in the file "elf.c".
For the rest you're on your own...
Good Luck!
Best regards: dlanor |
|
Back to top |
|
|
jgrimm
Joined: 29 Nov 2009 Posts: 27
|
Posted: Sat Dec 05, 2009 10:26 am Post subject: |
|
|
Ok thats just about exactly what i needed to know! i thought it had somthing to do with elf.c thanx thats just what i was looking for dlanor |
|
Back to top |
|
|
|