I am trying to intercept the execution of the vshmain.prx (currently only for experimental purposes). Here is my code so far. I only want it to load when L is pressed.
Hi, i think that your first problem is that there is no main loop in your code, so your binary is just finnished as soon as it is launched. You should begin by adding a loop. Also note that your are not intercepting anything right now. You should test your code with psplinkusb.
thnk you for pointing that out. I totally forgot that lol. Even though i added the loop it still doesnt work. And yes I am intercepting it. I want to name my module to vshmain.prx. So basically my module is taking the place of vshmain and only booting the vsh if L i pressed. Then it will load the vshmain_real.prx to start the xmb.
Are you using the code pasted without changes ? Because right now you are launching "vshmain.prx" when L is pressed that wont work for sure if the vsh isn't stopped before. Like i said you should use psplinkusb to test your code (add some printf to debug) and/or look at psplink source to see how modules are loaded.
well nothing seems to work. Neither sceKernelLoadExec() or sceKernelLoadModule(). Wtf none of them seem to execute vshmain.prx. I must be doing somthing wrong. Someone must know the answer lol.
fuzzzzy wrote:well nothing seems to work. Neither sceKernelLoadExec() or sceKernelLoadModule(). Wtf none of them seem to execute vshmain.prx. I must be doing somthing wrong. Someone must know the answer lol.
You must load and start other modules required before to load and start vshmain.prx
For 1.50 kernel, maybe other modules are necessary in greater firmware, use kprintf handler to know which modules are necessary.
EDIT :
Oups, i didn't see your second post, forget what i said, if you rename your module for it starts instead of real vshmain.prx, you don't need to load other modules, the firmware will do it for you.
How is this different from loading any other module :P
i think the problem is that you are not loading and starting
your module to use VSH_MODE(0x800) instead of USER_MODE(0x0)
(if you pick KERNEL_MODE(0x1000) it doesnt matter really, which you do)
but you DEFINITELY ! do not want to use any LoadExec** calls to load a
module on top of any other modules ...as loadExec will simply restart
the system and then load your module in whatever mode you choose
so it is preferred to use the pspSDK** loading/starting of modules
just make sure you know which memory area/partition you are loading into
as this is very important in the module properly working ...ie .. if you use a
kernel function in a kernel module you obviously want to load into a kernel
memory partition, second do not use the stdlib C lib, using newlib in a kernel
area always gives problems so it is best to use the PSP's own kernel libc
which you can easily use by setting your makefile to include USE_KERNEL_LIBC = 1, course this all works great on a 1.5 firmware PSP :P
as for further firmware revisions there is a bug in the kernel for loading
modules, you can try to edit the loadmodule sample that is in the PSPSDK
but remember that if your not on 1.5 then that warning right at the top of
the sample could very well mean that the bug also exists in your firmware
lastly, it is always better to load a kernel EBOOT first that can handle your
module and conduct its actions ...usually we use psplinkusb as it works magic
but you are always welcome to use your own EBOOT, as long as you set
that EBOOT to be in KERNEL_MODE, and then have this kmode eboot handle
the loading and starting and possibly setting where in memory to load your
custom module for whatever you are doing, apart from these things i do not
know what else could cause you this problem, as i can load any number of
modules as memory space allows me to load
if anything else, taking a look at the psplink source is always a great way
to start seeing how to properly load your modules, so it might help you to do that