Saki's Romhacking Shenanigans Mk.II

PS4 Modding Guide: The Silver Case   

NOTE: This guide was originally released as a series of three posts released over the span of four days. As they all concern the same topic, they will be consolidated here, with the original structure preserved as chapters.

NOTE 2: Information about how to jailbreak your console are obsolete, you're better off following any guide that's been updated and maintained, notably for the "new" 12.02 exploit.

I - Console Modding & Game Dumping

As some of you might know, a few years ago I, along with my homies Sytarie and Rapa made a french translation for The Silver Case on Steam. It wasn’t perfect in any way but I still cherish the project to this day! As I was able to acquire a copy of the Silver2425 compilation for my PS4 a few years ago, I decided that porting our patch to as many versions as we can would be a good thing. My first (unfruitful) attempt at this was done two years ago, it is documented in the following Twitter thread.

In this post, I will go through the steps we must follow in order to play a modded game on a PS4:

We are good to go! Now that our game has the default passcode 0000000000000000…0, we can finally install whatever modded files we want over it.

II - Extracting & Repacking

Our previous post explained how to prepare a game for modding. Today, it’s about time we do the actual modding part!

The game was made with Unity. As such, its mostly comprised of .assets files, just like the PC version, with one particularity: the heaviest (and most important) assets have been compressed within a .psarc archive, a proprietary format used by Sony games since the PS3 era.

General folder layout. The “Media” folder contains some .assets files, as well as a “StreamingAssets” folder which contains the game’s videos as .MP4s.

In 2020, I used a tool named Karameru to extract the .psarc archives. This time I used Noesis, a tool widely-used to preview 3D models from different formats, but also for extracting some types of archives, which .psarc is part of.

Right-clicking on the archive and selecting “Export” allows us to extract it wherever we want.

Once the archive is extracted, we can treat its contents like a usual Unity game folder. Unfortunately, this means more extracting and repacking but it won’t be a problem, as this time we have the whole Unity modding community behind our back!

My favorite tool for extracting Unity .assets files is AssetStudio, a software that has been faithful to me since 2019, when I first used it on the PC version of the game. It’s very easy of use for previewing and extracting the contents within the archives, but it unfortunately does not support reimporting/repacking.

When we use the “Load folder” option on our extracted archive, we can see all the TextAsset (JSON messages) and Texture2D (image textures) we need to replace. We can extract them by using the “Export” option.

Once the files we want are extracted, we can edit them to our leisure. I won’t elaborate much on this part, but one thing I can say is that AssetStudio does its best to convert the assets into commonly-used formats: .txt/.json files for the TextAsset files, .png files for the Texture2D ones, .wav for the AudioClip… Surely, we won’t have much research works to find software able to work with these file formats!

Anyway, after editing the extracted filed to our will, we will reimport them with a russian tool called UnityEX (YandexDisk mirror). Just like AssetStudio, it’s a tool I got familiar with in 2019, when I worked with the PC version. It has been helpful enough for me to donate to its developer in order to get all the features of the program, such as the Unity 2020-2021 support (more on that on the official forum thread) but we can work with the freeware version as well, since the game has been compiled with Unity‘s 2016-2017 SDK!

UnityEX in action on the game’s “resources.assets” archive.

Unlike AssetStudio, UnityEX only opens one file at a time, which doesn’t matter since all the content we need is stored within the resources.assets file. When we open an archive within UnityEX, we can extract the files by right-clicking them, then by pressing “Extract with convert or Raw”: this will convert a file to a more common extension if it’s known (like AssetStudio does), or leave it as-is.

The extracted files go to a new folder named “Unity_Assets_Files“, which will contain another folder bearing the same name as our .assets file, in this case resources.

By hitting the “Import all files” button in UnityEX, the program will look all the files from the folder mentioned above, compare the filenames to the ones within the opened .assets archive, then replace each matching occurence. Any .png file is automatically converted into a .tex Texture2D file, then reinserted in the archive. If the program finds a filename that doesn’t correspond to anything in the archive, it will give a warning and askip if we want to continue anyway.

You might not see the difference, but the green bar being halfway through is a sign of the importing process being in progress.

Now that the resources.assets has been edited, it’s time to do the whole process… Backwards! First, we need to repack the folder containing the extracted .assets files back to a .psarc file. This time, instead of Karameru, I used Total Commander, a freeware file manager which had the benefit of supporting .psarc repacking thanks to a third-party plugin by BEKETATA.

Right-clicking on the folder, then clicking “File > Pack…” does the trick.

And… that’s it! Now, we have our modded archive.psarc file, ready to get inserted back into the game. As there are multiple ways of doing that, which both take a fair amount of time and dedication, I will document them in a final post, one that will get more focused on the PS4-side manipulation than the PC one.

Our custom videos folder, as well as our modded archive, are ready to go. The archive_og.psarc file is a mere emergency backup.

III - Replacing & Distributing the mod

Welcome to the final part of my series of post focused on the modding of a PS4 game!
Since we’re approaching the end, allow me to rant a bit about a detail that would’ve saved me a fair amount of time if I knew about it beforehand.

As I already noticed in 2020, PS4 games are encrypted inside .PKG files even once they are installed, and the only way to decrypt them is by booting the game up on the console.

The game’s folder on the PS4, as seen by connecting through FTP. The whole game is encrypted and gets decrypted only on runtime.

As such, one would think that, in order to mod a PS4 game, we would need to repack the whole Fake PKG and reinstall it each time we modify a file. That’s what I did for my first dozen of tries, and the process was TEDIOUS! Imagine doing the whole process of Part 1 each time a mere file was modified, the waste of time was absolute between the PKG repacking (about 30 minutes), the transfer to USB (5-10 minutes), the actual installation (10 minutes) and finally booting the game up: a whole hour of NOTHING, urgh.

I thought I could finally seek salvation after finding out about PS4 Patch Builder but nope, it was the same, perhaps even worse. In order to use the program I needed a backup of the whole game as a PKG and an Image0 folder with all my modded files, and, for some reason, the program didn’t function if said folder didn’t also have all the other files, which means that I know had the equivalent of two backups occupying my space for nothing! After hitting that Build Package button it would take around half an hour to generate the “Update” PKG so really there wasn’t much benefit to using that method, if not to generate a slightly tinier PKG than before, at the expense of having 3 copies of the game lying on my Hard Drive with no benefits.

A screenshot of the program, provided by its creator, MODDED WARFARE.

Now that this is out of my way, allow me to introduce you to the actual way of modding a PS4 game, the Holy Grail of modding, a technique similar to the Switch’s LayeredFS file replacement: AFR (Application File Redirector)! I will speak exclusively about GoldHEN‘s implementation of it (as a plugin), but it was originally made by theorywrong for the Mira Project.

GoldHEN’s plugins usage guide.

As its name indicates, while the game is running, AFR replaces the games files with the ones we’ve put in a custom folder, eliminating all needs from repacking the PKG each time we want to edit a file. This method works with disc copies and legit PKGs!

The first thing we need to do is to download the GoldHEN plugins from the GitHub repository. Once downloaded, we need to edit the plugins.ini file to enable the plugins we are going to use, and to tell which games we are going to load the plugins for. As I want to apply the plugins to any game, the file would look like this:


; Note: lines starting with semicolon are for comments.
; Load plugins for any title.

[default]
; Load the AFR plugin 
/data/GoldHEN/plugins/afr.prx

; Load plugins only for Playroom.

[CUSA00001]
/data/GoldHEN/plugins/afr.prx
/data/GoldHEN/plugins/no_share_watermark.prx



With the .ini file modified, it’s time to put the plugins.ini file and the plugins folder in your PS4, into the/data/GoldHEN/plugins/ folder (we can do that by USB or by FTP).
Now, we can run GoldHEN and enable the plugins in the Settings > Debug Settings > Plugins > Enable Plugins Loader section.

Enabling the Plugins Loader.

For each game we want to modify, we simply need to create a folder bearing the game’s TitleID inside of /data/GoldHEN/plugins/AFR/, and place all of our modified files here.
If everything was done correctly, we will see the difference each time we boot up the games with AFR enabled.

The Silver Case’s intro, replaced with Andrea Bruno’s Sumio Mondo THUG Pro Mod Trailer.

There are a few ways of distributing our modded data to the public, each with their pros and cons:

The difference speaks for itself!

And thus, our long guide finally comes to an end. Now, we are able to jailbreak a ps4 console, dump any game we want, modify its contents (we covered the case of a Unity game) and run the patched contents on the console as easily as possible. Thank you for reading this blog, I will come back for more Sony-oriented romhacking articles soon!

Previous Page