PlayStation archive (PSARC): Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
Line 479: Line 479:
|-
|-
|  {{icon content ps3}} || || God of War. Ascension || GAME.PSARC<BR />(or all others ?) || 00010004 || zlib || 0000001E || 00010000 || 00000002 || created with:  --absolute (game settings)
|  {{icon content ps3}} || || God of War. Ascension || GAME.PSARC<BR />(or all others ?) || 00010004 || zlib || 0000001E || 00010000 || 00000002 || created with:  --absolute (game settings)
|-
|  {{icon content ps3}} || || God of War III ||  || || || || || ||
|-
|-
|  {{icon content ps3}} || || ICO & Shadow of the Colossus Classics HD ||  || ||  ||  ||  ||  ||  
|  {{icon content ps3}} || || ICO & Shadow of the Colossus Classics HD ||  || ||  ||  ||  ||  ||  
Line 505: Line 507:
|-
|-
|  {{icon content ps3}} || || Warhawk || ? ||  ||  ||  ||  ||  ||  
|  {{icon content ps3}} || || Warhawk || ? ||  ||  ||  ||  ||  ||  
|-
|  {{icon content ps3}} || || Wipeout HD Fury || All || 00010003 || zlib || 0000001E || 00010000 || 00000003 ||
|-
|-
|  {{icon content ps4}} || || VidZone || ? || 00010004 || zlib || 0000001E || 00010000 || 00000000 ||  
|  {{icon content ps4}} || || VidZone || ? || 00010004 || zlib || 0000001E || 00010000 || 00000000 ||  
Line 514: Line 518:


*Other games that probably uses PSARC's
*Other games that probably uses PSARC's
**Uncharted 1?, and 3?
**Uncharted 1?
**Killzone colletion ?
**Killzone colletion ?
**God of War. III ?
**God of War. Collection ?
**God of War. Collection ?
**other Motorstorms ?
**other Motorstorms ?

Revision as of 15:35, 22 August 2014

Description

PlayStation ARChive is a container that allows subfolders and per-file compression using Zlib or lzma with 9 compression levels

  • Notes:
    • lzma with compression level 9 has a compression ratio of around 50% of the size for general files
    • some files doesnt admits much compression like .BIK videos (max compression ratio for .BIK doesnt reachs 1% or 2%). For this reason is better to dont use compression with videos because the size reduction is ridiculous

Structure

See Discussion page

Header

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  ................
Offset Size Name Example Value (conversion) Notes
PSARC 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
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 Absolute paths Default is 0. See table below

PSARC Archive Flags are stored in the header as a big endian number, and defines the characteristics and structure of the archive when it was created

PSARC Archive Flags
Hexadecimal
(big endian)
Decimal Binary
(flags)
Flag Name Notes
00 00 00 00 0 00000000 00000000 00000000 00000000 relative archive paths (no slash character at the start of every line) default value when using command line or xml
00 00 00 01 1 00000000 00000000 00000000 00000001 ignorecase archive paths (all characters in capitals) same than --ignorecase in command line and ignorecase="true" in the xml
00 00 00 02 2 00000000 00000000 00000000 00000010 absolute archive paths (slash character added at the start of every line) same than --absolute in command line and absolute="true" in xml

TOC Table

Blocks info table

File table

The compression is applyed "per-block", is posible to know the compression level by looking at the zlib header

Zlib Header (more info here and here)
byte index bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 bit 1 bit 0
[0] CMF Compression info
  • 7 = indicates a 32K window size
Compression method
  • 8 = denotes the "deflate" compression
[1] FLG FLEVEL
  • 0 - compressor used fastest algorithm
  • 1 - compressor used fast algorithm
  • 2 - compressor used default algorithm
  • 3 - compressor used maximum compression, slowest algorithm
FDICT

(Preset dictionary)

If set, a DICT dictionary identifier is present
immediately after the FLG byte. The dictionary is a sequence of
bytes which are initially fed to the compressor without
producing any compressed output. DICT is the Adler-32 checksum
of this sequence of bytes (see the definition of ADLER32
below).  The decompressor can use this identifier to determine
which dictionary has been used by the compressor.
FCHECK
value must be such that CMF and FLG, when viewed as
a 16-bit unsigned integer stored in MSB order (CMF *256 + FLG),
is a multiple of 31.

PSARC Tools

There are several versions of PSARC related tools, features has been implemented along the different versions and is hard to keep a record of them, please help filling the info in the page

GUI versions are derivated from the command line versions

Command line versions

Open PSARC PS3 Extractor

By Matthieu Milan. It allows you to extract PSARC archive data in linux

Source code: https://www.ferb.fr/ps3/PSARC/

PSARC tool

Port of Matthieu Milan's open PSARC PS3 extractor to Windows. Tool written by Matthieu Milan (@usineur). Ported to VS2012 by AlexAltea.

source code: https://github.com/AlexAltea/psarc-tool

Usage:
 psarc [option] filename

Options:
 -l                Create a text file that lists the file id, size, and name of every file in the archive.
 -x                Extracts all files.
 -e START END      Extracts files with the file id specified by the range between START and END (inclusive).

PSARC Extractor

By Insomniac @ xentax forums, download link: http://www.ps3hax.net/downloads.php?do=file&id=452 and http://www.modcontrol.com/Board/pc-tools/28869-psarc-ps3-extractor.html

Usage:
 PSARC [flag] <fileName>

Flags:
 -l             Creates a text file that lists the File ID, Size, and Name of every file in the archive.
 -e START END   Extracts files with the File ID specified by the range between START and END (inclusive). 
 <blank>        Extracts all files.
  • Examples:
    • Extract all files from data.psarc : PSARC data.psarc
    • Create list of files from data.psarc : PSARC -l data.psarc
    • Extract file with File ID 5 : PSARC -e 5 5 data.psarc
    • Extract files with File ID 7 through 12 : PSARC -e 7 12 data.psarc


The flag -l creates a .txt file with a list of all the contents of the archive, the info included is: File ID, File original size, and File path inside psarc archive

Example of a .txt file created with the -l flag:

ID       Size         Name
1      | 7,39 KB    | /my/files/dummies/dummy1.bin
2      | 8,80 KB    | /my/files/dummies/dummy2.bin
3      | 3,30 KB    | /my/files/dummies/dummy3.bin

PSARC

1.60.008 SDK : x
1.92.001 SDK : x
3.40.001 SDK : psarc-138.002 (C++), built on Feb 15 2010 at 16:17:41
3.41.001 SDK : psarc-138.002 (C++), built on Feb 15 2010 at 16:17:41
3.60.001 SDK : psarc-138.002 (C++), built on Feb 15 2010 at 16:17:41
3.70.001 SDK : psarc-138.002 (C++), built on Feb 15 2010 at 16:17:41
4.00.001 SDK : psarc-1310.001 (C++), built on Nov 16 2011 at 03:31:36
4.50.001 SDK : psarc-1310.001 (C++), built on Nov 16 2011 at 03:31:36

help

Type This
'''C:\Portables\psarc>psarc.exe --help'''
'''usage:'''
 psarc verb [options] [file...]
 psarc --xml=XMLFILE
 
'''verbs:'''
 create                                  Create an archive. (default)
 extract                                 Extract contents of an existing archive.
 list                                    List contents of an existing archive.
 dump                                    Print detailed info about archive for unit testing.
 verify                                  Verify an existing archive's structural integrity and ensure that all files can be decompressed.
 dtd                                     Display a DTD describing psarc's XML input syntax.

'''general options:'''
 -h, --help                              Show this help message and exit.
     --version                           Display version and exit.
 -d, --debug                             Debug: Show debug messages.
 -v, --verbose                           Verbose: Show additional progress. (default)
 -q, --quiet                             Quiet: Don't show any progress.
 -y, --overwrite                         Overwrite existing files when creating/extracting.
 --xml=XMLFILE                           XML list of actions to perform.

'''create options:'''
 -oFILE, --output=FILE                   Archive filename to create.
 -IINPUTFILE, --inputfile=INPUTFILE      Inputfile listing files to archive. Consider --xml instead, which gives you more control.
 -m, --mself                             Create a PSARC-MSELF hybrid file for PS3, which can contain encrypted special files like SDATA, SPRX, and SPU SELF.
 --zlib                                  Use Zlib when compressing. (default)
 --lzma                                  Use LZMA when compressing. (usually for PS3 PSN)
 --level=N                               Compression quality. 1 is fastest, 9 is best. (default = 9)
 -N, --nocompress                        Store all files uncompressed in the archive.
 -bBS, --blocksize=BS                    Use blocks of size BS. (default = 64KiB)
 -jJOBS, --jobs=JOBS                     Compression threads to run at a time. (default = number of CPUs)
 -sREGEX, --strip=REGEX                  Perl-compatible regex specifying a prefix to strip from the pathnames stored in the archive. This may be specified more than once. (default = current dir)
 -S, --strip-all                         Strip all paths from files stored in the archive.
 -a, --absolute                          Make the paths within the archive absolute.
 -R, --relative                          Make the paths within the archive relative. (default)
 -i, --ignorecase                        Make the archive directory case-insensitive.
 --exclude=WILDCARD                      Wildcard specifying files to exclude.
 --skip-missing-files                    If set then ignore it when a file cannot be found.
 --mergedups                             Compare the content of all files, and merge identical files so that only one copy of the data is included.

'''extract options:'''
 --input=FILE                            Archive to extract files from. (default is first file argument)
 --to=DIRECTORY                          Directory to write extracted files to. (default is current directory)

verify

Type This
'''C:\Portables\psarc>psarc.exe verify c:\psarctests\custom_folders.psarc'''
Verifying c:\psarctests\custom_folders.psarc
Validating 1: Folder1/Image1.bmp (6220854 bytes)
Validating 2: Folder2/Folder21/Image21.png (6142 bytes)
Validating 3: Folder3/Folder31/Folder311/Image311.jpg (12524 bytes)
Archive OK
verify output per-file
Validating <file ID/number>: file path inside psarc archive (file original size in bytes)

list

Type This
'''C:\Portables\psarc>psarc.exe list c:\psarctests\custom_folders.psarc'''
Listing c:\psarctests\custom_folders.psarc
Folder1/Image1.bmp (6220854/6220854 100%)
Folder2/Folder21/Image21.png (157/6142 2%)
Folder3/Folder31/Folder311/Image311.jpg (209/12524 1%)
list output per-file
file path inside psarc archive (file compressed size file original size compression percentage)
  • Notes:
    • In the compression percentage: 100% is no reduction, 0% is a huge reduction
Tip
Is posible to generate a text file containing the output of the list command by using the > arrow and the path/name of the destination file, this is usefull to convert the generated file to a filelist.txt or an automated.xml for rebuilding the psarc archive later
Type This
'''C:\Portables\psarc>psarc.exe list c:\psarctests\custom_folders.psarc > c:\psarctests\custom_folders_file_output.txt'''

There is no output in the command line, instead the file c:\psarctests\custom_folders_file_output.txt is created containing:

Listing c:\psarctests\custom_folders.psarc
Folder1/Image1.bmp (6220854/6220854 100%)
Folder2/Folder21/Image21.png (157/6142 2%)
Folder3/Folder31/Folder311/Image311.jpg (209/12524 1%)

dump

Type This
'''C:\Portables\psarc>psarc.exe dump c:\psarctests\custom_folders.psarc'''
Dumping c:\psarctests\custom_folders.psarc
Folder1/Image1.bmp  os=6220854 cs=6220854 fb=2
Folder2/Folder21/Image21.png  os=6142 cs=157 fb=97
Folder3/Folder31/Folder311/Image311.jpg  os=12524 cs=209 fb=98
dump output per-file
file path inside psarc archive file original size file compressed size file block start offset ?

dtd

The output of this command is a layout that defines the structure of an .xml document. See: http://www.w3schools.com/DTD/

Type This
'''C:\Portables\psarc>psarc.exe dtd'''
<!ELEMENT psarc (create|extract)+>

<!ELEMENT create (compression|strip|exclude|file|directory|filelist)+>
<!ATTLIST create archive CDATA #IMPLIED
                 absolute (true|false) "false"
                 ignorecase (true|false) "false"
                 mergedups (true|false) "false"
                 stripall (true|false) "false"
                 blocksize CDATA "65536"
                 jobs CDATA #IMPLIED
                 skipmissingfiles (true|false) "false"
                 format (psarc|psarc-mself) "psarc"
                 overwrite (true|false) "false">

<!ELEMENT compression EMPTY>
<!ATTLIST compression type (zlib|lzma) "zlib"
                      level (1|2|3|4|5|6|7|8|9) "9"
                      enabled (true|false) "true">

<!ELEMENT strip EMPTY>
<!ATTLIST strip regex CDATA #REQUIRED>

<!ELEMENT exclude EMPTY>
<!ATTLIST exclude regex CDATA #IMPLIED
                  wildcard CDATA #IMPLIED>

<!ELEMENT file (CDATA)>
<!ATTLIST file wildcard CDATA #IMPLIED
               regex CDATA #IMPLIED
               path CDATA #IMPLIED
               archivepath CDATA #IMPLIED
               fromarchive CDATA #IMPLIED
               compressed (true|false) #IMPLIED
               skipifmissing (true|false) #IMPLIED>

<!ELEMENT filelist EMPTY>
<!ATTLIST filelist path CDATA #REQUIRED>

<!ELEMENT directory EMPTY>
<!ATTLIST directory path CDATA #REQUIRED
                    archivepath CDATA #IMPLIED
                    fromarchive CDATA #IMPLIED
                    compressed (true|false) #IMPLIED
                    skipifmissing (true|false) #IMPLIED>

<!ELEMENT extract (file)+>
<!ATTLIST extract archive CDATA #IMPLIED
                  input CDATA #IMPLIED
                  to CDATA #IMPLIED
                  stripall (true|false) "false"
                  skipmissingfiles (true|false) "false"
                  overwrite (true|false) "false">
  • DTD Notes:
    • Elements are defined in the DTD as: <!ELEMENT element-name (element-content)>
    • Attributes are defined in the DTD as: <!ATTLIST element-name attribute-name attribute-type attribute-value>
    • Elements that contains childrens elements that can be repeated several times are defined with a +
    • Character strings attribute data types are defined with: CDATA
    • Required attributes are defined with: #REQUIRED, and optional attributes with: #IMPLIED

Based in the DTD layout is posible to create an .xml layout that automatizes all the actions of the tool, this example is a generic layout containing all the elements and attributes availables together

Code Sample
  • XML Notes:
    • The purpose of this XML is to use it as a base layout containing all, but is not posible to use it like that, is needed to delete the tags that are not needed for a specific case, the ones that are incompatibles with other tags, and is needed to add paths, etc...
    • Some attributes appears as common in the DTD for "create" and "extract" but are not common, some of them has been deleted to avoid mistakes... but probably is needed to delete some more
    • Is posible to generate this kind of .xml by using as the source the output of the "list" command after applying over it some character strings replacing using regular expressions with a tool like http://findandreplace.codeplex.com/#

extract

The required options are --input (the source .psarc) and --to (the target folder where contents will be extracted). The example command extracts all files from the .psarc to a directory with full directory tree names, no skipped missing files, no overwrite

Type This
'''C:\Portables\psarc>psarc.exe extract --input=c:\psarctests\custom_folders.psarc --to=c:\psarctests\custom_folders_extracted'''
Extracting: Folder1/Image1.bmp (6220854 bytes)
Extracting: Folder2/Folder21/Image21.png (6142 bytes)
Extracting: Folder3/Folder31/Folder311/Image311.jpg (12524 bytes)
  • There are 3 optional available attributes for extract:
    • --overwrite (if the files existed in the extraction folder they will be overwritten without advise)
    • --strip-all (extracts all files in the root of the target folder, incase of several extracted files with the same name the program will return an error, this can be solved by using the command --overwrite)
    • --skip-missing-files (seems pointless, mostly to extract files from malformed .psarcs or .psarcs that doesnt passes the "verify" command ?)

When using this options the command line output is the same than in the example above, there is no mention of wich files are stripped, overwritten, or missing in the extraction process, usage example:

Type This
'''C:\Portables\psarc>psarc.exe extract --overwrite --strip-all --skip-missing-files --input=c:\psarctests\custom_folders.psarc --to=c:\psarctests\custom_folders_extracted'''
Extracting: Folder1/Image1.bmp (6220854 bytes)
Extracting: Folder2/Folder21/Image21.png (6142 bytes)
Extracting: Folder3/Folder31/Folder311/Image311.jpg (12524 bytes)

create

Ther are 3 different ways to create a psarc archive (by directory, by filelist, or by file). By directory creates the psarc using the contents of a specifyed folder and all subfolders, all them ordered alphabetically (windows style), this method cant be used to rebuild psarcs where every file needs to be assigned with an specific ID (and im not sure if is available in command line). By file means every path of every file in the PC is needed to be specifyed and this is not posible in command line when the archive has lot of files (for a single file is fine, but when are thousand of files is a no way). For this reason the only method explained here is by filelist

The filelist is a plain .txt file where every file is defined by a single line, composed by his path, filename, and file extension, 1 line per file, in any order (not needed to be ordered alphabetically). Is posible to generate this kind of filelists automatically by using the output of the --list command and some regular expressions to replace characters (this is long explain and doesnt fits here by now)

As explained before, the examples used here in wiki uses full PC paths to be more flexible (no need to place psarc.exe next to the source folder, actually you can place psarc.exe in c:\ the source folder in d:\ and create the psarc in x:\). When using full paths is mandatory to use the --strip option with an explicit path or a regular expression (regex) to remove part of the PC path (e.g: if you strip psarctests\custom_folders_extracted\ from c:\psarctests\custom_folders_extracted\Folder1\Image1.bmp the resulting path of the file inside the archive will be Folder1\Image1.bmp)

In the next example the filelist is in c:\psarctests\custom_folders_filelist.txt and contains the PC paths of the files that will be included inside the psarc archive:

C:\psarctests\custom_folders_extracted\Folder1\Image1.bmp
C:\psarctests\custom_folders_extracted\Folder2\Folder21\Image21.png
C:\psarctests\custom_folders_extracted\Folder3\Folder31\Folder311\Image311.jpg

The psarc archive is created by using the filelist as the --inputfile and uses an explicit path to --strip from every file inside the filelist

Type This
'''C:\Portables\psarc>psarc.exe create --strip=C:\psarctests\custom_folders_extracted\ --output=c:\psarctests\custom_folders.psarc --inputfile=c:\psarctests\custom_folders_filelist.txt'''
Strip: c:\psarctests\custom_folders_extracted
Flags: relative
NumJobs: 2
InputFile: c:\psarctests\custom_folders_filelist.txt
Output: c:\psarctests\custom_folders.psarc
Compression: zlib level 9
Archiving C:/psarctests/custom_folders_extracted/Folder1/Image1.bmp
Archiving C:/psarctests/custom_folders_extracted/Folder2/Folder21/Image21.png
Archiving C:/psarctests/custom_folders_extracted/Folder3/Folder31/Folder311/Image311.jpg
Compressing TOC
Compressing C:\psarctests\custom_folders_extracted\Folder1\Image1.bmp
Compressing C:\psarctests\custom_folders_extracted\Folder2\Folder21\Image21.png
Compressing C:\psarctests\custom_folders_extracted\Folder3\Folder31\Folder311\Image311.jpg

           3: Total Files Archived
     6239520: Original Size
          87: Manifest (uncompressed)
          57: Manifest (compressed)
         348: TOC size
        8789: Final Size
        4.0%: Directory Overhead
       99.9%: Compression Ratio
           9: Compression Level
  • Notes:
    • The program replaces the windows slash "\" by "/" when archiving the files (note the difference in the creation process between Archiving C:/... and Compressing C:\...). When making a --list command over the created psarc the slashes will appear as "/" because this is how they was archived in the Manifest (manifest is the first file inside the psarc filetable, doesnt appears as a file when using the --list command and doesnt have an assigned ID)
    • --strip option removes part of the paths from the filelist, can be used several times with different stripped paths, this is usefull when the psarc archive is generated from a filelist that contains paths from different folders and/or devices in the PC (e.g: is posible to create a filelist including a file from F:\textures\packed\texture1.jpg and another file from G:\models\packed\model1.xxx and strip the paths: F:\textures\ and G:\models\, this way both files will be stored inside the psarc archive together under path: packed/texture1.jpg and packed/model1.xxx)

xml

To use an .xml is needed to prepare it before using psarc.exe, using an xml is the most flexible way to use psarc.exe because allows to place the source (files to create, or psarc to extract), target (files to create, or psarc to extract), and psarc.exe in any path of the PC, it allows the usage of a filelist.txt (that defines all files inside the archive), create psarcs based in a directory, or specify all the files inside the xml, also to specify the compression level for every file (needed for video or audio files that doesnt admits compression), etc...

Is also the most complicated method because is needed to specify full PC paths inside the xml, and when creating is needed to specify regular expressions to strip part of the PC path

When the xml is ready you can run it this way:

Type This
'''C:\Portables\psarc>psarc.exe --xml=c:\psarctests\extract_custom_folders.xml'''

The options --verbose, --debug, and --quiet cant be used inside the xml, so if needed are specifyed in the command line, this way:

Type This
'''C:\Portables\psarc>psarc.exe --debug --xml=c:\psarctests\create_custom_folders.xml'''
xml extract

Extracting all files

Code Sample

Extracting a single file

Code Sample

When extracting single files is also posible to use the same attributes availables in command line, and attributes per-file, but they uses different names inside the xml (see the DTD example)

Code Sample
  • Notes about the xml examples above:
    • The element "extract" uses the attribute archive but could be replaced by input, in this case are exactly the same and both will work, actually --input is the same option used in comand line but the examples in wiki uses the name archive because is more intuitive (is also used as an attribute for "create" and in both cases is refered to the compressed archive.psarc). Both (archive and input) appears in the DTD as optional (#IMPLIED) but only one of them can be used in the xml
    • The element "file" uses the attribute archivepath but could be replaced by path, in this case are exactly the same and both will work, but the examples in wiki uses the name archivepath because is more intuitive (is refered to the path of a file inside archive.psarc). Both (archivepath and path) appears in the DTD as optional (#IMPLIED) but only one of them can be used in the xml
    • To identify the paths inside the psarc archive use --list option in command line. By default the paths inside the psarc are relative (path names starts with the name of the folder) but in some cases the paths starts with a slash"/" (when the psarc has been created with absolute flag), in this case the slash needs to be specifyed as part of the path here (e.g: archivepath="Folder1/Image1.bmp" is a relative path, and archivepath="/Folder1/Image1.bmp" is an absolute path)
xml create

Total Commander plugin

http://www.totalcmd.net/plugring/PSARC.html

GUI versions

PS3 PSARC GUI

It's a graphical user interface to view, extract or create psarc archives. GUI written by aldo, unknown psarc tool used internally

Download link: http://aldostools.org/ps3_psarc_gui.rar

Related Tools

When rebuilding a psarc is needed to preserve the original positions of all the files inside the archive (because every file in the original psarc has assigned an ID number, and after rebuilding this numbers must match with the original positions). for this same reason when rebuilding is not a good idea to remove files (because the other files that comes after will be displaced). When the purpose of the rebuild is to reduce the sze (by removing languages, etc...) the method consists in replacing them by dummies (0kb files), this dummies preserves the positions of all the files

To be sure all the files are in the correct positions can be used as a base file (to edit later) the output of the list command as explained before

This edition of the file generated by the list command can be automated completly (not needed to edit a single character by hand). Is posible to generate a filelist.txt or an automated.xml by replacing/erasing/adding characters with other programs that identifies and replaces characters by using regular expressions, the examples used here are commands for fnr.exe (find and replace tool) and contains regular expressions (to search) and a character string (to replace)

  • The file paths inside filelist.txt or inside an automated.xml admits 2 formats:
    • full PC paths (where the full PC file path included the device letter is used by psarc.exe to locate the file in any device and/or any folder). This method is the most flexible but needs an strip command to remove part of the PC path when creating the psarc archive
    • relative to work directory paths (where work directory is the path to psarc.exe and the files needs to be placed in a subfolder under it). This method needs to copy psarc.exe to the parent folder of the files

Generating a filelist with regular expressions

Generating an xml with regular expressions

Games or Apps using PSARC files

Game/App information PSARC Header info Notes
Platform TITLE_ID TITLE PSARC files Version
(offset 0x04)
Compression
(offset 0x08)
TOC entry size
(offset 0x10)
Block Size
(offset 0x18)
Flags
(offset 0x1C)
PS3 icon Ape Escape sound.psarc 00010004 zlib 0000001E 00010000 00000000
PS3 icon Ape Escape target.psarc
<language>.psarc
00010004 zlib 0000001E 00010000 00000002 created with: --absolute ?
PS3 icon Atelier Rorona Plus ? 00010004 zlib 0000001E 00010000 00000002
PS3 icon Eiyuu Densetsu Sen no Kiseki ?
PS3 icon God of War. Ascension CRTN.PSARC
CYN.PSARC
FURY.PSARC
HECA.PSARC
HRTN.PSARC
LAN.PSARC
PHI.PSARC
STAT.PSARC
STINT.PSARC
TEM.PSARC
game levels
PS3 icon God of War. Ascension <LANGUAGE>.PSARC localized languages audio files
PS3 icon God of War. Ascension INTROCIN.PSARC
RESOURCES.PSARC
SHELL.PSARC
TPPS.PSARC
Intro video
Game engine
Main menu
Game updates stub (dummy file)
PS3 icon God of War. Ascension GAME.PSARC
(or all others ?)
00010004 zlib 0000001E 00010000 00000002 created with: --absolute (game settings)
PS3 icon God of War III
PS3 icon ICO & Shadow of the Colossus Classics HD
PS3 icon Killzone 3 data_ps3.psarc 00010004 zlib 0000001E 00010000 00000001 created from 3 working directories, lot of duplicated files
PS3 icon Mass Effect 3 AUDIO.PSARC 00010004 lzma 0000001E 00010000 00000003 created with: --lzma --nocompress --absolute --ignorecase
PS3 icon Mass Effect 3 MAIN.PSARC 00010004 lzma 0000001E 00010000 00000003 created with: --lzma --absolute --ignorecase (uses per-file compression, see notes below)
PS3 icon Mass Effect 3 TEXTURES.PSARC
PS3 icon Motorstorm. Pacific Rift ?
PS3 icon Ni No Kuni bd03.adat ?
hd01.adat ?
hd05<language>.adat ?
.psarc file extensions renamed to .adat
PS3 icon Ninja Gaiden 3 Razors Edge
PS3 icon The Last Of Us All ? 00010003 zlib 0000001E 00010000 00000000 the game can load files from decompressed psarcs (because the original psarcs doesnt uses flags)
PS3 icon Time and Eternity
PS3 icon Uncharted 2 All ? 00010003 zlib 0000001E 00010000 00000000 the game can load files from decompressed psarcs (because the original psarcs doesnt uses flags)
PS3 icon Uncharted 3 All 00010003 zlib 0000001E 00010000 00000000
PS3 icon Warhawk ?
PS3 icon Wipeout HD Fury All 00010003 zlib 0000001E 00010000 00000003
PS4 icon VidZone ? 00010004 zlib 0000001E 00010000 00000000
  • Special rebuild notes:
    • Mass effect 3 MAIN.PSARC contains a group of generic files compressed with level 9, and another group of .TXT, .BIN, and .BIK videos not compressed at all. In the creation options suggested above in the table the compression level is not defined and this means all them will use the default compression level 9 (so the .BIK files will have a ridiculous 1% or 2% of compression ratio because is the max they will admit). This is not how the original file was created (but works), the correct way to rebuild it is by defining specific compression levels "per file" in a predefined .xml
    • Killzone 3 data_ps3.psarc (BCES01007 version) contains 8324 files (included 5.3GB of audio files for 21 languages with a compression of around 50%)... 2883 of all the files uses the same path/filenames repeated up to 3 times (because was created using 3 or more different working directories). This duplication of paths/filenames inside the .psarc in the practise means when doing a standard extraction 2833 files will be missing, overwrited, or they will give an error at extraction time, the correct way to mess with it is by doing several partiall extractions to different directories, and rebuild it by using a preconfigured .xml where the different paths for each file are specifyed, when rebuilding is also needed to use the --strip option several times to remove part of the paths from all the different working directories, this way the paths/filenames will be duplicated inside the .psarc archive (but are different files located at different positions and with a different ID number assigned).
  • Other games that probably uses PSARC's
    • Uncharted 1?
    • Killzone colletion ?
    • God of War. Collection ?
    • other Motorstorms ?