Awesome
GhidraVitaLoader
VitaLoader script for Ghidra
Installation
- Download this script
- Download the JAR of the yamlbeans library
- Open Ghidra and add the JAR path to Ghidra's Edit -> Plugin Path...
- Add the script directory to Window -> Script manager -> Script Directories button in the top right
Usage
- Load your favorite ELF
- (Optionally parse the vitasdk headers, see below)
- Go to Window -> Script manager (or green play button)
- Navigate to the Vita folder and run VitaLoader.java
- Select the vitasdk's db.yml
Parsing vitasdk headers
To take full advantage of this script, I recommend parsing the vitasdk headers before running it:
1. Generating a Ghidra-parsable headers
$ arm-vita-eabi-gcc -P -E $VITASDK/arm-vita-eabi/include/vitasdk.h -D"__attribute__(x)=" -D"__extension__(x)=" -Drestrict= -D__restrict__= > vitasdk_header.h
- Use
vitasdkkern.h
for the kernel headers
- Use
- Now open
vitasdk_header.h
and remove thetypedef unsigned int wchar_t;
(line 3)- If generating the kernel header, remove all the
inline
macros (ksceKernelCpu*Context
,ksceKernelCpuUnrestrictedMemcpy
) - If generating the kernel header, change
SceKernelProcessInfo
'sunk[0xE8 / 4 - 6]
tounk[0x34]
- If generating the kernel header, remove all the
2. Parsing the header
- Open Ghidra and go to File -> Parse C Source... and select
vitasdk_header.h