Talk:PlayStation archive (PSARC)

From PS3 Developer wiki
Revision as of 02:55, 20 March 2017 by Anonymous (Privacy policy) (Updated notes for table of contents length)
Jump to navigation Jump to search

MSELF create option

-m, --mself                             Create a PSARC-MSELF hybrid file for PS3, which can contain encrypted special files like SDATA, SPRX, and SPU SELF.

For rebuilding purposes is needed to verify if some of this files are present in the filelist

Compression levels

In command line --level=N

  • Notes
    • (default = 9)
    • when --level is not defined at creation time, the info about compression level in the creation process window appears with a value of 9, even when using --nocompress
Code Sample

PSARC structure notes

Debian psarc Kplugin structure. From Manuel Stahl (thymythos) @ http://opendesktop.org/content/show.php/PSARC+file+header?content=162745

<?xml version="1.0" encoding="UTF-8"?>

  <struct name="header">
    <primitive name="magic" type="UInt32" />
    <primitive name="version" type="UInt32" />
    <primitive name="compression" type="UInt32" />
    <primitive name="TOC length" type="UInt32" />
    <primitive name="TOC entry size" type="UInt32" />
    <primitive name="num_entries" type="UInt32" />
    <primitive name="max block size" type="UInt32" />
    <primitive name="archive flags" type="UInt32" />
    <array name="TOC" length="num_entries">
      <struct name="entry">
        <array name="MD5" length="16"><primitive type="UInt8"/></array>
        <primitive name="zIndex" type="UInt32" />
        <bitfield name="length" width="40" type="unsigned" />
        <bitfield name="offset" width="40" type="unsigned" />
      </struct>
    </array>
    <array name="block sizes" length="num_entries">
      <bitfield name="size" width="16" type="unsigned" />
    </array>
  </struct>

PSARC header example:

Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00000000  50 53 41 52 00 01 00 04 7A 6C 69 62 00 01 23 BA  PSAR....zlib..#º
00000010  00 00 00 1E 00 00 09 16 00 01 00 00 00 00 00 02  ................
00000020  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000030  00 00 00 00 00 00 01 79 D9 00 00 01 23 BA A9 A6  .......yÙ...#º©¦
00000040  AB EE E6 73 40 2A E6 C3 37 24 3F C1 81 16 00 00  «îæs@*æÃ7$?Á....
00000050  00 02 00 00 00 1D 90 00 00 01 45 3B 5A 08 E7 AC  ..........E;Z.ç¬
Offset Size Name Example Value (conversion) Notes
Header 0x00 0x04 magic 50 53 41 52 PSAR PlayStation Archive
0x04 0x04 version 00 01 00 04 v1.4 First 2 bytes is the main version, next 2 bytes is the subversion and are processed separatedlly, so 0001.0004 is "translated" to 1.4 by the system
0x08 0x04 compression type 7A 6C 69 62 zlib zlib (default) or lzma
0x0C 0x04 table of content length 00 01 23 BA 0x123BA Includes 32 byte header length + block length table following ToC
0x10 0x04 table of content entries size 00 00 00 1E 30 Bytes Default is 30 bytes
0x14 0x04 number of entries 00 00 09 16 1+2325 files The filecount includes the "file path/names definitions" as an additionall file always placed at first position in the list and without an assigned ID
0x18 0x04 block size 00 01 00 00 65536 Bytes Default is 65536 Bytes
0x1C 0x04 archive flags 00 00 00 02 2 Default is 2. Unknown yet but is a "bit value" so 2 is a single flag
TOC 0x20 0x16 name digest 00 00 ... 00 00 - 128-bit md5 hash
0x36 0x04 index list - - Size of the (compressed per default) index list.

Regular Expressions notes

Psarc uses regular expressions compatibles with PERL 5, most specifically the ones used by PCRE library http://www.pcre.org/ As can be seen in the license texts of the software used in PS3 in XMB/Settings/System Settings/About PlayStation®3 (PS3™)

Related tools and examples