GitHub - windsurfer1122/PSN_get_pkg_info: Extract package information from header and PARAM.SFO of PS3/PSX/PSP/PSV/PSM and PS4 packages. (original) (raw)

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

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

Goals

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.
Also see Path Pattern Examples and RIF/RAP/DevKLic Handling.

Contributions welcome

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  
  1. Install further necessary Python modules via pip.
    • Install pycryptodomex module:
      https://www.pycryptodome.org/en/latest/src/installation.html
      * Python 3: pip3 install --upgrade pycryptodomex
      * Python 2: pip2 install --upgrade pycryptodomex
    • Install cryptography module:
      * Optional: apt-get install <python3-cryptography|python-cryptography>
      * Python 3: pip3 install --upgrade cryptography
      * Python 2: pip2 install --upgrade cryptography
    • 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
    • Install packaging module:
      * Python 3: pip3 install --upgrade packaging
      * Python 2: pip2 install --upgrade packaging
    • Install ecdsa module:
      * Optional: apt-get install <python3-ecdsa|python-ecdsa>
      * Python 3: pip3 install --upgrade ecdsa
      * Python 2: pip2 install --upgrade ecdsa

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 pycryptodomex module: pip install --upgrade pycryptodomex
      https://www.pycryptodome.org/en/latest/src/installation.html
    • Install cryptography module: pip install --upgrade cryptography
    • Install requests module: pip install --upgrade requests
    • Install aenum module: pip install --upgrade aenum
    • Install fastxor module: pip install --upgrade fastxor
    • Install packaging module: pip install --upgrade packaging
    • Install ecdsa module: pip install --upgrade ecdsa
    • 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

Path Pattern Examples for --content Extraction

RIF/RAP/DevKLic Handling

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