PARAM.SFO

From PS3 Developer wiki
Revision as of 04:55, 17 January 2012 by Sandungas (talk | contribs) ("SaveData Example" moved to talk)
Jump to navigation Jump to search


SFO (System File O???) are used in folders wich content needs to be displayed in the XMB. In the same folder than the SFO are the "content files" (ICON0.PNG PIC0.PNG etc...) and in few cases (like in savegames) there is a PARAM.PFD for security reasons.

The parameters SFO contains can be simplyfied as imputs and outputs of the content:

  • Contains the information strings needed to display the content in the XMB and his restrictions (e.g. name and version of a game).
  • When executing the content, the SFO is sending "boot modifyers" (or flags) to the content to activate "speciall modes" (e.g. audio and video modes of a game).


SFX (System File in XML format) are used to create SFO's. Additionally SFX files are used in Blue-Ray disc games inside PS3_EXTRA folder to display content in XMB. In fact the values contained in both formats are the same and the conversion is easy from one format to the other

SFO and SFX can be "chained" in a structure of subfolders with a maximun of 3 levels (SFX format is used in level3).

Level2 SFO's can contain specific values than cant be used in Level1 (e.g. CATEGORY when used in level2 has lot of different and specific values). In the same way when ATTRIBUTE is used in level2 his valid values are completly different than when used in level1.


Internal Structure

Header

typdef struct Header
{
uint32_t Signature; /* Always PSF */
uint32_t Version; /* Usually 1.1 */
uint32_t Name_Table_Start; /* Start position of the Name_Table */
uint32_t Data_Table_Start; /* Start position of the Data_Table */
uint32_t Entries_Number; /* Number of entries */
};

Definition_Table

This structure repeats one time for every Entries_Number defined in the header. All values are in Little Endian

 typedef struct Definition_Table
 {
 uint16_t Name_Table_Offset; /* Offset of the Name of the entry, from start of Name_Table */
 uint16_t Data_Type; /* Type of data of the entry */
 uint32_t Bytes_used; /* Data_Block Bytes Used by the entry */
 uint32_t Bytes_Reserved; /* Data_Block Total Size reserved for the entry */
 uint32_t Data_Table_Offset; /* Offset of the Data of the entry, from start of Data_Table */
 };
Valid Data Types Meaning Notes
04 00 Present but filled with zeroes In ACCOUNT_ID when not registered in PSN
04 02 utf-8
04 04 integer

Name_Table

The entryes of this table (and the next table) can vary depending of the kind of content displayed in the XMB (in other words... are defined by CATEGORY and restricted by the system).

Each entry of the table needs a 0x00 byte after the name to separate them

The table has a padding at the end to fit the total size in bytes to a multiplier or 4, this padding is added after the last 0x00 byte of the last entry. If the last entry (included his 0x00 byte) matches with a multiplier of 4 this padding doesn't exist

Data_Table

This table has no padding between entries neither at the end, padding is not supported in any way, block sizes are fixed (in Definition_Table) and the space is reserved for each entry

The number of "Bytes_used" for each entry is defined in the "Definition_Table", it matches the "Bytes_Reserved" when the entry is an integer (integer entries uses all the reserved bytes) but can vary with utf-8 entries (e.g. TITLE of the game), additionally utf-8 entries needs a 0x00 byte after the last character of the text string, this byte can be considered part of the string to count the "Bytes_used" for the entry in the "Definition_Table"

SFO Example

This is an example of a hand made SFO structure, it contains only 1 entry (TITLE_ID), i choosed this one because is short enought to explain the structure in 4 lines, needs padding at the end of the Name_Table, and the "used bytes" are less than the "reserved bytes" in the "data block" of the entry

0x0000  00 50 53 46  01 01 00 00  24 00 00 00  30 00 00 00 | .PSF....$...0... |
0x0010  01 00 00 00  00 00 04 02  0A 00 00 00  0F 00 00 00 | ................ |
0x0020  00 00 00 00  54 49 54 4C  45 5F 49 44  00 00 00 00 | ....TITLE_ID.... |
0x0030  41 42 43 44  31 32 33 34  35 00 00 00  00 00 00 00 | ABCD12345....... |

All the blocks of the file are explained in the next list, it has separated sections for header and the three tables.

Offset Size Content Conversion Value Notes
Header
0x0000 0x04 00 50 53 46 To utf-8 PSF Signature
0x0004 0x04 01 01 00 00 Big endian, decimal 1.1 Version (the point is added by the system)
0x0008 0x04 24 00 00 00 Big endian 0x0024 Start of Name_Table
0x000C 0x04 30 00 00 00 Big endian 0x0030 Start of Data_Table
0x0010 0x04 01 00 00 00 Big endian, decimal 1 Number of entries in the tables
Definition_Table
0x0014 0x02 0000 Big endian 0 (Start of "TITLE_ID") - (Start of Name_Table) = 0x0024-0x0024 = 0
0x0016 0x02 0402 Unknown Data_Type
0x0018 0x04 0A000000 Big endian, decimal 10 Data_Block Bytes Used (ABCD12345 are 9 bytes + 1 blank = 10)
0x001C 0x04 0F000000 Big endian, decimal 16 Data_Block Total Size
0x0020 0x04 00000000 Big endian 0 (Start of "ABCD12345") - (Start of Data_Table) = 0x0030-0x0030 = 0
Name_Table
0x0024 0x09 5449544C455F494400 To utf-8 TITLE_ID Name, included 1 blank byte at the end
0x002D 0x03 000000 Padding (9 from the previous entry + 3 padding = 12 bytes)
Data_Table
0x0030 0x0F 41424344313233343500000000000000 To utf-8 ABCD12345 Data, 16 bytes block size, 10 bytes used included 1 blank byte

Source http://www.ps3hax.net/showthread.php?t=28704

SFX Example

This is a PARAM.SFX from the Blue-Ray "move demo disc", the disc contains some installable demos in format .PKG in the path /PS3_EXTRA/D000/DATA000.PKG & /PS3_EXTRA/D000/PARAM.SFX

The entryes and values are self explanatory, this files can be created easily by hand

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<paramsfo add_hidden="false">
  <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>
</paramsfo>

Parameters Table

Parameters are ordered inside the SFO alphabetically (from A to Z)

This table contains all the parameters known/found of the standard formats used in PS3. Columns of the table are named to match this formats

Variable Name Block Size Data Type TR SD HG GP GD 1P 2P MN Note
ACCOUNTID 16 utf-8 Yes No No ??? No No ??? No PSN User Account (blank when not registered in PSN)
ACCOUNT_ID 16 integer No Yes No ??? No No ??? No PSN User Account (blank when not registered in PSN)
ANALOG_MODE 4 integer No No No ??? No Yes ??? No
APP_VER 8 utf-8 No No Opt ??? No No ??? Yes Not used in old games
ATTRIBUTE 4 integer No Yes Yes ??? No Yes ??? Yes Manages speciall flags
BOOTABLE 4 integer No No Yes ??? No Yes ??? Yes Mandatory for executables
CATEGORY 4 utf-8 No Yes Yes ??? Yes Yes ??? Yes Defines the kind of content
LANG 4 integer Yes No No ??? No No ??? No The language used when the trophy file was installed
DETAIL 1024 utf-8 No Opt No ??? No No ??? No Third and next lines of text under the icon in XMB
LICENSE 512 utf-8 No No Yes ??? No No ??? No
NPCOMMID 16 utf-8 Yes No No ??? No No ??? No
NP_COMMUNICATION_ID 16 utf-8 No No Opt ??? No No ??? No
PADDING 8 integer Yes No No ??? No No ??? No
PARAMS 1024 integer No Yes No ??? No No ??? No Can store severall strings toghether (partilly unknown)
PARAMS2 12 integer No Yes No ??? No No ??? No Unknown
PARENTALLEVEL 4 integer Yes No No ??? No Yes ??? No Parentall controll flags
PARENTAL_LEVEL 4 integer No Yes Yes ??? Yes No ??? Yes Parentall controll flags
PS3_SYSTEM_VER 8 utf-8 No No Yes ??? No Yes ??? Yes Minimun firmware required to run the Game/App
RESOLUTION 4 integer No No Yes ??? No Yes ??? Yes Video modes flags
SAVEDATA_DIRECTORY 64 utf-8 No Yes No ??? No No ??? No Folder name of the savedata
SAVEDATA_LIST_PARAM 8 utf-8 No Yes No ??? No No ??? No
SOUND_FORMAT 4 integer No No Yes ??? No Yes ??? Yes Sound modes flags
SOURCE 4 integer Yes No No ??? No No ??? No
SUB_TITLE 128 utf-8 No Opt No ??? No No ??? No Secondary text line under the icon in XMB
TITLE 128 utf-8 No Yes Yes ??? Yes Yes ??? Yes First line of text of the icon in XMB
TITLEID000, 001, 002... 16 utf-8 Yes No No ??? No No ??? No Localized languages
TITLE_00, 01, 02... 128 utf-8 No No Opt ??? No No ??? No Localized languages
TITLE_ID 16 utf-8 No No Yes ??? Yes Yes ??? Yes
VERSION 8 utf-8 No No Yes ??? Yes Yes ??? Yes this one has the same name than the next, but uses 6 bytes
VERSION 8 utf-8 Yes No No ??? No No ??? No this one uses only 3 bytes

Notes:

  • Columns at the right are named by his CATEGORY
  • TR.- is used in the table for trophies to keep the colums width, but is not a valid CATTEGORY, actually trophies dont have CATEGORY
  • SD.- Save Data
  • HG.- HDD Game (same for DG or "Disc Game" refered to an originall Blue Ray disc game)
  • GP.- Game Patch. needed example
  • GD.- Game Data
  • 1P.- PS1 classics (PlayStation One games)
  • 2P.- PS2 Classics (PlayStation 2 games) needed example
  • MN.- Mini



PSL1GHT PARAM.SFO

See :

$ ./read_sfo PARAM1.SFO 
read_sfo v0.01

-[HEADER]---------------
SFO Version: 101
Entries: 12

-[PARAMETERS]-----------
APP_VER: 01.00
ATTRIBUTE: 0
BOOTABLE: 1
CATEGORY: HG
LICENSE: This application was created with the official non-official SDK called psl1ght, for more information visit http://www.psl1ght.com/ . This is in no way associated with Sony Computer Entertainment Inc., please do not contact them for help, they will not be able to provide it.
PARENTAL_LEVEL: 0
PS3_SYSTEM_VER: 01.8000
RESOLUTION: 3f
SOUND_FORMAT: 117
TITLE: PSL1GHT SFO
TITLE_ID: TEST00001
VERSION: 01.00

HEADER

SFO Version

  SFO Version: 101

Entries

Number of entries for PARAMETERS

  Entries: 12

PARAMETERS

APP_VER

This is the version of the Homebrew, that will be displayed on the PS3

   <value name="APP_VER" type="string">
   00.50
   </value>

ATTRIBUTE

This value enable special functions of the Homebrew (Enable Move Controller, etc..)

   <value name="ATTRIBUTE" type="integer">
   0
   </value>

BOOTABLE

If this pkg is bootable or not. (1 to enable, 0 to disable) useful when you are going to make a data pkg.

   <value name="BOOTABLE" type="integer">
   1
   </value>

CATEGORY

This is the category where you will see your homebrew.

   <value name="CATEGORY" type="string">
   HG
   </value>

these are the categories available on a Official Firmware:

  • HM : Playstation Network
  • CB : Network
  • HG : Harddrive Game
  • DG : Disc Game (blueray)
  • AV : Video
  • AM : Music
  • AP : Photo
  • AT : TV
  • MN : Minis Network
  • IP : Install Package
  • DP : Disc Package
  • TR : Theme DIR
  • VR : Video DIR
  • VI : Video

LICENSE

PSL1GHT Licence ( DO NOT REMOVE IT and DON'T CHANGE IT) LICENSE has a fixed block size of 128 bytes

   <value name="LICENSE" type="string">
   This application was created with the official non-official SDK called PSL1GHT, for more information visit http://www.psl1ght.com/ . This is in no way associated with Sony Computer Entertainment Inc., please do not contact them for help, they will not be able to provide it.
   </value>

PARENTAL_LEVEL

Parental level, ( 0 for everyone )

   <value name="PARENTAL_LEVEL" type="integer">
   0
   </value>

PS3_SYSTEM_VER

Minimum PS3 System version to be bootable this homebrew

   <value name="PS3_SYSTEM_VER" type="string">
   01.5000
   </value>

RESOLUTION

TV Resolution (Unknown )

   <value name="RESOLUTION" type="integer">
   63
   </value>

SOUND_FORMAT

Type of sound

   <value name="SOUND_FORMAT" type="integer">
   279
   </value>

TITLE

Title of the homebrew

   <value name="TITLE" type="string">
   Title of this Homebrew
   </value>

TITLE_ID

ID of the homebrew (this id must be the same id inside the Makefile)

   <value name="TITLE_ID" type="string">
   XXYYYYYY
   </value>

VERSION

Homebrew Version

   <value name="VERSION" type="string">
   00.50
   </value>


(source deroad: http://ps3tutorials.wikispaces.com/Edit+the+sfo.xml+Tutorial)


PS3SYS PARAM.SFO

$ ./read_sfo PARAM2.SFO 
read_sfo v0.01

-[HEADER]---------------
SFO Version: 101
Entries: 20

-[PARAMETERS]-----------
APP_VER: 01.00
ATTRIBUTE: 880727
BOOTABLE: 1
CATEGORY: HG
LICENSE: Library programs ©Sony Computer Entertainment Inc. Licensed for play on the PLAYSTATION®3 Computer Entertainment System or authorized PLAYSTATION®3 format systems. For full terms and conditions see the user's manual. This product is authorized and produced under license from Sony Computer Entertainment Inc. Use is subject to the copyright laws and the terms and conditions of the user's license.
PARENTAL_LEVEL: 0
PARENTAL_LEVEL_A: ffffffff
PARENTAL_LEVEL_C: ffffffff
PARENTAL_LEVEL_E: ffffffff
PARENTAL_LEVEL_H: ffffffff
PARENTAL_LEVEL_J: ffffffff
PARENTAL_LEVEL_K: ffffffff
PS3_SYSTEM_VER: 00.93
REGION_DENY: fffff001
RESOLUTION: 1
SOUND_FORMAT: 1
TITLE: PS3SYS SFO
TITLE_ID: TEST00002
VERSION: 01.00


HEADER

SFO Version

  SFO Version: 101

Entries

Number of entries for PARAMETERS

   Entries: 20

PARAMETERS

APP_VER

This is the version of the Homebrew, that will be displayed on the PS3

String (UTF-8)
max length 8
   <value name="APP_VER" type="string">
   01.00
   </value>

ATTRIBUTE

This value enable special functions of the Homebrew (Enable Move Controller, Enable PSP remoteplay etc..)

Integer
max length 4 
   <value name="ATTRIBUTE" type="integer">
   880727
   </value>
Enable PSP remoteplay
  • MPEG-4 SP/ATRAC=0x1
  • MPEG-4 AVC/AAC=0x4
Enable BGM
  • Enable ingame XMB BGM=0x20
Enable Move Controller
  • Support Playstation Move=0x800000
  • Enable Move controller warning=0x100
  • Enable Navigation controller warning=0x200
  • Enable Playstation Eye warning=0x400
  • Enable Calibration warning=0x800
Enable 3D Warning
  • Enable 3D warning screen=0x1000

BOOTABLE

If this pkg is bootable or not. (1 to enable, 0 to disable) useful when you are going to make a data pkg.

Integer
max length 4
   <value name="BOOTABLE" type="integer">
   1
   </value>

CATEGORY

This is the category where you will see your homebrew.

String(UTF-8)
max length 4
   <value name="CATEGORY" type="string">
   HG
   </value>

these are the categories available on a Official Firmware:

  • HM : Playstation Network
  • CB : Network
  • HG : Harddrive Game
  • DG : Disc Game (blueray)
  • AV : Video
  • AM : Music
  • AP : Photo
  • AT : TV
  • MN : Minis Network

As Additional Items:

  • AR : Patches
  • IP : Install Packages
  • VI : Video
  • TR : Theme
  • XR : Extra Contents

CONTENT_ID

ContentID for Gamepurchase

String(UTF-8)
max length 48

LICENSE

PSL1GHT Licence ( DO NOT REMOVE IT and DON'T CHANGE IT) LICENSE has a fixed block size of 128 bytes

String(UTF-8)
max length 512
   <value name="LICENSE" type="string">
   Library programs ©Sony Computer Entertainment Inc. Licensed for play on the PLAYSTATION®3 Computer Entertainment System or authorized PLAYSTATION®3 format systems. For full terms and conditions see the user's manual. This product is authorized and produced under license from Sony Computer Entertainment Inc. Use is subject to the copyright laws and the terms and conditions of the user's license.
   </value>

NP_COMMUNICATION_ID

Comm ID for Bootable message

String(UTF-8)
max length 16

PARENTAL_LEVEL

Integer
max length 4

Parental level, (0-11 ; 0 for everyone )

   <value name="PARENTAL_LEVEL" type="integer">
   0
   </value>
PARENTAL_LEVEL_A

Parental level, SCEA

Integer
max length 4
   <value name="PARENTAL_LEVEL_A" type="integer">
   ffffffff
   </value>
PARENTAL_LEVEL_C

Parental level, SCH

Integer
max length 4
   <value name="PARENTAL_LEVEL_C" type="integer">
   ffffffff
   </value>
PARENTAL_LEVEL_E

Parental level, SCEE

Integer
max length 4
   <value name="PARENTAL_LEVEL_E" type="integer">
   ffffffff
   </value>
PARENTAL_LEVEL_H

Parental level, SCEH

Integer
max length 4
   <value name="PARENTAL_LEVEL_H" type="integer">
   ffffffff
   </value>
PARENTAL_LEVEL_J

Parental level, SCEJ

Integer
max length 4
   <value name="PARENTAL_LEVEL_J" type="integer">
   ffffffff
   </value>
PARENTAL_LEVEL_K

Parental level, SCEK

Integer
max length 4
   <value name="PARENTAL_LEVEL_K" type="integer">
   ffffffff
   </value>

PS3_SYSTEM_VER

Minimum PS3 System version to be bootable this homebrew

String(UTF-8)
max length 8
   <value name="PS3_SYSTEM_VER" type="string">
   00.93
   </value>

REGION_DENY

Region restrictions (only possible with 3.30 and higher)

Integer
max length 4
   <value name="REGION_DENY" type="integer">
   fffff001
   </value>

RESOLUTION

TV Resolution (576(16x9)=0x20, 480(16:9)=0x10, 1080=0x8, 720=0x4, , 576=0x2, 480=0x1)

Integer
max length 4
   <value name="RESOLUTION" type="integer">
   1
   </value>

SOUND_FORMAT

Type of sound (DTS Digital Surround=0x202, Dolby Digital=0x102, 7.1LPCM=0x10, 5.1LPCM=0x4, 2LPCM=0x1)

Integer
max length 4
   <value name="SOUND_FORMAT" type="integer">
   1
   </value>

TITLE

Title of the homebrew

String(UTF-8)
max length 128
   <value name="TITLE" type="string">
   Title of this Homebrew
   </value>
TITLE_00

Localised title - Japanese

String(UTF-8)
max length 128
TITLE_01

Localised title - English

String(UTF-8)
max length 128
TITLE_02

Localised title - French

String(UTF-8)
max length 128
TITLE_03

Localised title - Spanish

String(UTF-8)
max length 128
TITLE_04

Localised title - German

String(UTF-8)
max length 128
TITLE_05

Localised title - Italian

String(UTF-8)
max length 128
TITLE_06

Localised title - Dutch

String(UTF-8)
max length 128
TITLE_07

Localised title - Portuguese

String(UTF-8)
max length 128
TITLE_08

Localised title - Russian

String(UTF-8)
max length 128
TITLE_09

Localised title - Korean

String(UTF-8)
max length 128
TITLE_10

Localised title - Trad.Chinese

String(UTF-8)
max length 128
TITLE_11

Localised title - Simp.Chinese

String(UTF-8)
max length 128
TITLE_12

Localised title - Finnish

String(UTF-8)
max length 128
TITLE_13

Localised title - Swedish

String(UTF-8)
max length 128
TITLE_14

Localised title - Danish

String(UTF-8)
max length 128
TITLE_15

Localised title - Norwegian

String(UTF-8)
max length 128
TITLE_16

Localised title - Polish

String(UTF-8)
max length 128

TITLE_ID

ID of the homebrew (this id must be the same id inside the Makefile)

String(UTF-8)
max length 16
   <value name="TITLE_ID" type="string">
   XXYYYYYY
   </value>

VERSION

Homebrew Version

String(UTF-8)
max length 8
   <value name="VERSION" type="string">
   01.00
   </value>