SCECAF File Format: Difference between revisions

From Vita Developer wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
[[Category:Software]]<noinclude>[[Category:Main]]</noinclude>
[[Category:Software]]<noinclude>[[Category:Main]]</noinclude>
= File Format  =
= File Format  =
/*Needs Documentation*/
/*Needs Documentation*/
Line 8: Line 9:
Structure (highly speculative) is as follows (most parts are byteswapped):
Structure (highly speculative) is as follows (most parts are byteswapped):


== For caf ==
== Structure ==
 
The file starts with a global header :


{| class="wikitable"
{| class="wikitable"
|-
|-
! Offset !! Length !! Type !! Information
! Offset !! Length !! Type !! Information !! Example
|-
|-
| 0x0 || 0x8 || unsigned long || Magic "SCECAF")
| 0x0 || 0x8 || unsigned long || Magic || ("SCECAF")
|-
|-
| 0x8 || 0x8 || unsigned long || Package Version (0x02)
| 0x8 || 0x8 || unsigned long || Package Version || (0x02)
|-
|-
| 0x10 || 0x8 || unsigned long || Image Version (0x01)
| 0x10 || 0x8 || unsigned long || Image Version || (0x01)
|-
|-
| 0x18 || 0x8 || unsigned long || File Count (0x01)
| 0x18 || 0x8 || unsigned long || Files Count || (0x01)
|-
|-
| 0x20 || 0x8 || unsigned long || Header Length (0xC0)
| 0x20 || 0x8 || unsigned long || Header Length || (0xC0)
|-
|-
| 0x28 || 0x8 || unsigned long || Package Length (0x40)
| 0x28 || 0x8 || unsigned long || Package Length || (0x40)
|-
|-
| 0x30 || 0x8 || unsigned long || Entry ID (0x00)
|}
 
Entries are then described as follows (There are as many entries as there are files) :
 
{| class="wikitable"
|-
|-
| 0x38 || 0x8 || unsigned long || Data Offset(0xC0)
! Offset !! Length !! Type !! Information !! Example
|-
|-
| 0x40 || 0x8 || unsigned long || Data Length(0x40)
| 0x0 || 0x8 || unsigned long || Entry ID || (0x0)
|-
|-
| 0x48 || 0x8 || unsigned long || Unknown(0x01)
| 0x8 || 0x8 || unsigned long || Data offset || (0xC0)
|-
|-
| 0x50 || 0x8 || unsigned long || Unknown(0x02)
| 0x10 || 0x8 || unsigned long || Data length || (0x40)
|-
|-
| 0x58 || 0x10 || u8[16] || IV
| 0x18 || 0x8 || unsigned long || Unknown || (0x01)
|-
|-
| 0x68 || 0x10 || u8[16] || padding
| 0x20 || 0x8 || unsigned long || Unknown|| (0x02)
|-
|-
| 0x78 || 0x20 || u8[32] || sha256sum
| 0x28 || 0x10 || u8[16] || IV || Random IV
|-
|-
| 0x98 || 0x8 || unsigned long || padding (0x0)
| 0x30 || 0x8 || unsigned long || Padding|| (0x0)
|-
|-
| 0xA0 || 0x20 || u8[32] || sha256sum
|}
 
Then follows SHA-256 hashes. They probably are salted hashes of the entry headers.
 
{| class="wikitable"
|-
! Offset !! Length !! Type !! Information !! Example
|-
|-
| 0xC0 || 0x40 || u8[64] || data
| 0x0 || 0x8 || unsigned long || Entry ID || (0x0)
|-
| 0x8 || 0x20 || u8[32] || SHA-256 Sum || sha256sum
|-
| 0x8 || 0x8 || unsigned long || Padding || (0x0)
|-
|-
|}
|}


== For spsp2dmp ==
Files data follows. The data is encrypted (using AES-128-CBC ?). Entries are as follows :
 
{| class="wikitable"
|-
! Offset !! Length !! Type !! Information !! Example
|-
| 0x0 || 0x20 || u8[32] || SHA-256 Sum || sha256sum
|-
| 0x20 || Variable ||  || Encrypted file data ||
|-
|}
 
 
= Location =
 
SCECAF files are used for coredump files. They can be found in ux0:data.
 
Example :
 
ux0:data/crash_report.caf
 
ux0:data/psp2core-SceVideoPlayer.spsp2dmp
 
 
== crash_report.caf ==
 


Similar to caf but with 2 entries
== psp2core-*.spsp2dmp ==

Revision as of 13:32, 4 October 2015


File Format

/*Needs Documentation*/ Files here

Similar to PUP file.

Structure (highly speculative) is as follows (most parts are byteswapped):

Structure

The file starts with a global header :

Offset Length Type Information Example
0x0 0x8 unsigned long Magic ("SCECAF")
0x8 0x8 unsigned long Package Version (0x02)
0x10 0x8 unsigned long Image Version (0x01)
0x18 0x8 unsigned long Files Count (0x01)
0x20 0x8 unsigned long Header Length (0xC0)
0x28 0x8 unsigned long Package Length (0x40)

Entries are then described as follows (There are as many entries as there are files) :

Offset Length Type Information Example
0x0 0x8 unsigned long Entry ID (0x0)
0x8 0x8 unsigned long Data offset (0xC0)
0x10 0x8 unsigned long Data length (0x40)
0x18 0x8 unsigned long Unknown (0x01)
0x20 0x8 unsigned long Unknown (0x02)
0x28 0x10 u8[16] IV Random IV
0x30 0x8 unsigned long Padding (0x0)

Then follows SHA-256 hashes. They probably are salted hashes of the entry headers.

Offset Length Type Information Example
0x0 0x8 unsigned long Entry ID (0x0)
0x8 0x20 u8[32] SHA-256 Sum sha256sum
0x8 0x8 unsigned long Padding (0x0)

Files data follows. The data is encrypted (using AES-128-CBC ?). Entries are as follows :

Offset Length Type Information Example
0x0 0x20 u8[32] SHA-256 Sum sha256sum
0x20 Variable Encrypted file data


Location

SCECAF files are used for coredump files. They can be found in ux0:data.

Example :

ux0:data/crash_report.caf

ux0:data/psp2core-SceVideoPlayer.spsp2dmp


crash_report.caf

psp2core-*.spsp2dmp