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 8: | Line 8: | ||
The compression algorithms, the PS3 system, and the .psarc format, allows for 9 compression levels but in the practise only are used level 0 (no compression) or 9 (max compression used as the default compression level) | |||
Compression level 9 for generic file types results as a compression ratio of around 50% of the original size, the final compression ratio can vary for different types of files, usually multimedia files (video, audio, etc) doesnt admits much compression because are already compressed originally (as example, max compression ratio for .BIK video and .MP3 audio doesnt reachs 1% or 2%). For this reason is better to dont compress multimedia files because the size reduction is ridiculous and read access times can be reduced (causing a delay/lag/freeze when trying to load the file) | |||
Very small files (smaller than 100 bytes or so) as well as dummy files (0 bytes) doesnt admits compression because are so small that the compression algorithm is not able to reduce them, they will be stored without compression inside the .psarc archive even when is applyed compression over them. When listing the contents of a .psarc with this kind of files will be displayed with a percentage of 100% and both his compressed and decompressed sizes the same value | |||
Very small files (smaller than 100 bytes or so) as well as dummy files (0 bytes) | |||
<small> | <small> | ||
Line 51: | Line 50: | ||
*'''Relative''' (default, no flags) | *'''Relative''' (default, no flags) | ||
**Default value when the .psarc is created from command line or an .xml and no special access paths modes are | **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''' | **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 | ||
**e.g: '''Folder/File.bin"''' | **e.g: '''Folder/File.bin"''' | ||
**In the games that uses .psarc's without flags (like ''uncharted'' series or ''the last of us'') is | **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 | ||
*'''Ignorecase''' flag | *'''Ignorecase''' flag | ||
Line 80: | Line 79: | ||
! Offset !! Size !! Name !! Example !! Value (conversion) !! Notes | ! Offset !! Size !! Name !! Example !! Value (conversion) !! Notes | ||
|+PSARC TOC | |+PSARC TOC | ||
| style="background-color:#ff6666;" | 0x20 || style="background-color:#ff6666;" | | | style="background-color:#ff6666;" | 0x20 || style="background-color:#ff6666;" | 0x16 || '''name digest''' || 00 00 ... 00 00 || - || 128-bit md5 hash | ||
|- | |- | ||
| style="background-color:#66ff66;" | 0x30 || style="background-color:#66ff66;" | 0x04 || '''block offset''' || 00 00 00 00 || 0 || Offset in block list. | | style="background-color:#66ff66;" | 0x30 || style="background-color:#66ff66;" | 0x04 || '''block offset''' || 00 00 00 00 || 0 || Offset in block list. | ||
Line 105: | Line 104: | ||
==File table== | ==File table== | ||
The compression is | The compression is applyed "per-block", is posible to know the compression level by looking at the zlib header | ||
===Manifest=== | ===Manifest=== | ||
Manifest is the first file inside the psarc filetable, | 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''' | ||
In windows all the paths uses the slash "\" but when the psarc is created the paths are stored inside the manifest as "/". When making a '''--list''' command over a psarc the slashes will appear as "/" | In windows all the paths uses the slash "\" but when the psarc is created the paths are stored inside the manifest as "/". When making a '''--list''' command over a psarc the slashes will appear as "/" | ||
Line 117: | Line 116: | ||
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 | 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 | GUI versions are derivated from the command line versions | ||
==Open PSARC PS3 Extractor== | ==Open PSARC PS3 Extractor== | ||
Line 138: | Line 137: | ||
==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 165: | Line 163: | ||
==PSARC== | ==PSARC== | ||
1.60.008 SDK : x | 1.60.008 SDK : x | ||
1.92.001 SDK : x | 1.92.001 SDK : x | ||
Line 175: | Line 172: | ||
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: | ||
Line 223: | Line 220: | ||
--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=== | ||
Line 230: | Line 227: | ||
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=<syntaxhighlight lang=" | {{Keyboard|content=<syntaxhighlight lang="bash"> | ||
C:\>psarc.exe dtd | C:\>psarc.exe dtd | ||
<!ELEMENT psarc (create|extract)+> | <!ELEMENT psarc (create|extract)+> | ||
Line 314: | Line 311: | ||
</psarc> | </psarc> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
*The purpose of this XML is to use it as a base layout containing all, but is not | *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 | *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 | ||
When the xml is ready you can run it this way: | When the xml is ready you can run it this way: | ||
{{Keyboard|content= | {{Keyboard|content=C:\>psarc.exe --xml=C:\DTD_Layout.xml}} | ||
The options '''--verbose''', '''--debug''', and '''--quiet''' cant be used inside the xml, so if needed are specifyed in the command line, this way: | 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= | {{Keyboard|content=C:\>psarc.exe --debug --xml=C:\DTD_Layout.xml}} | ||
===verify=== | ===verify=== | ||
Line 327: | Line 324: | ||
*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 | ||
Line 335: | Line 332: | ||
Validating 4: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | Validating 4: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | ||
Archive OK | Archive OK | ||
}} | |||
===dump=== | ===dump=== | ||
Line 341: | Line 338: | ||
*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 | ||
Line 348: | Line 345: | ||
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=== | ||
Line 355: | Line 352: | ||
*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 | ||
Line 362: | Line 359: | ||
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 character '''>''' (right arrow) and the path/name of the destination file, this is usefull to convert the generated file to a '''filelist.txt''' for rebuilding the psarc archive later}} | {{Boxtip1|content=Is posible to generate a text file containing the output of the '''list''' command by using the character '''>''' (right arrow) and the path/name of the destination file, this is usefull to convert the generated file to a '''filelist.txt''' for rebuilding the psarc archive later}} | ||
{{Keyboard|content= | {{Keyboard|content=C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > c:\psarctests\filelist.txt}} | ||
}} | }} | ||
Line 375: | Line 372: | ||
====create by directory==== | ====create by directory==== | ||
Creates a psarc using the contents of a | Creates a psarc using the contents of a specifyed folder and all subfolders. Is only available when using an .xml because command line doesnt allows to specify a source folder | ||
Is the most rude method to create a psarc because all folders and files will be archived alphabetically based in his names (there is no | Is the most rude method to create a psarc because all folders and files will be archived alphabetically based in his names (there is no controll of the ID's that will be assigned to each file in the '''manifest'''). Cant be used to rebuild psarcs | ||
Note in the next | Note in the next examle the file dummy.txt (located in the root of the folder in windows, so considered first) has been archived after BMPfolder1 | ||
{{Boxcode|title=Create_by_directory.xml|code=<syntaxhighlight lang="xml"> | {{Boxcode|title=Create_by_directory.xml|code=<syntaxhighlight lang="xml"> | ||
Line 390: | Line 387: | ||
</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 | ||
Line 419: | Line 416: | ||
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==== | ====create by filelist==== | ||
Line 439: | Line 436: | ||
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, this way: | 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, this way: | ||
{{Keyboard|content= | {{Keyboard|content='''C:\>psarc.exe create --strip="C:\psarctests\source files\test" --output=C:\psarctests\by_filelist.psarc --inputfile="C:\psarctests\source files\filelist.txt"'''}} | ||
Or you can prepare an .xml that contains the path to the filelist.txt | Or you can prepare an .xml that contains the path to the filelist.txt | ||
Line 453: | Line 450: | ||
Then run the contents of the .xml this way: | Then run the contents of the .xml this way: | ||
{{Keyboard|content= | {{Keyboard|content=C:\>psarc.exe --xml="c:\psarctests\CREATE by_filelist.xml"}} | ||
The output of the tool is the same in both cases (except the InputFile not present when using an xml) | The output of the tool is the same in both cases (except the InputFile not present when using an xml) | ||
{{Keyboard|content= | {{Keyboard|content= | ||
Strip: C:\psarctests\source files\test | Strip: C:\psarctests\source files\test | ||
Flags: relative | Flags: relative | ||
Line 488: | Line 485: | ||
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 file==== | ====create by file==== | ||
Line 512: | Line 509: | ||
</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 544: | Line 541: | ||
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%) | ||
}} | |||
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... | 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... | ||
Line 568: | Line 565: | ||
</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 | ||
Line 632: | Line 629: | ||
Listing C:\psarctests\chicken.psarc | Listing C:\psarctests\chicken.psarc | ||
egg.psarc (69/105 65%) | egg.psarc (69/105 65%) | ||
}} | |||
---- | ---- | ||
Line 650: | Line 647: | ||
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 | 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= | {{Keyboard|content= | ||
C:\>psarc.exe extract --input="C:\psarctests\source files\test.psarc" --to="C:\psarctests\test" | C:\>psarc.exe extract --input="C:\psarctests\source files\test.psarc" --to="C:\psarctests\test" | ||
Extracting: dummy.txt (0 bytes) | Extracting: dummy.txt (0 bytes) | ||
Line 661: | Line 658: | ||
Extracting: JPGfolder1/JPGfolder2/Image2.jpg (12524 bytes) | Extracting: JPGfolder1/JPGfolder2/Image2.jpg (12524 bytes) | ||
Extracting: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | Extracting: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | ||
}} | |||
'''extract all (xml)''' | '''extract all (xml)''' | ||
Line 671: | Line 668: | ||
</psarc> | </psarc> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe --xml="c:\psarctests\EXTRACT all.xml" | C:\>psarc.exe --xml="c:\psarctests\EXTRACT all.xml" | ||
Extracting: dummy.txt (0 bytes) | Extracting: dummy.txt (0 bytes) | ||
Line 677: | Line 674: | ||
Extracting: JPGfolder1/JPGfolder2/Image2.jpg (12524 bytes) | Extracting: JPGfolder1/JPGfolder2/Image2.jpg (12524 bytes) | ||
Extracting: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | Extracting: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes) | ||
}} | |||
====extract by file==== | ====extract by file==== | ||
Line 689: | Line 686: | ||
</psarc> | </psarc> | ||
</syntaxhighlight>}} | </syntaxhighlight>}} | ||
{{Keyboard|content= | {{Keyboard|content= | ||
C:\>psarc.exe --xml="c:\psarctests\EXTRACT by_file.xml" | C:\>psarc.exe --xml="c:\psarctests\EXTRACT by_file.xml" | ||
Extracting: BMPfolder1/Image1.bmp (6220854 bytes) | 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) | 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) | ||
Line 843: | Line 840: | ||
Generate a .txt file containing the output of the '''list''' comand | Generate a .txt file containing the output of the '''list''' comand | ||
{{Boxframe1|content= | {{Boxframe1|content= | ||
{{Keyboard|content= | {{Keyboard|content=C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > "C:\psarctests\filelist.txt"}} | ||
The file generated by the list command will have this content (note there is en empty line at the end): | The file generated by the list command will have this content (note there is en empty line at the end): | ||
Listing C:\psarctests\source files\test.psarc | Listing C:\psarctests\source files\test.psarc | ||
Line 949: | Line 946: | ||
Generate a list.txt file containing the output of the '''list''' command | Generate a list.txt file containing the output of the '''list''' command | ||
{{Boxframe1|content= | {{Boxframe1|content= | ||
{{Keyboard|content= | {{Keyboard|content='''C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > "C:\psarctests\list.txt"'''}} | ||
The file generated by the list command will have this content: | The file generated by the list command will have this content: | ||
{{Boxcode|code=<syntaxhighlight lang="xml"> | {{Boxcode|code=<syntaxhighlight lang="xml"> | ||
Line 1,205: | Line 1,202: | ||
|- | |- | ||
| 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,264: | Line 1,251: | ||
{{File Formats}} | {{File Formats}} | ||
<noinclude> | <noinclude>[[Category:Main]]</noinclude> | ||
[[Category:Main]] | |||
</noinclude> |