How to execute an external self
To execute an external self (i.e. from a usb device or from the PlayStation 3 hdd), you will need to know what kind of self can be executed with PSL1GHT. You can execute any self made by make_self (you can find it here: $PS3DEV/bin).
To execute any npdrm selfs or bins (EBOOT.BIN), you need to call some syscalls. The first thing that we need to add is a header :
Now you need to know how you can execute a self or a bin. To do that we need to call this function :
These are the supported arguments :
sysProcessExitSpawn2(path_of_the_self, argv, envp, data, data_size, priority, flags);
argv is the arguments for the self that you want to execute (it can be set to NULL if you don't need it).
envp is the environment variables that can be added to execute the self (it can be set to NULL if you don't need it).
data is any additional data (it can be set to NULL if you don't need it).
data_size is the size of the additional data (set it as 0 if you don't need it).
priority it doesn't need to be explained. use 1001 to set it as normal priority.
flags they are the process flags. you can use one or a combination of the following flags :
SYS_PROCESS_SPAWN_STACK_SIZE_32K SYS_PROCESS_SPAWN_STACK_SIZE_64K SYS_PROCESS_SPAWN_STACK_SIZE_96K SYS_PROCESS_SPAWN_STACK_SIZE_128K SYS_PROCESS_SPAWN_STACK_SIZE_256K SYS_PROCESS_SPAWN_STACK_SIZE_512K SYS_PROCESS_SPAWN_STACK_SIZE_1M
This is an example to execute Dean's standalone browser (in this example i suppose that the self is stored in /dev_hdd0/game/HOMEBREW0/BROWSER.SELF) :
sysProcessExitSpawn2( "/dev_hdd0/game/HOMEBREW0/BROWSER.SELF", NULL, NULL, NULL, 0, 1001, SYS_PROCESS_SPAWN_STACK_SIZE_1M );