Skip to content
Extract package information from header and PARAM.SFO of PS3/PSX/PSP/PSV/PSM and PS4 packages.
Python Shell
Branch: master
Clone or download
windsurfer1122 Release 2019.06.30.post1: Still display determined data if reading/de…
…cryption of items fail

* FIX: Still display determined data if reading/decryption of items fail
Latest commit 91911a8 Jul 2, 2019

README.md

PSN_get_pkg_info.py (c) 2018-2019 by "windsurfer1122"

Extract package information from header and PARAM.SFO of PS3/PSX/PSP/PSV/PSM and PS4 packages.

Goals

  • One-for-all solution to retrieve all header data and PARAM.SFO data from PSN packages
  • Decryption of PS3 encrypted data to get all data
  • Support of all known package types: PS3/PSX/PSP, PSV/PSM, PS4
  • Extraction of PS3/PSX/PSP/PSV/PSM packages similar to pkg2zip and pkg_dec
    • pkg_dec's raw extraction, where the complete package is decrypted and again stored as a single file which keeps the package structure 1:1 (decrypted package)
    • Content extraction, where the package items are decrypted and stored under their original item names
    • [Preliminary] ux0 extraction, where the package items are decrypted and stored as they would have been installed on the PS Vita file system.
  • Easy enhancement of interpreting data (=done at the very end with all data at hand)
  • Support http download streaming to avoid harddisk usage
  • Support multi-part packages (PS3: XML, PS4: JSON)
  • Support multiple output formats
  • Support multiple debug verbosity levels
  • Easy to maintain and no compiler necessary (=interpreter language)
  • Cross platform support
    • Decision: Python 3
      • Compatible with Python 2 (target version 2.7)
        • Identical output
        • Forward-compatible solutions preferred
  • Modular and flexible code for easy enhancement and/or extensions (of course there's always something hard-coded left)

Execution

For available options execute: PSN_get_pkg_info.py -h
It is recommended to place -- before the package sources, to avoid them being used as targets, e.g. PSN_get_pkg_info.py --raw -- 01.pkg 02.pkg will never kill the 01.pkg!
Use at your own risk!
If you state URLs then only the necessary bytes are downloaded into memory. Note that the "--raw" option downloads the complete package once without storing the original data on the file system.

Contributions welcome

  • Especially information about how to interpret data is needed, e.g. content types
  • See TODO.MD what is still left to do

Requirements

Installing on Debian

  1. Python 3, which is the recommended version, and most modules can be installed via apt.
    Install Python 3 and some modules via the following apt packages: python3 python3-pip python3-requests.

  2. Python 2 is the default on Debian, but comes with an outdated pip version until Debian 8.
    Note that with Python 2 ZRIF support is not possible at all.
    Starting with Debian 9 "Stretch" install Python 2 modules via the following apt packages: python-pip python-future python-requests.
    For Debian up to 8 "Jessie" use the pip version from the original PyPi source:

    apt-get purge python-pip python-dev python-future
    apt-get autoremove
    wget https://bootstrap.pypa.io/get-pip.py
    python2 get-pip.py
    pip2 install --upgrade future
    
  3. Install further necessary Python modules via pip.

    • Install pycryptodomex module:
      • Python 3: pip3 install --upgrade pycryptodomex
      • Python 2: pip2 install --upgrade pycryptodomex
    • Install aenum module:
      • Python 3: pip3 install --upgrade aenum
      • Python 2: pip2 install --upgrade aenum
    • Install fastxor module:
      • Python 3: pip3 install --upgrade fastxor
      • Python 2: pip2 install --upgrade fastxor

Installing on Windows

  1. Install Python
    Checked with Python 3.7 x64 on Windows 10 x64 Version 1803.

    • Get it from the Python homepage
    • Install launcher for all users
    • Add Python to PATH
      Adds %ProgramFiles%\Python37 + \Scripts to PATH
    • Use Customize Installation (!!! necessary for advanced options !!!)
    • Advanced Options
      • Install for all users
  2. Install necessary Python modules via pip.

    • Start an elevated(!!!) Command Prompt (Run As Admin via Right Click)
    • Update PIP itself first: python -m pip install --upgrade pip
    • Install requests module: pip install --upgrade requests
    • Install pycryptodomex module: pip install --upgrade pycryptodomex
    • Install aenum module: pip install --upgrade aenum
    • Install fastxor module: pip install --upgrade fastxor
    • Exit Command Prompt: exit

Executing python scripts can be done via Windows Explorer or a Command Prompt. Normally no elevation is necessary for script execution, except when the python script wants to change something in the system internals.

Using a HTTP Proxy with Python

  • Linux: export HTTP_PROXY="http://192.168.0.1:3128"; export HTTPS_PROXY="http://192.168.0.1:1080";

Original Source

git master repository at https://github.com/windsurfer1122

License

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see https://www.gnu.org/licenses/.

Additional Credits for Ideas and Several Details

You can’t perform that action at this time.