PARAM.PFD: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
mNo edit summary
No edit summary
Line 1: Line 1:
[[Category:Software]]
[[Category:Software]]
==PARAM.PFD==
==Description==
This file is responsible for making sure the save games aren't tampered with. To prevent file modification of this file and other games files, the cryptographic signatures are inside this file. Some games don't sign their files here though (more info on unprotected saves:[[Game Saves]]).
This file is responsible to prevent modification of other files, the only purpose is the security of the folder contents


===Structure===
Contains the cryptographic signatures of other files of the same folder (not all. but the ones that developers decided to be important enought to be secured).


File size is 0x8000 bytes
Its used in several folders of the PS3, usually to controll data related with the user profile:


/dev_hdd0/home/0000000*/savedata/SAVEDATA_DIRECTORY/PARAM.PFD <---- in all save game folders
/dev_hdd0/home/0000000*/trophy/NPCOMMID/PARAM.PFD <--- in all trohpye folders
/dev_hdd0/home/0000000*/trophy/_TROPSYS_/PARAM.PFD <---- in the trophy "index" folder
Usually PARAM.SFO is one of the entryes in the list of files controlled by PARAM.PFD but this can vary
e.g. the folder _TROPSYS_ only contains 2 files: TROPSYS.DAT &  PARAM.PFD (TROPSYS.DAT is the trophy index, and PARAM.PFD secures it)
Every time one of the files listed inside the .PFD is updated... the .PFD itself needs to be updated to store the new signatures of the files that have changed (e.g. when you update a savegame there is some text that changes inside PARAM.SFO with your current game time, status, level, etc..., or when you install new trophyes from a new game the TROPSYS.DAT "index" needs to be updated to list the new trophy installation as valid in the XMB, or when you unlock a new trophye the file TROPUSR.DAT is updated with this data)
More info on other related file formats: [[PARAM.SFO]] [[Game Saves]] [[Trophy files]].
==Structure==
File size seems to be fixed at 0x8000 bytes
This is because the number of entryes seems to be always 60 (when the entry is not used his position is reserved but marked as blank)
===Header (from 0x0 to 0x68)===
{| border="1" cellspacing="0" cellpadding="5" border="#999" class="wikitable" style="border:1px solid #999; border-collapse: collapse;"  
{| border="1" cellspacing="0" cellpadding="5" border="#999" class="wikitable" style="border:1px solid #999; border-collapse: collapse;"  
|- bgcolor="#cccccc"
|- bgcolor="#cccccc"
! Offset !! Size !! Description !! Value
! Offset !! Size !! Description !! Value
|-
|-
| 0x00 || 0x04 bytes || Nothing || All zeroes
| 0x00 || 4 bytes || Nothing || 00 00 00 00 ¿why this padding?
|-
| 0x04 || 4 bytes || Magic value || "PFDB" in ASCII
|-
|-
| 0x04 || 0x04 bytes || Magic value || "PFDB" in ASCII
| 0x08 || 8 bytes || Unknown || 00 00 00 00 00 00 00 03 ¿file type?
|-
|-
| 0x08 || 0x08 bytes || Unknown || 0x3
| 0x10 || 80 bytes || Public key || Method unknown
|-
|-
| 0x10 || 0x50 bytes || Public key || Method unknown
| 0x60 || 08 bytes || Unknown || 00 00 00 00 00 00 00 39 ¿mark of the header end?
|-
|-
| 0x60 || 0x08 bytes || Unknown || 0x39
|}
:
 
===Index table (from 0x68 to 0x248)===
Table consisting of 60 entryes, each with a lenght of 8byte-words
The used entryes seems to be randomly placed in the table
{| border="1" cellspacing="0" cellpadding="5" border="#999" class="wikitable" style="border:1px solid #999; border-collapse: collapse;"
|- bgcolor="#cccccc"
! Some common entryes !! Description
|-
|-
| 0x68 || 0x08 bytes || Unknown || 0x72
| 00 00 00 00 00 00 00 72 || no entry (not used or blank)
|-
|-
| 0x70 || 0x08 bytes || Number of files || = x
| 00 00 00 00 00 00 00 01 || entry nº 1
|-
| 00 00 00 00 00 00 00 02 || entry nº 2
|-
| 00 00 00 00 00 00 00 03 || entry nº 3
|-
| 00 00 00 00 00 00 00 00 || weird value at the end of the file ?
|-
|-
|}
|}
:
:


then:
===Data table (from 0x248 to 0x4200?)===
table of consisting 60 * 8byte-words
Each entry 272 bytes lenght:
0x72 = no entry
0- x = entry id


each entry:
{| border="1" cellspacing="0" cellpadding="5" border="#999" class="wikitable" style="border:1px solid #999; border-collapse: collapse;"
<pre>
|- bgcolor="#cccccc"
65 bytes null-terminated filename (filename appears to be 0x72 bytes in length?
! Lenght !! Description !! Notes
(followed by the certificate?)
|-
- bob)
| 8 bytes || table-entry mark || 00 00 00 00 00 00 00 72
4 bytes unknown (first byte zero, 2 bytes vary, third byte fixed)
|-
0x54 bytes certificate (if param.sfo is file, then size = 0x90 bytes)
| 64 bytes ||filename || null-terminated
0x2c bytes zero padding (only if after param.sfo; otherwise 0x68 bytes zero padding -bob)
|-
4 bytes file size
| ¿8 bytes? || unknown || ¿¿first byte zero, 2 bytes vary, third byte fixed??
8 bytes table-entry again (???)
|-
| 188 bytes || certificate || null-terminated (when PARAM.SFO is the file then it stores 2 values)
|-
| 4 bytes || file size
|-
|}
:


  weird repeating 20-byte pattern on file-end (some kind of sha-1 hash??)
===Weird repeating pattern on file-end (from 0x7B60 to 0x7FD4)===
  20-byte pattern on file-end (some kind of sha-1 hash??)


  The weird repeating pattern 60 x 12 bytes so an entry for each potential file with the blank entry (I.E. no file)
  The weird repeating pattern 60 x 12 bytes so an entry for each potential file with the blank entry (I.E. no file)
  being represented by the repeating byte pattern.
  being represented by the repeating byte pattern.
</pre>
 
==Cryptography==
Unknown
 
 
 
 
 
 
 
 






Source: http://ps3dev.wikispaces.com/PARAM.PFD
Source: http://ps3dev.wikispaces.com/PARAM.PFD

Revision as of 01:08, 24 December 2011

Description

This file is responsible to prevent modification of other files, the only purpose is the security of the folder contents

Contains the cryptographic signatures of other files of the same folder (not all. but the ones that developers decided to be important enought to be secured).

Its used in several folders of the PS3, usually to controll data related with the user profile:

/dev_hdd0/home/0000000*/savedata/SAVEDATA_DIRECTORY/PARAM.PFD <---- in all save game folders
/dev_hdd0/home/0000000*/trophy/NPCOMMID/PARAM.PFD <--- in all trohpye folders
/dev_hdd0/home/0000000*/trophy/_TROPSYS_/PARAM.PFD <---- in the trophy "index" folder

Usually PARAM.SFO is one of the entryes in the list of files controlled by PARAM.PFD but this can vary

e.g. the folder _TROPSYS_ only contains 2 files: TROPSYS.DAT & PARAM.PFD (TROPSYS.DAT is the trophy index, and PARAM.PFD secures it)

Every time one of the files listed inside the .PFD is updated... the .PFD itself needs to be updated to store the new signatures of the files that have changed (e.g. when you update a savegame there is some text that changes inside PARAM.SFO with your current game time, status, level, etc..., or when you install new trophyes from a new game the TROPSYS.DAT "index" needs to be updated to list the new trophy installation as valid in the XMB, or when you unlock a new trophye the file TROPUSR.DAT is updated with this data)

More info on other related file formats: PARAM.SFO Game Saves Trophy files.

Structure

File size seems to be fixed at 0x8000 bytes

This is because the number of entryes seems to be always 60 (when the entry is not used his position is reserved but marked as blank)

Header (from 0x0 to 0x68)

Offset Size Description Value
0x00 4 bytes Nothing 00 00 00 00 ¿why this padding?
0x04 4 bytes Magic value "PFDB" in ASCII
0x08 8 bytes Unknown 00 00 00 00 00 00 00 03 ¿file type?
0x10 80 bytes Public key Method unknown
0x60 08 bytes Unknown 00 00 00 00 00 00 00 39 ¿mark of the header end?

Index table (from 0x68 to 0x248)

Table consisting of 60 entryes, each with a lenght of 8byte-words The used entryes seems to be randomly placed in the table

Some common entryes Description
00 00 00 00 00 00 00 72 no entry (not used or blank)
00 00 00 00 00 00 00 01 entry nº 1
00 00 00 00 00 00 00 02 entry nº 2
00 00 00 00 00 00 00 03 entry nº 3
00 00 00 00 00 00 00 00 weird value at the end of the file ?

Data table (from 0x248 to 0x4200?)

Each entry 272 bytes lenght:

Lenght Description Notes
8 bytes table-entry mark 00 00 00 00 00 00 00 72
64 bytes filename null-terminated
¿8 bytes? unknown ¿¿first byte zero, 2 bytes vary, third byte fixed??
188 bytes certificate null-terminated (when PARAM.SFO is the file then it stores 2 values)
4 bytes file size

Weird repeating pattern on file-end (from 0x7B60 to 0x7FD4)

20-byte pattern on file-end (some kind of sha-1 hash??)
The weird repeating pattern 60 x 12 bytes so an entry for each potential file with the blank entry (I.E. no file)
being represented by the repeating byte pattern.

Cryptography

Unknown






Source: http://ps3dev.wikispaces.com/PARAM.PFD