Environment Setup & Toolchains
Comprehensive setup guide for host cross-compilation environments (VitaSDK, vdpm, CMake), reverse engineering pipelines (jadx, Ghidra), and mandatory PS Vita kernel bridge plugins.
🛠️ Workstation Setup (Host)¶
1. VitaSDK Cross-Compilation Toolchain¶
VitaSDK provides arm-vita-eabi-gcc and associated binary utilities for building ARMv7 homebrew on PlayStation Vita.
# Install prerequisites
sudo apt-get update
sudo apt-get install -y build-essential cmake git curl python3 xz-utils
# Set environment variables in ~/.bashrc
export VITASDK="$HOME/vitasdk"
export PATH="$VITASDK/bin:$PATH"
git clone https://github.com/vitasdk/vdpm.git
cd vdpm
./bootstrap-vitasdk.sh
./install-all.sh
Verify your setup:
2. Mandatory Porting Libraries via vdpm¶
Install foundational graphics, audio, and compression libraries:
3. Production CMakeLists.txt Boilerplate¶
Every modern SoLoader port uses a standard CMake structure linking VitaSDK and vitaGL:
cmake_minimum_required(VERSION 3.20)
project(game_vita C CXX)
if(NOT DEFINED ENV{VITASDK})
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
endif()
include("$ENV{VITASDK}/share/vita.cmake" REQUIRED)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -mfloat-abi=hard -ffast-math -fsigned-char")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -mfloat-abi=hard -ffast-math -fno-rtti -fno-exceptions")
add_executable(game_vita
src/main.c
src/so_util.c
src/falso_jni.c
src/patch.c
src/gl_util.c
)
target_include_directories(game_vita PRIVATE
include
$ENV{VITASDK}/arm-vita-eabi/include/vitaGL
)
target_link_libraries(game_vita
vitaGL
vitashark
SceShaccCgExt
taihen_stub
kubridge_stub
mathneon
openal
vorbisfile
vorbis
ogg
SceAppMgr_stub
SceCommonDialog_stub
SceCtrl_stub
SceMotion_stub
SceTouch_stub
SceAudio_stub
ScePower_stub
)
vita_create_self(eboot.bin game_vita UNSAFE)
vita_create_vpk(game.vpk "GAME00001" eboot.bin
VERSION "01.00"
NAME "Sample Port"
FILE livearea/icon0.png sce_sys/icon0.png
FILE livearea/bg.png sce_sys/livearea/contents/bg.png
FILE livearea/template.xml sce_sys/livearea/contents/template.xml
)
4. Reverse Engineering Suites¶
- jadx (Decompile APK DEX bytecode into readable Java):
- Docker +
devrvk/so-decompiler(Headless Ghidra Decompiler): - VitaSDK Binary Analysis Tools:
🎮 Required Kernel Plugins on PS Vita¶
For VitaOS to execute dynamically mapped userspace code and provide POSIX compatibility, these kernel plugins must be loaded in ur0:tai/config.txt:
1. kubridge (by TheFloW)¶
- Repo: TheOfficialFloW/kubridge
- Role: By default, VitaOS userland applications are prevented by W^X protections from creating memory blocks with simultaneous Read, Write, and Execute (RWX) permissions.
kubridgeexposes kernel services likekuKernelAllocMemBlock, allowing the loader to allocate executable memory for the.soimage.
2. fd_fix (by TheFloW)¶
- Repo: TheOfficialFloW/fd_fix
- Role: Prevents kernel crashes when an application closes duplicate or invalid POSIX file descriptors, ensuring standard I/O semantics match Android's Bionic behavior.
[!CAUTION] Attempting to boot an SoLoader port without
kubridge.skprxactive will cause an immediate crash (C2-12828-1) or black screen on launch before the game's first instruction executes.