- Following up on his previous
work, this weekend PlayStation 3 developer deroad
has released a PS3 SFO Reader and SFO2SFX homebrew applications complete with source code.
Download: PS3 Tools Deroad SFO to SFX
To quote: Since today sandungas
talked about a bug in the old SFO Reader, i immediately fixed it (you can find it here: ps3devwiki.com/wiki/Dev_Tools#SFO_Reader).
Then he started talking about SFX. They are simple XML files that the ps3 can read as SFO. This is an example:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<param key="ATTRIBUTE" fmt="int32" max_len="4">0</param>
<param key="CATEGORY" fmt="utf8" max_len="4">IP</param>
<param key="PARENTAL_LEVEL" fmt="int32" max_len="4">2</param>
<param key="TITLE" fmt="utf8" max_len="128">Beat Sketcher™</param>
<param key="TITLE_05" fmt="utf8" max_len="128">Beat Sketcher™ A mano libera</param>
So i converted my SFO reader into a SFO to SFX converter. You can get it here: ps3devwiki.com/wiki/Dev_Tools#SFO2SFX
I hope that someone will find it useful. From:
[SFO HDR] 0x00505346
[SFO Version] 0x00000101
[SFO N] 6 Value(s)
[SFO Params Offsets] 0x000000b4
[ SFO ]
[ 1 ] CATEGORY | Param: 2D
[ 2 ] PARENTAL_LEVEL | Param: 0x1
[ 3 ] PS3_SYSTEM_VER | Param: 01.3100
[ 4 ] TITLE | Param: PS2 System Data
[ 5 ] TITLE_ID | Param: NPIA00001
[ 6 ] VERSION | Param: 01.00
<?xml version="1" encoding="utf-8" standalone=yes"?>
<param key="CATEGORY" fmt="utf8" max_len="4">2D</param>
<param key="PARENTAL_LEVEL" fmt="int32" max_len="4">1</param>
<param key="PS3_SYSTEM_VER" fmt="utf8" max_len="8">01.3100</param>
<param key="TITLE" fmt="utf8" max_len="128">PS2 System Data</param>
<param key="TITLE_ID" fmt="utf8" max_len="16">NPIA00001</param>
<param key="VERSION" fmt="utf8" max_len="8">01.00</param>
Finally, how to call a PS3 Syscall: In computing, a system call (aka Syscall) is how a program requests a service from an operating system’s kernel. This may include hardware related services (e.g. accessing the hard disk), creating and executing new processes, and communicating with integral kernel services (like scheduling). System calls provide the interface between a process and the operating system.
With PSL1GHT we can call all the 989 Syscalls.. it’s really simple to call one, but you need to know how many parameters it needs; there are some syscalls that needs just 1 parameter, there are others that needs 8 parameters.
You can find the list of syscalls with the numbers of the parameters here: ps3devwiki.com/wiki/LV2_Functions_and_Syscalls#Syscalls
Once you know the numbers of the parameter that you need (and the type of the parameters if they are written), you are ready to call one:
first thing add the following include:
Then you can call the syscall:
lv2syscallN(number_of_the_syscall, parameters… );
Change N with the number of the parameters, and put the number of the syscall that you need to call with the parameters.
Shutdown the PS3:
1) Look into the dev wiki and you will see that the syscall to shutdown the PS3 is number 379 ( sys_sm_shutdown ) and it wants 4 parameters:
2) So now i can call the syscall with 4 parameters:
now on the wiki it says, that the shutdown value is 0x1100 or 0x100, so i will write:
now if i call this on a stupid homebrew like:
it will really shutdown the ps3.
now if you are not sure to completely understood this, i will make another example:
Get current time:
now this example comes from the PSL1GHT SDK:
this is the function that get the current time on the ps3.
s32 sysGetCurrentTime(u64 *sec,u64 *nsec)
now it uses 2 parameters so it calls lv2syscall2, then it needs the parameters that will get the value sec and nsec. now, in this function you can see that it ask the return of this syscall; to call any return of a determinate syscall, you can simply ask it by calling:
you need to define the type of the returning variable. in that case it was s32 (aka signed int).
so it calls:
if it was a normal integer, you had to call:
to compile it correctly you need to simply add the following flags: