Editing PlayStation archive (PSARC)
Jump to navigation
Jump to search
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 19: | Line 19: | ||
=Structure= | =Structure= | ||
See | See {{Talk}} page | ||
==Header== | ==Header== | ||
PSARC header example: | PSARC header example: | ||
Line 36: | Line 35: | ||
| style="background-color:#66ff66;" | 0x04 || style="background-color:#66ff66;" | 0x04 || '''version''' || 00 01 00 04 || v1.4 || First 2 bytes is the '''major version''', next 2 bytes is the '''minor version''' | | style="background-color:#66ff66;" | 0x04 || style="background-color:#66ff66;" | 0x04 || '''version''' || 00 01 00 04 || v1.4 || First 2 bytes is the '''major version''', next 2 bytes is the '''minor version''' | ||
|- | |- | ||
| style="background-color:#ffff66;" | 0x08 || style="background-color:#ffff66;" | 0x04 || ''' | | style="background-color:#ffff66;" | 0x08 || style="background-color:#ffff66;" | 0x04 || '''compression type''' || 7A 6C 69 62 || zlib || '''zlib''' (default)<br>'''lzma''' | ||
|- | |- | ||
| style="background-color:#6666ff;" | 0x0C || style="background-color:#6666ff;" | 0x04 || ''' | | style="background-color:#6666ff;" | 0x0C || style="background-color:#6666ff;" | 0x04 || '''toc length''' || 00 01 23 BA || 0x123BA || | ||
|- | |- | ||
| style="background-color:#dd00dd;" | 0x10 || style="background-color:#dd00dd;" | 0x04 || ''' | | style="background-color:#dd00dd;" | 0x10 || style="background-color:#dd00dd;" | 0x04 || '''toc entry size''' || 00 00 00 1E || 30 Bytes || Default is 30 bytes | ||
|- | |- | ||
| style="background-color:#dddd00;" | 0x14 || style="background-color:#dddd00;" | 0x04 || ''' | | style="background-color:#dddd00;" | 0x14 || style="background-color:#dddd00;" | 0x04 || '''toc entries''' || 00 00 09 16 || 1 manifest + 2325 files || The '''manifest''' is always included as the first file in the archive without an assigned ID | ||
|- | |- | ||
| style="background-color:#dddddd;" | 0x18 || style="background-color:#dddddd;" | 0x04 || ''' | | 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 || ''' | | style="background-color:#d0000d;" | 0x1C || style="background-color:#d0000d;" | 0x04 || '''archive flags''' || 00 00 00 02 || Absolute paths || 0 = '''relative''' paths (default)<br>1 = '''ignorecase''' paths<br>2 = '''absolute''' paths | ||
|} | |} | ||
Line 52: | Line 51: | ||
**Default value when the .psarc is created from command line or an .xml and no special access paths modes are specifyed | **Default value when the .psarc is created from command line or an .xml and no special access paths modes are specifyed | ||
**The paths in the '''manifest''' doesnt have an slash character at the start of every line, the system accesses the files exactly like if the .psarc was a folder itself | **The paths in the '''manifest''' doesnt have an slash character at the start of every line, the system accesses the files exactly like if the .psarc was a folder itself | ||
**In the games that uses .psarc's without flags (like ''uncharted'' series or ''the last of us'') is posible to replace the psarc by a folder with the same name of the psarc and his contents decompressed inside | **In the games that uses .psarc's without flags (like ''uncharted'' series or ''the last of us'') is posible to replace the psarc by a folder with the same name of the psarc and his contents decompressed inside | ||
Line 62: | Line 60: | ||
**Enabled by using the option '''--absolute''' in command line or '''absolute="true"''' in the .xml | **Enabled by using the option '''--absolute''' in command line or '''absolute="true"''' in the .xml | ||
**The paths in the '''manifest''' have an slash character at the start of every line, <!-- the .psarc contents are mounted directly in the root of the application space (under USRDIR)... this is hidden because is a bit speculative, im not so sure but this is what it looks --> | **The paths in the '''manifest''' have an slash character at the start of every line, <!-- the .psarc contents are mounted directly in the root of the application space (under USRDIR)... this is hidden because is a bit speculative, im not so sure but this is what it looks --> | ||
==TOC Table== | ==TOC Table== | ||
==Blocks info table== | ==Blocks info table== | ||
==File table== | ==File table== | ||
The compression is applyed "per-block", is posible to know the compression level by looking at the zlib header | The compression is applyed "per-block", is posible to know the compression level by looking at the zlib header | ||
=PSARC Tools= | =PSARC Tools= | ||
Line 118: | Line 73: | ||
GUI versions are derivated from the command line versions | GUI versions are derivated from the command line versions | ||
==Open PSARC PS3 Extractor== | ==Command line versions== | ||
===Open PSARC PS3 Extractor=== | |||
By Matthieu Milan. It allows you to extract PSARC archive data in linux | By Matthieu Milan. It allows you to extract PSARC archive data in linux | ||
Source code: https://www.ferb.fr/ps3/PSARC/ | Source code: https://www.ferb.fr/ps3/PSARC/ | ||
==PSARC tool== | ===PSARC tool=== | ||
Port of Matthieu Milan's open PSARC PS3 extractor to Windows. Tool written by Matthieu Milan (@usineur). Ported to VS2012 by AlexAltea. | Port of Matthieu Milan's open PSARC PS3 extractor to Windows. Tool written by Matthieu Milan (@usineur). Ported to VS2012 by AlexAltea. | ||
Line 136: | Line 92: | ||
-e START END Extracts files with the file id specified by the range between START and END (inclusive). | -e START END Extracts files with the file id specified by the range between START and END (inclusive). | ||
==PSARC Extractor== | ===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 | |||
By Insomniac @ xentax forums, download link: | |||
'''Usage:''' | '''Usage:''' | ||
Line 163: | Line 118: | ||
3 | 3,30 KB | /my/files/dummies/dummy3.bin | 3 | 3,30 KB | /my/files/dummies/dummy3.bin | ||
==PSARC== | ===PSARC=== | ||
1.60.008 SDK : x | 1.60.008 SDK : x | ||
1.92.001 SDK : x | 1.92.001 SDK : x | ||
Line 174: | Line 128: | ||
4.50.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 | ||
*From xentax forums: http://forum.xentax.com/viewtopic.php?p=44228&sid=0a7b5167ba4599f71f85471119c918a6#p44228 Download link: | *From xentax forums: http://forum.xentax.com/viewtopic.php?p=44228&sid=0a7b5167ba4599f71f85471119c918a6#p44228 Download link: http://www.mediafire.com/?o3wy35uublreh | ||
===help=== | ====help==== | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe --help | '''C:\>psarc.exe --help''' | ||
usage: | '''usage:''' | ||
psarc verb [options] [file...] | psarc verb [options] [file...] | ||
psarc --xml=XMLFILE | psarc --xml=XMLFILE | ||
verbs: | '''verbs:''' | ||
create Create an archive. (default) | create Create an archive. (default) | ||
extract Extract contents of an existing archive. | extract Extract contents of an existing archive. | ||
Line 191: | Line 145: | ||
dtd Display a DTD describing psarc's XML input syntax. | dtd Display a DTD describing psarc's XML input syntax. | ||
general options: | '''general options:''' | ||
-h, --help Show this help message and exit. | -h, --help Show this help message and exit. | ||
--version Display version and exit. | --version Display version and exit. | ||
Line 200: | Line 154: | ||
--xml=XMLFILE XML list of actions to perform. | --xml=XMLFILE XML list of actions to perform. | ||
create options: | '''create options:''' | ||
-oFILE, --output=FILE Archive filename to create. | -oFILE, --output=FILE Archive filename to create. | ||
-IINPUTFILE, --inputfile=INPUTFILE Inputfile listing files to archive. Consider --xml instead, which gives you more control. | -IINPUTFILE, --inputfile=INPUTFILE Inputfile listing files to archive. Consider --xml instead, which gives you more control. | ||
Line 219: | Line 173: | ||
--mergedups Compare the content of all files, and merge identical files so that only one copy of the data is included. | --mergedups Compare the content of all files, and merge identical files so that only one copy of the data is included. | ||
extract options: | '''extract options:''' | ||
--input=FILE Archive to extract files from. (default is first file argument) | --input=FILE Archive to extract files from. (default is first file argument) | ||
--to=DIRECTORY Directory to write extracted files to. (default is current directory) | --to=DIRECTORY Directory to write extracted files to. (default is current directory) | ||
}} | |||
===dtd=== | ====dtd==== | ||
* Display a DTD describing psarc's XML input syntax. | * Display a DTD describing psarc's XML input syntax. | ||
The output of this command is a layout that defines the structure of an .xml document. See: http://www.w3schools.com/DTD/ | The output of this command is a layout that defines the structure of an .xml document. See: http://www.w3schools.com/DTD/ | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe dtd | '''C:\>psarc.exe dtd'''<nowiki> | ||
<!ELEMENT psarc (create|extract)+> | <!ELEMENT psarc (create|extract)+> | ||
Line 283: | Line 237: | ||
skipmissingfiles (true|false) "false" | skipmissingfiles (true|false) "false" | ||
overwrite (true|false) "false"> | overwrite (true|false) "false"> | ||
</ | </nowiki>}} | ||
*DTD Notes: | *DTD Notes: | ||
Line 292: | Line 246: | ||
**Required attributes are defined with: '''#REQUIRED''', and optional attributes with: '''#IMPLIED''' | **Required attributes are defined with: '''#REQUIRED''', and optional attributes with: '''#IMPLIED''' | ||
{{Boxframe2|content= | |||
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 | |||
{{Boxcode|content=<syntaxhighlight lang="xml"> | |||
<psarc> | <psarc> | ||
<create archive="" absolute="false" ignorecase="false" mergedups="false" stripall="false" blocksize="65536" jobs="" skipmissingfiles="false" format="psarc" overwrite="false"> | <create archive="" absolute="false" ignorecase="false" mergedups="false" stripall="false" blocksize="65536" jobs="" skipmissingfiles="false" format="psarc" overwrite="false"> | ||
Line 313: | Line 264: | ||
</psarc> | </psarc> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
*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 | |||
The | **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/# | ||
}} | |||
===verify=== | ====verify==== | ||
*Verify an existing archive's structural integrity and ensure that all files can be decompressed. | *Verify an existing archive's structural integrity and ensure that all files can be decompressed. | ||
*Output info per-file is: Validating <file ID/number>: - file path inside psarc archive - (file original size in bytes) | *Output info per-file is: Validating <file ID/number>: - file path inside psarc archive - (file original size in bytes) | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe verify "C:\psarctests\source files\test.psarc" | '''C:\>psarc.exe verify "C:\psarctests\source files\test.psarc"''' | ||
Verifying C:\psarctests\source files\test.psarc | Verifying C:\psarctests\source files\test.psarc | ||
Validating 1: dummy.txt (0 bytes) | Validating 1: dummy.txt (0 bytes) | ||
Line 334: | Line 283: | ||
Validating 4: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | Validating 4: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | ||
Archive OK | Archive OK | ||
}} | |||
===dump=== | ====dump==== | ||
*Print detailed info about archive for unit testing. | *Print detailed info about archive for unit testing. | ||
*Output info per-file is: file path inside psarc archive - file original size - file compressed size - file block start offset ? | *Output info per-file is: file path inside psarc archive - file original size - file compressed size - file block start offset ? | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe dump "C:\psarctests\source files\test.psarc" | '''C:\>psarc.exe dump "C:\psarctests\source files\test.psarc"''' | ||
Dumping C:\psarctests\source files\test.psarc | Dumping C:\psarctests\source files\test.psarc | ||
dummy.txt os=0 cs=0 fb=1 | dummy.txt os=0 cs=0 fb=1 | ||
Line 347: | Line 296: | ||
JPGfolder1/JPGfolder2/Image2.jpg os=12524 cs=209 fb=97 | JPGfolder1/JPGfolder2/Image2.jpg os=12524 cs=209 fb=97 | ||
PNGfolder1/PNGfolder2/PNGfolder3/Image3.png os=6142 cs=6142 fb=98 | PNGfolder1/PNGfolder2/PNGfolder3/Image3.png os=6142 cs=6142 fb=98 | ||
}} | |||
===list=== | ====list==== | ||
*List contents of an existing archive. | *List contents of an existing archive. | ||
*Output info per-file is: file path inside psarc archive - (file compressed size - file original size - compression percentage) | *Output info per-file is: file path inside psarc archive - (file compressed size - file original size - compression percentage) | ||
*In the compression percentage: 100% is no reduction, 0% is a huge reduction | *In the compression percentage: 100% is no reduction, 0% is a huge reduction | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe list "C:\psarctests\source files\test.psarc" | '''C:\>psarc.exe list "C:\psarctests\source files\test.psarc"''' | ||
Listing C:\psarctests\source files\test.psarc | Listing C:\psarctests\source files\test.psarc | ||
dummy.txt (0/0 100%) | dummy.txt (0/0 100%) | ||
Line 361: | Line 310: | ||
JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | ||
PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142/6142 100%) | PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142/6142 100%) | ||
}} | |||
{{Boxframe2|content= | {{Boxframe2|content= | ||
{{Boxtip1|content=Is posible to generate a text file containing the output of the '''list''' command by using the | {{Boxtip1|content=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}} | ||
{{Keyboard|content= | |||
{{Keyboard|content= | |||
'''C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > c:\psarctests\filelist.txt''' | |||
}} | }} | ||
There is no output in the command line, instead the file '''c:\psarctests\filelist.txt''' is created containing the output | |||
}} | |||
====extract==== | |||
* Extract contents of an existing archive. | |||
*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 ?) | |||
---- | 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 | ||
===create=== | When using this options the command line output is the same, there is no mention of wich files are stripped, overwritten, or missing in the extraction process | ||
{{Keyboard|content= | |||
'''C:\>psarc.exe extract --input="C:\psarctests\source files\test.psarc" --to="C:\psarctests\test"''' | |||
Extracting: dummy.txt (0 bytes) | |||
Extracting: BMPfolder1/Image1.bmp (6220854 bytes) | |||
Extracting: JPGfolder1/JPGfolder2/Image2.jpg (12524 bytes) | |||
Extracting: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | |||
'''C:\>psarc.exe extract --overwrite --strip-all --skip-missing-files --input="C:\psarctests\source files\test.psarc" --to="C:\psarctests\test"''' | |||
Extracting: dummy.txt (0 bytes) | |||
Extracting: BMPfolder1/Image1.bmp (6220854 bytes) | |||
Extracting: JPGfolder1/JPGfolder2/Image2.jpg (12524 bytes) | |||
Extracting: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | |||
}} | |||
====xml extract==== | |||
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: | |||
{{Keyboard|content= | |||
'''C:\>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: | |||
{{Keyboard|content= | |||
'''C:\>psarc.exe --debug --xml=c:\psarctests\create_custom_folders.xml''' | |||
}} | |||
'''Extract all''' | |||
{{Boxcode|content=EXTRACT all.xml<syntaxhighlight lang="xml"> | |||
<psarc> | |||
<extract archive="C:\psarctests\source files\test.psarc" to="C:\psarctests\all"> | |||
</extract> | |||
</psarc> | |||
</syntaxhighlight>}} | |||
{{Keyboard|content= | |||
'''C:\>psarc.exe --xml="c:\psarctests\EXTRACT all.xml"''' | |||
Extracting: dummy.txt (0 bytes) | |||
Extracting: BMPfolder1/Image1.bmp (6220854 bytes) | |||
Extracting: JPGfolder1/JPGfolder2/Image2.jpg (12524 bytes) | |||
Extracting: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | |||
}} | |||
'''Extract by file''' | |||
{{Boxcode|content=EXTRACT by_file.xml<syntaxhighlight lang="xml"> | |||
<psarc> | |||
<extract archive="C:\psarctests\source files\test.psarc" to="C:\psarctests\by_file"> | |||
<file archivepath="BMPfolder1/Image1.bmp" /> | |||
</extract> | |||
</psarc> | |||
</syntaxhighlight>}} | |||
{{Keyboard|content= | |||
'''C:\>psarc.exe --xml="c:\psarctests\EXTRACT by_file.xml"''' | |||
Extracting: BMPfolder1/Image1.bmp (6220854 bytes) | |||
}} | |||
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) | |||
{{Boxcode|content=<syntaxhighlight lang="xml"> | |||
<psarc> | |||
<extract archive="C:\psarctests\source files\test.psarc" to="C:\psarctests\by_file" stripall="true" skipmissingfiles="false" overwrite="true"> | |||
<file archivepath="dummy.txt" skipifmissing="true" /> | |||
<file archivepath="PNGfolder1/PNGfolder2/PNGfolder3/Image3.png" /> | |||
</extract> | |||
</psarc> | |||
</syntaxhighlight>}} | |||
*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) | |||
====create==== | |||
* Create an archive. | * Create an archive. | ||
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 '''C:\psarctests\source files\test''' from '''C:\psarctests\source files\test\BMPfolder1\Image1.bmp''' the resulting path of the file inside the archive will be '''BMPfolder1/Image1.bmp''') | |||
This is an example of the filelist in '''C:\psarctests\source files\filelist.txt''', contains the PC paths of the files that are in the folder '''C:\psarctests\source files\test''' and will be included inside the psarc archive: | |||
C:\psarctests\source files\test\dummy.txt | |||
C:\psarctests\source files\test\BMPfolder1\Image1.bmp | |||
C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | |||
C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\Image3.png | |||
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 | |||
{{Keyboard|content= | |||
'''C:\>psarc.exe create --strip="C:\psarctests\source files\test" --output=C:\psarctests\command_by_filelist.psarc --inputfile="C:\psarctests\source files\filelist.txt"''' | |||
Strip: C:\psarctests\source files\test | |||
Flags: relative | |||
NumJobs: 2 | |||
InputFile: C:\psarctests\source files\filelist.txt | |||
Output: C:\psarctests\command_by_filelist.psarc | |||
Compression: zlib level 9 | |||
Archiving C:\psarctests\source files\test\dummy.txt | |||
Archiving C:\psarctests\source files\test\BMPfolder1\Image1.bmp | |||
Archiving C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | |||
Archiving C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\Image3.png | |||
Compressing TOC | |||
Compressing C:\psarctests\source files\test\dummy.txt | |||
Compressing C:\psarctests\source files\test\BMPfolder1\Image1.bmp | |||
Compressing C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | |||
Compressing C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\Image3.png | |||
4: Total Files Archived | |||
6239520: Original Size | |||
108: Manifest (uncompressed) | |||
72: Manifest (compressed) | |||
380: TOC size | |||
8836: Final Size | |||
4.3%: Directory Overhead | |||
99.9%: Compression Ratio | |||
9: Compression Level | |||
}} | |||
*Notes: | |||
**The program replaces the windows slash "\" by "/" when storing the access paths inside the '''manifest''' file. 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 create==== | |||
{{Boxcode| | '''create by directory''' | ||
{{Boxcode|content=CREATE by_directory.xml<syntaxhighlight lang="xml"> | |||
<psarc> | <psarc> | ||
<create archive="C:\psarctests\by_directory.psarc" absolute="false" ignorecase="false"> | <create archive="C:\psarctests\by_directory.psarc" absolute="false" ignorecase="false"> | ||
Line 389: | Line 464: | ||
</psarc> | </psarc> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe --xml="c:\psarctests\CREATE by_directory.xml" | '''C:\>psarc.exe --xml="c:\psarctests\CREATE by_directory.xml"''' | ||
Strip: C:\psarctests\source files\test | Strip: C:\psarctests\source files\test | ||
Flags: relative | Flags: relative | ||
Line 412: | Line 487: | ||
99.9%: Compression Ratio | 99.9%: Compression Ratio | ||
9: Compression Level | 9: Compression Level | ||
C:\>psarc.exe list C:\psarctests\by_directory.psarc | '''C:\>psarc.exe list C:\psarctests\by_directory.psarc''' | ||
Listing C:\psarctests\by_directory.psarc | Listing C:\psarctests\by_directory.psarc | ||
BMPfolder1/Image1.bmp (8018/6220854 0%) | BMPfolder1/Image1.bmp (8018/6220854 0%) | ||
Line 418: | Line 493: | ||
JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | ||
PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (157/6142 2%) | PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (157/6142 2%) | ||
}} | |||
'''create by filelist''' | |||
{{Boxcode|content=CREATE by_filelist.xml<syntaxhighlight lang="xml"> | |||
{{ | |||
<psarc> | <psarc> | ||
<create archive="C:\psarctests\by_filelist.psarc" absolute="false" ignorecase="false"> | |||
<compression type="zlib" enabled="true" /> | <compression type="zlib" enabled="true" /> | ||
<strip regex="C:\psarctests\source files\test" /> | <strip regex="C:\psarctests\source files\test" /> | ||
Line 451: | Line 506: | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
*filelist.txt | |||
C:\psarctests\source files\test\dummy.txt | |||
C:\psarctests\source files\test\BMPfolder1\Image1.bmp | |||
C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | |||
C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\Image3.png | |||
{{Keyboard|content= | |||
{{Keyboard|content= | '''C:\>psarc.exe --xml="c:\psarctests\CREATE by_filelist.xml"''' | ||
Strip: C:\psarctests\source files\test | Strip: C:\psarctests\source files\test | ||
Flags: relative | Flags: relative | ||
NumJobs: 2 | NumJobs: 2 | ||
Output: C:\psarctests\by_filelist.psarc | Output: C:\psarctests\by_filelist.psarc | ||
Compression: zlib level 9 | Compression: zlib level 9 | ||
Archiving C:\psarctests\source files\filelist.txt | |||
Archiving C:\psarctests\source files\test\dummy.txt | Archiving C:\psarctests\source files\test\dummy.txt | ||
Archiving C:\psarctests\source files\test\BMPfolder1\Image1.bmp | Archiving C:\psarctests\source files\test\BMPfolder1\Image1.bmp | ||
Line 481: | Line 539: | ||
99.9%: Compression Ratio | 99.9%: Compression Ratio | ||
9: Compression Level | 9: Compression Level | ||
C:\>psarc.exe list C:\psarctests\by_filelist.psarc | '''C:\>psarc.exe list C:\psarctests\by_filelist.psarc''' | ||
Listing C:\psarctests\by_filelist.psarc | Listing C:\psarctests\by_filelist.psarc | ||
dummy.txt (0/0 100%) | dummy.txt (0/0 100%) | ||
Line 487: | Line 545: | ||
JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | ||
PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (157/6142 2%) | PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (157/6142 2%) | ||
}} | |||
{{Boxcode| | '''create by file''' | ||
{{Boxcode|content=CREATE by_file.xml<syntaxhighlight lang="xml"> | |||
<psarc> | <psarc> | ||
<create archive="C:\psarctests\by_file.psarc" absolute="false" ignorecase="false"> | |||
<compression type="zlib" enabled="true" /> | <compression type="zlib" enabled="true" /> | ||
<strip regex="C:\psarctests\source files\test" /> | <strip regex="C:\psarctests\source files\test" /> | ||
Line 511: | Line 561: | ||
</psarc> | </psarc> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe --xml="c:\psarctests\CREATE by_file.xml" | C:\>psarc.exe --xml="c:\psarctests\CREATE by_file.xml" | ||
Strip: C:\psarctests\source files\test | Strip: C:\psarctests\source files\test | ||
Line 521: | Line 571: | ||
Archiving C:\psarctests\source files\test\BMPfolder1\Image1.bmp | Archiving C:\psarctests\source files\test\BMPfolder1\Image1.bmp | ||
Archiving C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | Archiving C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | ||
Archiving C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\ | Archiving C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\Image | ||
3.png | |||
Compressing TOC | Compressing TOC | ||
Compressing C:\psarctests\source files\test\dummy.txt | Compressing C:\psarctests\source files\test\dummy.txt | ||
Compressing C:\psarctests\source files\test\BMPfolder1\Image1.bmp | Compressing C:\psarctests\source files\test\BMPfolder1\Image1.bmp | ||
Compressing C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | Compressing C:\psarctests\source files\test\JPGfolder1\JPGfolder2\Image2.jpg | ||
Storing C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\ | Storing C:\psarctests\source files\test\PNGfolder1\PNGfolder2\PNGfolder3\Ima | ||
ge3.png | |||
4: Total Files Archived | 4: Total Files Archived | ||
Line 537: | Line 589: | ||
99.8%: Compression Ratio | 99.8%: Compression Ratio | ||
9: Compression Level | 9: Compression Level | ||
C:\>psarc.exe list C:\psarctests\by_file.psarc | '''C:\>psarc.exe list C:\psarctests\by_file.psarc''' | ||
Listing C:\psarctests\by_file.psarc | Listing C:\psarctests\by_file.psarc | ||
dummy.txt (0/0 100%) | dummy.txt (0/0 100%) | ||
Line 543: | Line 595: | ||
JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | JPGfolder1/JPGfolder2/Image2.jpg (209/12524 1%) | ||
PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142/6142 100%) | PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142/6142 100%) | ||
}} | |||
'''create by file (batch)''' | |||
This is an useless example to show how the .psarcs are created sequentially and how to create several .psarc's with only one .xml, it uses all default values for compressions, formats, flags etc... | |||
In step 1 it creates an egg.psarc | In step 1 it creates an egg.psarc with a dummy.txt inside. In step 2 it creates a chiken.psarc with the egg.psarc made in step 1 inside. In step 3 it creates an egg.psarc with the chicken.psarc made in step 2 inside | ||
{{Boxcode| | {{Boxcode|content=CREATE by_file_paradox<syntaxhighlight lang="xml"> | ||
<psarc> | <psarc> | ||
<create archive="C:\psarctests\egg.psarc"> | <create archive="C:\psarctests\egg.psarc"> | ||
Line 567: | Line 621: | ||
</psarc> | </psarc> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe --xml="c:\psarctests\CREATE by_file_paradox.xml" | '''C:\>psarc.exe --xml="c:\psarctests\CREATE by_file_paradox.xml"''' | ||
Strip: C:\psarctests\source files\test | Strip: C:\psarctests\source files\test | ||
Flags: relative | Flags: relative | ||
Line 625: | Line 679: | ||
-44.8%: Compression Ratio | -44.8%: Compression Ratio | ||
9: Compression Level | 9: Compression Level | ||
C:\>psarc.exe list C:\psarctests\egg.psarc | '''C:\>psarc.exe list C:\psarctests\egg.psarc | ||
Listing C:\psarctests\egg.psarc | Listing C:\psarctests\egg.psarc | ||
chicken.psarc (143/174 82%) | chicken.psarc (143/174 82%) | ||
C:\>psarc.exe list C:\psarctests\chicken.psarc | '''C:\>psarc.exe list C:\psarctests\chicken.psarc | ||
Listing C:\psarctests\chicken.psarc | Listing C:\psarctests\chicken.psarc | ||
egg.psarc (69/105 65%) | egg.psarc (69/105 65%) | ||
}} | |||
==Total Commander plugin== | ==Total Commander plugin== | ||
http://www.totalcmd.net/plugring/PSARC.html | http://www.totalcmd.net/plugring/PSARC.html | ||
==PS3 PSARC GUI== | ==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 | 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 | 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 | |||
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 | |||
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 | 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 | |||
*The file paths inside filelist.txt or inside an 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 | |||
**'''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 | **'''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= | =Games or Apps using PSARC files= | ||
Line 1,178: | Line 755: | ||
|- | |- | ||
| TEXTURES.PSARC || || || || || || || | | TEXTURES.PSARC || || || || || || || | ||
|- | |- | ||
| Motorstorm Pacific Rift || ? || || || || || || || | | Motorstorm Pacific Rift || ? || || || || || || || | ||
Line 1,204: | Line 779: | ||
|- | |- | ||
| All others || 00010003 || zlib || 0000001E || 00010000 || 00000003 (ignorecase + absolute) || compress all || | | All others || 00010003 || zlib || 0000001E || 00010000 || 00000003 (ignorecase + absolute) || compress all || | ||
|- | |- | ||
| The Last Of Us || All ? || 00010003 || zlib || 0000001E || 00010000 || 00000000 (no flags) || || | | The Last Of Us || All ? || 00010003 || zlib || 0000001E || 00010000 || 00000000 (no flags) || || | ||
Line 1,240: | Line 805: | ||
|- | |- | ||
! TITLE !! PSARC files || Version<BR />(offset 0x04) !! Compression<BR />(offset 0x08) !! TOC entry size<BR />(offset 0x10) !! Block Size<BR />(offset 0x18) !! Flags<BR />(offset 0x1C) | ! TITLE !! PSARC files || Version<BR />(offset 0x04) !! Compression<BR />(offset 0x08) !! TOC entry size<BR />(offset 0x10) !! Block Size<BR />(offset 0x18) !! Flags<BR />(offset 0x1C) | ||
|- | |- | ||
| VidZone || vidzone*.db.psarc || 00010004 || zlib || 0000001E || 00010000 || 00000000 (no flags) || compress all || Vidzone is a web service, the .psarc is hosted in the web | | VidZone || vidzone*.db.psarc || 00010004 || zlib || 0000001E || 00010000 || 00000000 (no flags) || compress all || Vidzone is a web service, the .psarc is hosted in the web | ||
|} | |} | ||
*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). | |||
**Ape Escape target.psarc includes "dupes" (or duplicated files) in the TOC (table of contents) of the psarc archive. This method used at creation time basically works by making several entries of the TOC to point to the same file, this way a single file inside the psarc is indexed several times in the TOC and can be accessed from several different paths/filenames. The only way to identify this dupes before extraction is by reading the TOC of the psarc for all the files and compare wich position are pointing to. As an example the original size of target.psarc is 328mb... after a "standard" extraction is 2.52GB (this extraction doesnt identify the dupes so are extracted several times under different paths/filenames)... if you try to rebuild it again his final size will be much bigger than the original target.psarc | |||
*Other games that probably uses PSARC's | *Other games that probably uses PSARC's | ||
Line 1,263: | Line 822: | ||
{{File Formats}} | {{File Formats}} | ||
<noinclude> | <noinclude>[[Category:Main]]</noinclude> | ||
[[Category:Main]] | |||
</noinclude> |