Home

Awesome

VitaLoader Redux

A Ghidra extension for PlayStation®Vita reverse engineers! This extension contains a loader for ELF-PRX modules, MeP-c5 processor and helper scripts.

Features

Redux can be used in place of the ELF loader provided by Ghidra to load executables in ELF-PRX format targeting the PlayStation®Vita platform. This loader does NOT support standard ELF executables - only use it for ELFs in PRX format.

New features

NID Analyzer

Naming of imports and exports using a NID database is no longer performed at import time. Use the new NID Resolution analyzer instead. Analysis can be performed multiple times with different database files.

The database used for analysis can be changed in the analyzer's settings (Analysis > Auto Analyze '<program name>' and select NID Resolution).

The following database sources are available:

The default database source is Environment if available, and Builtin otherwise.

To apply NIDs from multiple databases successively, untick the Clear old names setting.

Variable import relocation

Variable imports are now supported and handled properly! This also applies to function-as-variable imports. A special memory block is created to "store" all imported variables, and relocations are applied so that all code inside the module that accesses them will access them inside the special memory block.

The variable import memory block can be customized at import time by clicking on the Options... button in the Import dialog. (The dialog where Executable Type is selected)

Due to the way relocation is performed, certain code patterns will confuse the decompiler. For example, C code that should read as

if (&sceWeaklyImportedFunction != NULL) {
   sceWeaklyImportedFunction();
}

will transform info something similar to

if (true) {
   sceWeaklyImportedFunction();
}

i.e. the condition will always evaluate to 1.

However, the assembly will now hold a reference to the import thunk, which can be used to figure out what the properly decompiled code should look like. Users should always be wary of if (true) and if (false) tests as they usually hide a subtlety the decompiler is unable to recover. Note that the affected code patterns are seen only in a few modules (e.g. SceDisplay), so this limitation should not be an issue for most reverse engineering tasks.

Utility scripts

Can be found in the Script Manager under the Vita category.

MeP-c5 support

Installation

Download the latest release for the Ghidra version you use. Open Ghidra, select File > Install Extensions..., click on the green + and select the .zip file you just downloaded. A dialog asking you to restart Ghidra should appear, do so in order to complete the installation.

Updating

Open Ghidra, select File > Install Extensions... and untick the checkbox next to VitaLoaderRedux. This step may be unnecessary. Close Ghidra and follow the install instructions again.

Building

Install Gradle then run gradle in a command prompt. Make sure to pass -PGHIDRA_INSTALL_DIR=<path to Ghidra install> if the environment variable GHIDRA_INSTALL_DIR is not set.

Building the extension for a version of Ghidra earlier than 10.3 is not supported.

Bug reports

Please report any error encountered with Redux in the Issues Tracker.

Before submitting any bug report:

Known bugs

None.

Future plans

The following features might be implemented in Redux:

Credits

Special thanks for pre-release testing and various input:

License

This repository is covered by the Clear BSD License, except the third-party libraries in the lib/ directory which are covered by the licenses listed in lib/LICENSES.