Trophy00.trp: Difference between revisions

From PS4 Developer wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 51: Line 51:
  Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
  Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
   
   
  00000000  {{arial color||yellow|0B 29 DE DE CB D5 62 61 C6 5C 75 24 9B 0C A4 08}} .)ÞÞËÕbaÆ\u$›.¤.
  00000000  0B 29 DE DE CB D5 62 61 C6 5C 75 24 9B 0C A4 08  .)ÞÞËÕbaÆ\u$›.¤.
  00000010  0E 40 AE C1 7C 92 1F 1E 6D D7 B6 CC 59 2D DB B8  .@®Á|’..m׶ÌY-Û¸
  00000010  0E 40 AE C1 7C 92 1F 1E 6D D7 B6 CC 59 2D DB B8  .@®Á|’..m׶ÌY-Û¸
  00000020  5C 26 E7 9E 3F F6 54 9E A2 E4 94 2F 58 7F D6 9D  \&çž?öTž¢ä”/X.Ö.
  00000020  5C 26 E7 9E 3F F6 54 9E A2 E4 94 2F 58 7F D6 9D  \&çž?öTž¢ä”/X.Ö.
Line 57: Line 57:


ESFM is just an encrypted XML format. It consists of IV of 0x10 bytes and the data itself. A key is generated by encrypting '''NP communication ID''' with keygen ERK/keygen IV using AES-CBC-128. Then you can decrypt data using this key and IV from the header.
ESFM is just an encrypted XML format. It consists of IV of 0x10 bytes and the data itself. A key is generated by encrypting '''NP communication ID''' with keygen ERK/keygen IV using AES-CBC-128. Then you can decrypt data using this key and IV from the header.
ESFM IV: 0x0 - 0x10 ?
KeyGen ERK: 0x10 - 0x30 ?
KeyGen IV: 0x30 - 0x40 ?


That's all so far
That's all so far

Revision as of 18:29, 16 March 2014

Background

This is used for storage of trophy packs, simular to PS3

PS3 side references

Structure

Note: This isn't complete.

typedef unsigned char u8;
typedef unsigned long int u32;
typedef unsigned long long int u64;
typedef struct{
	u32 magic; //Ü¢M.
	u32 version; //#3 on ps4
	u64 fileSize; //size of full trp file
	u32 entryCount; //num entries
	u32 entrySize; // size of entry
	u32 unk1; //padding probably
	u8 hash[20]; //sha1 hash
	u32 unk2; // 0x30313000 ??
	u8 padding[0x2C];
} header_t
typedef struct{
	signed char name[0x20];
	u64 entryStart; //relative to &buffer
	u64 entryLength;
	u32 unk1; //3 on some, 0 on others, could be flags or an enum to determine if encrypted or not?
	u8 unk2[0xC];
} entry_t;

Image of Header + Entries: http://puu.sh/7uOAN/1c17920d61.png

Image of Encrypted Entry Data: http://puu.sh/7uOEl/6eb00e8a19.png

Entries

So far (from what I've seen) there are only 2 types of entries.

ESFM which are encrypted, and PNG which are not encrypted.

PNG is plain image data

ESFM is encrypted but seems to contain the same bytes at the top.

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F

00000000  0B 29 DE DE CB D5 62 61 C6 5C 75 24 9B 0C A4 08  .)ÞÞËÕbaÆ\u$›.¤.
00000010  0E 40 AE C1 7C 92 1F 1E 6D D7 B6 CC 59 2D DB B8  .@®Á|’..m׶ÌY-Û¸
00000020  5C 26 E7 9E 3F F6 54 9E A2 E4 94 2F 58 7F D6 9D  \&çž?öTž¢ä”/X.Ö.
00000030  CD 96 49 16 B7 9D 1C F4 DE D9 A7 DD FB A0 1A 68  Í–I.·..ôÞÙ§Ýû .h

ESFM is just an encrypted XML format. It consists of IV of 0x10 bytes and the data itself. A key is generated by encrypting NP communication ID with keygen ERK/keygen IV using AES-CBC-128. Then you can decrypt data using this key and IV from the header.

ESFM IV: 0x0 - 0x10 ? KeyGen ERK: 0x10 - 0x30 ? KeyGen IV: 0x30 - 0x40 ?

That's all so far ~Jakes625

Edited By: Red-EyeX32