Category PS4 CFW and Hacks       Thread starter PSXHAX       Start date Jan 17, 2020 at 9:55 AM       19,459       49            
Since yesterday's PS4 PKG Backporting updates PlayStation 4 scene developer maxton of Maxton.xyz announced on Twitter that he updated the LibOrbisPkg PkgEditor adding support for EKPFS / XTS keys to access an encrypted PKG's file system alongside a keydb.json file to store the keys eliminating the need to paste them in every time a Package is opened. 🔥

Download: PKGEditor (Latest Builds) / GIT

He notes keys are now saved to a JSON file located at %AppData%/LibOrbisPkg/keydb.json

To quote from the README.md: LibOrbisPkg

I am developing an open source library for reading and writing PS4 PKG files. This project's goal is to eliminate the need to use proprietary *** tools. Without a proper open PKG tool, the PS4 homebrew scene cannot flourish.

All code in this repository is licensed under the GNU LGPL version 3, which can be found in LICENSE.txt.

Download

The latest builds are available to download at AppVeyor.

Usage

PkgEditor


PkgEditor is a GUI tool with which you can edit GP4 projects, create and edit SFO files, and build PKG and PFS archives. The tool also supports opening PKGs directly. You can see the header, entries, and if the package is a fake PKG or you enter a passcode, you can browse files as well.

PkgTool

PkgTool is a command line tool for common PKG/PFS/SFO tasks. Integrate it into your build scripts!
Code:
Usage: PkgTool.exe <verb> [options ...]

Verbs:
  pfs_buildinner <input_project.gp4> <output_pfs.dat>
    Builds an inner PFS image from the given GP4 project.

  pfs_buildouter [--encrypt] <input_project.gp4> <output_pfs.dat>
    Builds an outer PFS image, optionally encrypted, from the given GP4 project.

  pfs_extract [--verbose] <input.dat> <output_directory>
    Extracts all the files from a PFS image to the given output directory. Use the verbose flag to print filenames as they are extracted.

  pkg_build <input_project.gp4> <output_directory>
    Builds a fake PKG from the given GP4 project in the given output directory.

  pkg_extract [--verbose] [--passcode <...>] <input.pkg> <output_directory>
    Extracts all the files from a PKG to the given output directory. Use the verbose flag to print filenames as they are extracted.

  pkg_extractentry [--passcode <...>] <input.pkg> <entry_id> <output.bin>
    Extracts the selected entry from the given PKG file.

  pkg_extractinnerpfs [--passcode <...>] <input.pkg> <output_pfs.dat>
    Extracts the inner PFS image from a PKG file.

  pkg_extractouterpfs [--encrypted] [--passcode <...>] <input.pkg> <pfs_image.dat>
    Extracts and decrypts the outer PFS image from a PKG file. Use the --encrypted flag to leave the image encrypted.

  pkg_listentries <input.pkg>
    Lists the entries in a PKG file.

  pkg_makegp4 [--passcode <...>] <input.pkg> <output_dir>
    Extracts all content from the PKG and creates a GP4 project in the output directory

  pkg_validate [--verbose] <input.pkg>
    Checks the hashes and signatures of a PKG.

  sfo_deleteentry <param.sfo> <entry_name>
    Deletes the named entry from the SFO file.

  sfo_listentries <param.sfo>
    Lists the entries in an SFO file.

  sfo_new <param.sfo>
    Creates a new empty SFO file at the given path.

  sfo_setentry [--value <...>] [--type <...>] [--maxsize <...>] [--name <...>] <param.sfo> <entry_name>
    Creates or modifies the named entry in the given SFO file.
Thanks

Everyone who helped, either directly or indirectly, but especially the following:
  • flatz
  • idc
And from the PkgEditor Wiki, to quote: PkgEditor

PkgEditor is a GUI tool. You can work with GP4 projects, PKG files, and SFO files.

Usage guide:
Creating PKGs with GP4 Projects

The contents and layout of a PKG file are defined in GP4 project files. PkgEditor allows you to create and edit GP4 files. To create a GP4 project, click File->New->GP4 Project, and choose a name and location for your GP4 project. You can also open an existing project with File->Open.

PKGs require a content id, which should have the format XXXXXX-YYYY00000_00-ZZZZZZZZZZZZZZZZ and be exactly 36 characters long. This uniquely identifies the PKG and should not be shared between any two PKG files.

PKGs also require a passcode, but because we are making fake PKGs this passcode doesn't do anything to prevent people from accessing the PKG's files. You can still set a custom passcode if you want.

If you're making an additional content (DLC) fake PKG, you will need to enter an entitlement key. A default one of all zeroes is provided by default.

Add folders to the PKG by right-clicking in the file view (right side) and choosing New Folder. You can also drag a folder or files into this view, which will add the file or folder and its subfolders and files.

You can enter a Volume Timestamp which will be used as the file timestamp in the PFS image, and the Creation Date which will be put into the PARAM.SFO at build time. Checking the Use time of build? checkbox will override the creation date to whatever the current time is when you build the PKG. Checking the Include time? checkbox will include the date and time in the creation date, while leaving it unchecked will leave just the date (day/month/year).

All PKGs need a param.sfo file in the Image0/sce_sys directory. You should create an SFO with File->New->SFO File, create the SFO, and then add it to the Image0/sce_sys directory by dragging and dropping into the file view.

Click Build PKG when you're done adding files. It will ask for an output filename, the default is the content id.

The Build PFS button is for debugging purposes, you can probably ignore that.

Opening PKGs

Click File->Open and select your PKG file. Double click on the PARAM_SFO entry in the Entries tab to open it in a new tab. Browse and extract files in the Files tab. Right click files to extract.

Editing SFO Files

Click File->Open to open an existing SFO file, or click File->New->SFO File to create a new one.

A user-friendly editor is currently being worked on. You can click the Defaults->Load <..> defaults buttons to get a template for an AC or GD game package. Click on a key/value pair in order to modify it. The changes are reflected in real time in the table. There is not currently an undo feature, but changes are not written to the file until you press Ctrl-S or File->Save.

PKGEditor for PS4 Updated by Maxton with EKPFS  XTS Key Support.jpg
 

Comments

NEMESirS

Member
Contributor
Hi tnx for your efforts
How should i build a gp4 with a high firmware ?
Should i use diskdump.bin payload or plz give me a guideline.

Tnx so much
 

PSXHAX

Staff Member
Moderator
Contributor
Verified
The 'Yes' games on the list are those that can be opened with the Editor using the UE4 default passcode:

Spoiler

As @Al Azif mentions in the Tweet HERE they still contain encrypted binaries so beyond extracting the images/music/etc and making PS4 game mods scene devs are trying some tricks to see if they can get any others working.

I'm also curious if RE3 (43.01 GB) was a QA PKG or not... it appears to be from a similar source, but wasn't on the initial Webcache listing with the other 13 games... if anyone knows more get Verified and join us in the private area.

That said, until someone leaks the SAMU keys (not likely until after the PS4 EOL or beyond) searching for Sony PS4 QA PKGs like the ones that surfaced on 4Chan may be the best hope for new games on older Firmware using the Backporting Method... until the next scene breakthrough / discovery anyway. :geek:
 

Figure03

Senior Member
Contributor
Verified
From Official PlayStation 4 Scene Discord Server:

maxton 22:18 I wrote this wiki page to explain how the passcode is used and how encryption keys are generated

In short, if you don't have the passcode, then you need to have the EKPFS or the XTS data and tweak keys for that PKG.

The commit to which Akex_ linked was just to make it possible to use XTS keys to decrypt a PKG with my tool, because apparently someone has figured out a way to get XTS keys off the console

Vapour 22:21 Oh that's interesting

So means xts keys must not be in samu

maxton 22:22 That, or someone has a SAMU exploit. All the XTS operations are done on SAMU, so there is no reason for the keys to be accessible from the APU

Vapour 22:23 wow that's awesome good work dude

Thank you for the answer
 
Recent Articles
Indie PlayStation 5 Game Soulborn Alpha Trailer by Pixelmad Studios
Proceeding the Godfall PS5 and Outriders PS5 trailers, Indie game Publisher Pixelmad Studios made available a Soulborn Alpha Trailer video of their upcoming PlayStation 5 openworld RPG adventure...
Robotic Co-Op Adventure Biped Joins New PS4 Games Next Week
In addition to Final Fantasy VII Remake arriving on PS4 April 10th, next week the physics-based 3D co-op action-adventure game Biped comes to PlayStation 4 on April 8th. 🤖 Biped places a strong...
Fury Unleashed Blasts Onto PlayStation 4 May 8th, PS4 Demo Out
Reminiscent of classic action platformer video games including Contra and Metal Slug, you play a comic book hero in the combo-driven roguelite Fury Unleashed from Awesome Games Studio which blasts...
Windbound Sails to PlayStation 4 on August 28th, PS4 Trailer Video
The forbidden islands are calling survival adventure fans eager to unravel the mystery as Windbound from 5 Lives Studios sets sail on PlayStation 4 this August 28th. 🌊 ⛵ 🔎 Prepare to explore...
Top