-
Notifications
You must be signed in to change notification settings - Fork 0
4. Repacking game data
Repacking is considered an advanced operation and there are several things to keep in mind before continuing, which include the following:
- This guide assumes you have already extracted the game data. If that is not the case, check the Extracting game data page
- You should use smaller or equal sized files whenever possible for maximum stability
- If a file is in a subfolder and it's in the "large-buffer area", the maximum file size is 512kiB (e.g. the .BD files and mission .TM2 files)
- Regular files inside subfolders cannot be resized (for now)
- The following tools are required: FlipnicFileTools (version 2.1 or later) and FlipnicBinExtractor (the latter is needed if you want to insert new files to or remove files from STR.BIN or TUTO.BIN)
- If you are resizing the .ISO file (only needed when you replace a file with a bigger one), you are going to need 5.4GiB of available RAM, this is a limitation of Ps2IsoTools, which FFT depends on. If you are just replacing it with a file that has the same size (or is smaller), this is not a requirement.
These files are special, because technically they are inside a folder, but they are still read with a large buffer, like files outside of folders. These can be easily identified if you open the .BIN file inside the hex editor. Look for all entries between "*Top Of CD Data" and "*End Of CD Data". Any entry, which has a name that contains a backslash (\), but doesn't end with it is inside a subdirectory and in the large buffer area.
Optional: If you are using ImHex, you may want to use this pattern file to highlight file entries.
Flipnic file tools is recommended in this case. First list the files:
FlipnicFileTool --list-files --input <Container file>
Find the file you want to replace. Copy the value in Path column, that is going to be the "TOC entry" value.
Now find the file you want it to be replaced with, copy its full file path, that will be the "Replacement file" value.
To repack the .BIN file, use this command, replacing arrow paranthesis and anything inside them with values from earlier:
FlipnicFileTool --replace-file <TOC entry> --input <Replacement file> --output <Container file>
If the replacement file is the same size or smaller, the repacking will immediately begin and you'll be notified whenever the operation is complete. If the replacement file is bigger, a warning is displayed. Press "Y" if you are sure and want to continue (keeping in mind it's a risky operation).
In case you want to add or remove files from a container, this is what you want to do. Note that subfolders are NOT supported yet, only large buffer root directory files are supported (i.e. STR.BIN and TUTO.BIN). FlipnicBinExtractor is required in this case.
First extract all of the files to a specific directory:
FlipnicBinExtractor /e <Container file> <Output folder>
Next, add or remove any file you want inside the output folder, after which you can create a new .BIN file using this command:
FlipnicBinExtractor /c <Folder where extracted files are located> <Path to new .BIN file>
There are several methods for this, but FlipnicFileTools does actually have the ability to repack the .ISO file, so that's what we're going to be using.
WARNING: This will modify the ISO file directly, make sure you backup the original game dump!
To modify a file inside the .ISO file, you can use the command syntax:
FlipnicFileTool --replace-iso <ISO file entry> --input <Modified container file> --output <Game ISO file>
ISO file entry is basically the path to the file you want to modify inside the .ISO file.
After creating the .ISO file, you can simply drag and drop it to the PCSX2 window, which should start up the game. One of the following things may happen:
- The game boots successfully and everything works - this is what you want to see
- The game boots to a blank screen and nothing happens - indicates a failed repack, most common cause is trying to repack a file in subfolder stored at the large-buffer area that is larger than 512kiB
- The game doesn't boot at all and crashes the emulator - indicates a failed repack, probably bad TOC pointer values
- The game boots, but crashes or freezes at a specific point - may indicate a missing or corrupt game file
If you have a mod-chipped PS2, burning to a single-layer DVD recordable disc should be fine, however unmodded consoles will not like it when you use burned discs. There are several methods to bypass this, such as:
- HDD/USB/Network/SD card with Open PS2 Loader (OPL)
- Burning FreeDVDBoot ESR patched disc