Add reverse engineering PS3 info, add patch server notes

This commit is contained in:
Joshua Goins 2024-04-16 00:02:30 -04:00
parent fa6bc0d294
commit 8158cebf9b
3 changed files with 60 additions and 0 deletions

View file

@ -0,0 +1,3 @@
---
title: "Reverse Engineering"
---

View file

@ -0,0 +1,51 @@
---
title: "PlayStation 3"
---
In [mid-2017 Square Enix officially ended support for the PlayStation 3 version](https://na.finalfantasyxiv.com/lodestone/topics/detail/a8db3b52eae5f11037a16ef7a637368a2ec5ed08). This guide covers how to crack open and mess with the game files, assuming you have a legitimate retail copy. Unfortunately reverse engineering PS3 games is slowly becoming a lost art, I hope to give a quick guide on how to do so.
# Obtaining a copy
The PS3 version of A Realm Reborn was printed on disc, so it's still [possible to buy a retail copy](https://www.amazon.com/Final-Fantasy-XIV-Realm-Reborn-Playstation/dp/B002BRZ79E) even with digital downloads being defunct. I will assume you have one and have already dumped an ISO or some other kind of mountable backup.
# Dumping the contents of the disc
Inside of the disc is a big folder structure, but we can ignore most of it as we're not interested in installing this on a real PS3. Refer to the diagram below to find the `INSTALL.PKG` which contains the game files:
```shell
/ PS3_GAME
/ PKGDIR
/ PKG00
> INSTALL.PKG <
```
Move this file to another location, as that's all we need from the disc.
# Dumping the .PKG file
This is a ["software update package" or PKG](https://psdevwiki.com/ps3/PKG_files) used for installing the game on a PS3. These are encrypted and compressed, but there is a software tool called `pkgrip` which we will use to extract it's contents. Clone and build the tool from [here](https://git.sr.ht/~redstrate/pkgrip) and then run it:
```shell
$ pkgrip INSTALL.PKG
...
```
This process should only take a few minutes and dump the file tree into your current directory.
Once the contents of the PKG file are dumped, you'll see a very similar looking file structure to the file game. There are a few excpetions:
* The [Bink video files](https://www.radgametools.com/bnkmain.htm) under `game/movie/ffxiv` are "pam" files. No idea what those are yet.
* The `dat0` and `index` files are suffixed with `ps3` instead of `win32`, of course.
* Curiously, there are `sdat` files as well. Maybe these are encrypted?
* There are no `.exe`s because of course PS3 isn't Win32. See below for peeking into these.
# Decrypting the executable files
Executables on the PS3 are [signed and encrypted](https://www.psdevwiki.com/ps3/SELF_-_SPRX) so you will need a tool like the [TrueAncestor SELF Resigner](https://www.psx-place.com/resources/trueancestor-self-resigner-by-jjkkyu.33/)[^1] or scetool. It cannot be bruteforced by unself, so don't even try. If you need keys for scetool, the SELF Resigner has provided the correct keys to decrypt the game's executables.
In either tool you simply put in the `.self` files and then they pop out as proper `.elf` files.
## Ghidra
To be able to actually decompile anything useful in [Ghidra](https://ghidra-sre.org/), make sure to select the `PowerISA-Altivec-64-32addr` language when asked (it's not recommended usually.) Make sure it's the Big Endian version, too.
[^1]: Can also be found on [archive.org](https://archive.org/details/true-ancestor-self-resigner-v-1.98).

View file

@ -2,6 +2,12 @@
title: "Patch"
---
These servers provide patch files that are consumed by the [patcher](/executable/ffxivupdater) and the [boot](/executable/ffxivboot) executables.
## Console updating
The PS3 and PS4 versions of the game used to use the same patch system as the Windows version. That changed [in 2018 when Square Enix moved to updating through PSN](https://na.finalfantasyxiv.com/lodestone/news/detail/2b63219b37d83601618341b5a7876d9a6c72a774). Trying to contact the patch servers with PS4 patch requests will return a 404. And of course since the PS3 version is defunct, that also doesn't work.
{{< note "This documentation is incomplete." >}}
# Alternative Implementations