Saki's Romhacking Shenanigans

It is what it is!

Modding The Silver Case (Part 2): 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.

Sidebar

Add widgets here from the Widgets panel in the WordPress admin.