Editing PlayStation archive (PSARC)

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 177: Line 177:


===help===
===help===
{{Keyboard|content=<syntaxhighlight lang="bash">
{{Keyboard|content=
C:\>psarc.exe --help
C:\>psarc.exe --help
usage:
usage:
Line 222: Line 222:
  --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)
</syntaxhighlight>}}
}}


===dtd===
===dtd===
Line 317: Line 317:


When the xml is ready you can run it this way:
When the xml is ready you can run it this way:
{{Keyboard|content=<syntaxhighlight lang="bash">C:\>psarc.exe --xml=C:\DTD_Layout.xml</syntaxhighlight>}}
{{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=<syntaxhighlight lang="bash">C:\>psarc.exe --debug --xml=C:\DTD_Layout.xml</syntaxhighlight>}}
{{Keyboard|content=C:\>psarc.exe --debug --xml=C:\DTD_Layout.xml}}


===verify===
===verify===
Line 326: Line 326:
*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=<syntaxhighlight lang="bash">
{{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 334: Line 334:
Validating 4: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes)
Validating 4: PNGfolder1/PNGfolder2/PNGfolder3/Image3.png (6142 bytes)
Archive OK
Archive OK
</syntaxhighlight>}}
}}


===dump===
===dump===
Line 340: Line 340:
*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=<syntaxhighlight lang="bash">
{{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 347: Line 347:
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
</syntaxhighlight>}}
}}


===list===
===list===
Line 354: Line 354:
*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=<syntaxhighlight lang="bash">
{{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 361: Line 361:
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%)
</syntaxhighlight>}}
}}


{{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=<syntaxhighlight lang="bash">C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > c:\psarctests\filelist.txt</syntaxhighlight>}}
{{Keyboard|content=C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > c:\psarctests\filelist.txt}}
}}
}}


Line 389: Line 389:
</psarc>
</psarc>
</syntaxhighlight>}}
</syntaxhighlight>}}
{{Keyboard|content=<syntaxhighlight lang="bash">
{{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 418: Line 418:
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%)
</syntaxhighlight>}}
}}


====create by filelist====
====create by filelist====
Line 438: Line 438:


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=<syntaxhighlight lang="bash">C:\>psarc.exe create --strip="C:\psarctests\source files\test" --output=C:\psarctests\by_filelist.psarc --inputfile="C:\psarctests\source files\filelist.txt"</syntaxhighlight>}}
{{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 452: Line 452:


Then run the contents of the .xml this way:
Then run the contents of the .xml this way:
{{Keyboard|content=<syntaxhighlight lang="bash">C:\>psarc.exe --xml="c:\psarctests\CREATE by_filelist.xml"</syntaxhighlight>}}
{{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=<syntaxhighlight lang="bash">
{{Keyboard|content=
Strip: C:\psarctests\source files\test
Strip: C:\psarctests\source files\test
Flags: relative
Flags: relative
Line 487: Line 487:
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%)
</syntaxhighlight>}}
}}


====create by file====
====create by file====
Line 511: Line 511:
</psarc>
</psarc>
</syntaxhighlight>}}
</syntaxhighlight>}}
{{Keyboard|content=<syntaxhighlight lang="bash">
{{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 543: Line 543:
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%)
</syntaxhighlight>}}
}}


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 567: Line 567:
</psarc>
</psarc>
</syntaxhighlight>}}
</syntaxhighlight>}}
{{Keyboard|content=<syntaxhighlight lang="bash">
{{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 631: Line 631:
Listing C:\psarctests\chicken.psarc
Listing C:\psarctests\chicken.psarc
egg.psarc (69/105 65%)
egg.psarc (69/105 65%)
</syntaxhighlight>}}
}}


----
----
Line 649: Line 649:
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=<syntaxhighlight lang="bash">
{{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 660: Line 660:
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)
</syntaxhighlight>}}
}}


'''extract all (xml)'''
'''extract all (xml)'''
Line 670: Line 670:
</psarc>
</psarc>
</syntaxhighlight>}}
</syntaxhighlight>}}
{{Keyboard|content=<syntaxhighlight lang="bash">
{{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 676: Line 676:
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)
</syntaxhighlight>}}
}}


====extract by file====
====extract by file====
Line 688: Line 688:
</psarc>
</psarc>
</syntaxhighlight>}}
</syntaxhighlight>}}
{{Keyboard|content=<syntaxhighlight lang="bash">
{{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)
</syntaxhighlight>}}
}}


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 842: Line 842:
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=<syntaxhighlight lang="bash">C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > "C:\psarctests\filelist.txt"</syntaxhighlight>}}
{{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 948: Line 948:
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=<syntaxhighlight lang="bash">C:\>psarc.exe list "C:\psarctests\source files\test.psarc" > "C:\psarctests\list.txt"</syntaxhighlight>}}
{{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">
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)