Editing EDAT files

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
EDATA is a file format used on PSP and PS3 to store encrypted data. There is also on PS3 only the SDATA file format which is very similar to EDATA (to detail). This page is for now about PS3 EDATA/SDATA only.
= Info on the talk page =
= Info on the talk page =


Line 16: Line 14:
|-
|-
! style="background-color:#ffffff; border-left:1px solid #ffffff; border-top:1px solid #ffffff;" |
! style="background-color:#ffffff; border-left:1px solid #ffffff; border-top:1px solid #ffffff;" |
! Offset !! Name !! Size !! Type !! Notes
! Offset
! Name
! Size
! Type
! Notes
|-
! rowspan="19" | Header
|-
| 0x00 || Magic || 4 || char[4] ||"NPD\0" (4E 50 44 00)
|-
| 0x04 || Version || 4 || uint32_t || ex: 1, 2, 3, 4. See [[#Footer]] for the precise packager version.
|-
| 0x08 || [[DRM Type]] || 4 || uint32_t || For PS2 EDAT, PS3 FW requires it to be with activation (also a.k.a. Paid content paired with your individual data) for [[PKG_files#Misc.2FNote|PS1 PKG]], PS3 FW 4.00 introduced some changes for installing them with regard to the EDAT DRM type.
|-
| 0x0C || [[App Types|Application Type]] || 4 || uint32_t ||
|-
| 0x10 || [[PARAM.SFO#CONTENT_ID|CONTENT ID]] || 0x30 || uint8_t[0x30] || Content ID (with padding to fit 48 bytes)
|-
| 0x40 || Digest || 0x10 || uint8[0x10] || QA digest (seems like to be a SHA-1 hash of the non-finalized file): hash of the original data which is unknown until the whole file is read, so it cannot be used as a check, however it can be used as watermark or zeroed on forged file.
|-
| 0x50 || NPD CID-FN Hash || 0x10 || uint8_t[0x10] || CID-FN hash. AES-CMAC hash of concatenation of Content ID (48 bytes) and EDAT file name (eg MINIS.EDAT) using the third [[Keys#NPDRM_OMAC_Keys|NPDRM OMAC key]] as AES-CMAC key. Example: aes_cmac(55 50 30 35 37 36 2D 4E 50 55 5A 30 30 31 34 39 5F 30 30 2D 56 41 4E 47 55 41 52 44 32 30 30 30 30 30 30 31 00 00 00 00 00 00 00 00 00 00 00 00 4D 49 4E 49 53 2E 45 44 41 54, npd_cid_fn_hash_omac_key).
|-
| 0x60 || NPD Header hash || 0x10 || uint8_t[0x10] || Header hash. AES CMAC hash of the 0x60 bytes from the beginning of the file using (klicensee XOR [[Keys#NPDRM_OMAC_Keys|second NPDRM OMAC key]] as AES-CMAC key.
|-
|-
! rowspan="10" | Header
| 0x70 || Activation time || 8 || ?64-bit time or 32-bit padding? || Start of the validity period, filled with 00 if not used.
|-
|-
| 0x0 || NPD || 0x80 || PS3_NPD || See [[NPD]].
| 0x78 || Expiration time || 8 || ?64-bit time or 32-bit padding? || End of the validity period, filled with 00 if not used.
|-
|-
| 0x80 || Type || 1 || ?uint8_t? || (separated from Metadata type for wiki format)
| 0x80 || NPD type || 1 || ?uint8_t? || (separated from Metadata type for wiki format)
*00: EDAT
*00: Finalized EDAT
*01: SDAT
*01: Finalized SDAT
*80: Non Finalized (unsigned)
*80: Non Finalized EDAT
*81: Non Finalized SDAT
|-
|-
| 0x81 || Metadata type || 3 || ?uint8_t[3]? || (Outdated Flags description from talk page)
| 0x81 || Metadata type || 3 || ?uint8_t[3]? || (Outdated Flags description from talk page)
Line 39: Line 60:
*3C: Data/misc?
*3C: Data/misc?
|-
|-
| 0x84 || Block size || 4 || uint32_t || Default block size is 16 KB (0x4000 bytes). Max block size is 32 KB (0x8000 bytes). Working block sizes are: 1, 2, 4, 8, 16, 32 KB.
| 0x84 || Segment size || 4 || uint32_t || Default block is 16 KB (16384 bytes) = 0x4000, max is 0x8000.
|-
|-
| 0x88 || Data size || 8 || uint64_t || Decoded data size.
| 0x88 || Data size || 8 || uint64_t || Decoded data size.
|-
|-
| 0x90 || Metadata sections hash || 0x10 || uint8_t[0x10] ||  
| 0x90 || Meta data sections hash || 0x10 || uint8_t[0x10] ||  
|-
|-
| 0xA0 || Extended header hash || 0x10 || uint8_t[0x10] || AES-CMAC hash of 160 bytes from the beginning of EDAT file. It uses the hash key as AES-CMAC key and it depends on the file flags and keys. ?What does this mean, see make_npdata by Hykem?
| 0xA0 || Extended header hash || 0x10 || uint8_t[0x10] || AES-CMAC hash of 160 bytes from the beginning of file. It uses the hash key as AES-CMAC key and it depends on the file flags and keys. ?What does this mean?
|-
|-
| 0xB0 || ECDSA Metadata signature || 0x28 || uint8_t[0x28] || ECDSA curve type is vsh type 2. ECDSA public key is vsh public key (to check). It can be zeroed on forged file.
| 0xB0 || ECDSA Metadata signature || 0x28 || uint8_t[0x28] || Can be zeroed on forged file. curve_type is vsh type 0x02, pub is vsh public key,
|-
|-
| 0xD8 || ECDSA Header signature || 0x28) || uint8_t[0x28] || ECDSA curve type is vsh type 2. ECDSA public key is vsh public key (to check). Enabled (only?) for PS2 classic contents: all PS3 CFWs are patched to skip the ECDSA signature check. It can be zeroed on forged file.
| 0xD8 || ECDSA Header signature || 0x28) || uint8_t[0x28] || Enabled (only?) for PS2 classic: all PS3 CFWs are patched to skip the ECDSA check. Can be zeroed on forged file. curve_type is vsh type 2, pub is vsh public key.
|-
|-
! colspan=6 |       
! colspan=6 |       
Line 55: Line 76:
! rowspan="3" | Body
! rowspan="3" | Body
|-
|-
| 0x100 || Encrypted file || Variable || uint8_t[variable] || The file is encrypted using AES128CBC.
| 0x100 || Encrypted file || Variable || uint8_t[variable] || The file is encrypted using an AES algorithm in CBC mode.
|-
|-
| 0x** || Padding || Variable || uint8_t[variable] || Aligned on ?? bytes.
| 0x** || Padding || Variable || uint8_t[variable] || Aligned on ?? bytes.
Line 74: Line 95:
*Version 2: "2.4.0.L "
*Version 2: "2.4.0.L "
*Version 2: "2.4.0.W "
*Version 2: "2.4.0.W "
*Version 2: "2.7.0.W "
*Version 2: "2.7.0.L "
*Version 2: "2.7.0.L "
*Version 3: "3.1.0.W "
*Version 3: "3.1.0.W "
Line 84: Line 104:
| Padding || 2 || 00 00
| Padding || 2 || 00 00
|}
|}
The footer is plaintext. It seems that the footer is not present in some EDAT files version 1 (e.g. in some Ridge Racer 7 additional contents) although it should theoretically be present with version = "packager".


= EDAT Versions =
= EDAT Versions =


There are 4 PS3 EDAT (and NPD) format major versions:
There are 4 PS3 EDAT format major versions:
* 1: compatible with SDK 2.1x or older. Supported since at least PS3 System Software version 1.01.
* 1: compatible with SDK 2.1x or older
* 2: compatible with SDK 3.0x or older
* 2: compatible with SDK 3.0x or older
* 3: compatible with SDK 3.7x or older
* 3: compatible with SDK 3.7x or older
* 4: compatible with SDK ?.?? or older. Supported since certainly some 4.0x System Software version.
* 4: compatible with SDK ?.?? or older. Certainly supported since some 4.0x FW.


= EDAT Extraction =
= EDAT Decryption =


EDAT decryption, and complete verification, requires Klicensee. See [[NPDRM]].
EDAT decryption requires a key, the licensee key or klicensee. Depending on the DRM type, klicensee is got in different ways:
 
* DRM type Network: klicensee is generated using rif + ?to detail?
= EDAT Generation =
* DRM type Local: klicensee is generated using act.dat + associated rif + console's IDPS
 
* DRM type Free: klicensee is the constant PS3 Free klicensee (see NPDRM [[Keys]] and appldr keys)
To document.


= Tools =
= Tools =
Line 110: Line 127:


Found in SCE PS3 SDK 1.92.
Found in SCE PS3 SDK 1.92.
=== make_edata_npdrm version 2.7.0.W ===
make_edata_npdrm version 2.7.0.W (2009-08-18)
Found in SCE PS3 SDK 3.00.
=== make_edata_npdrm version 3.3.0.W ===
make_edata_npdrm version 3.3.0.W (2011-03-04)
Found in SCE PS3 SDK 3.60.


=== make_edata_npdrm version 4.0.0.W ===
=== make_edata_npdrm version 4.0.0.W ===


make_edata_npdrm version 4.0.0.W (?date?)
make_edata_npdrm version 4.0.0.W (2009-02-15)


Found in SCE PS3 SDK 4.75.
Found in SCE PS3 SDK ?4.00?


<pre>
<pre>
Line 155: Line 160:
== Unofficial tools ==
== Unofficial tools ==


=== make_npdata by Hykem ===
make_npdata by Hykem
 
* [https://github.com/ErikPshat/make_npdata-hykem make_npdata by Hykem]


=== True Ancestor EDAT Rebuilder by JjKkYu ===
True Ancestor EDAT...


To document.


{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
{{File Formats}}<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)