Editing Talk:PlayStation archive (PSARC)

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:
All the files and xml's from the examples in front page ready to practise and to use as layouts http://www.multiup.org/en/mirror/c5b18ca6d3b0c4a24ea3c753d6df7a76/psarctests.zip


==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"?>
<data>
  <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" /><!-- only valid for "max block size" == 2^16 -->
    </array>
  </struct>
</data>
PSARC header example:
'''Offset(h) 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F'''
00000000  <span style="background:#ff6666;">50 53 41 52</span> <span style="background:#66ff66;">00 01 00 04</span> <span style="background:#ffff66;">7A 6C 69 62</span> <span style="background:#6666ff;">00 01 23 BA</span>  PSAR....zlib..#º
00000010  <span style="background:#dd00dd;">00 00 00 1E</span> <span style="background:#dddd00;">00 00 09 16</span> <span style="background:#dddddd;">00 01 00 00</span> <span style="background:#d0000d;">00 00 00 02</span>  ................
00000020  <span style="background:#ff6666;">00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</span>  ................
00000030  <span style="background:#ff6666;">00 00 00 00 00 00</span> <span style="background:#66ff66;">01 79 D9 00</span> 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.ç¬
{| class="wikitable"
|-
! !! Offset !! Size !! Name !! Example !! Value (conversion) !! Notes
|-
|rowspan="8" style="background-color:#50534152; color:#000FFF;"|'''Header'''
| style="background-color:#ff6666;" | 0x00 || style="background-color:#ff6666;" | 0x04 || '''magic''' || 50 53 41 52 || PSAR || '''P'''lay'''S'''tation '''Ar'''chive
|-
| style="background-color:#66ff66;" | 0x04 || style="background-color:#66ff66;" | 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
|-
| style="background-color:#ffff66;" | 0x08 || style="background-color:#ffff66;" | 0x04 || '''compression type''' || 7A 6C 69 62 || zlib || zlib (default) or lzma
|-
| style="background-color:#6666ff;" | 0x0C || style="background-color:#6666ff;" | 0x04 || '''table of content length''' || 00 01 23 BA || 0x123BA ||
|-
| style="background-color:#dd00dd;" | 0x10 || style="background-color:#dd00dd;" | 0x04 || '''table of content entries size''' || 00 00 00 1E || 30 Bytes || Default is 30 bytes
|-
| style="background-color:#dddd00;" | 0x14 || style="background-color:#dddd00;" | 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
|-
| style="background-color:#dddddd;" | 0x18 || style="background-color:#dddddd;" | 0x04 || '''block size''' || 00 01 00 00 || 65536 Bytes || Default is 65536 Bytes
|-
| style="background-color:#d0000d;" | 0x1C || style="background-color:#d0000d;" | 0x04 || '''archive flags''' || 00 00 00 02 || 2 || Default is 2. Unknown yet but is a "bit value" so 2 is a single flag
*
*
|-
|rowspan="2" style="background-color:#50534152; color:#000FFF;"|'''TOC'''
| style="background-color:#ff6666;" | 0x20 || style="background-color:#ff6666;" | 0x16 || '''name digest''' || 00 00 ... 00 00  || - || 128-bit md5 hash
|-
| style="background-color:#66ff66;" | 0x36 || style="background-color:#66ff66;" | 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==
*http://findandreplace.codeplex.com/
*http://fart-it.sourceforge.net/
*http://textmechanic.com/Remove-Duplicate-Lines.html
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)