Games and modsResearchSource available
Target: Bloodborne (PS4, CUSA03173 1.09)

Recompiled Bloodborne (PS4) into a native library with static recompilation

Platform
macOS (arm64/x86-64)
Outcome
Research

Evidence at a glance

Loading source evidence…

What was done

The project provides a static recompiler that translates Bloodborne's PS4 x86-64 executable into C code, allowing it to run as a native library on other platforms. It aims to remove translation layers and improve performance by executing game logic directly on the host CPU.

The bloodborne-recomp project is a static recompiler designed to transform the Bloodborne PS4 executable into native code. By reading the game's x86-64 binary and writing functions as C, the tool enables the creation of a native library that the game loads during execution. This process removes the overhead associated with dynamic translation layers, which typically simulate PS4 system calls and GPU interactions. The recompiler handles approximately 99% of the game's functions, with the remaining code processed by a CPU translator. The project utilizes Claude Opus 5.5 to assist in naming functions, identifying object layouts, and documenting engine components such as render states and GPU address readers. While the recompiled code is architecture-agnostic, the game still requires a runtime environment to handle PS4-specific system calls and GPU commands. The project maintains a fuzz testing suite to verify instruction correctness against an interpreter. The recompiler does not distribute game code; instead, it provides a launcher that builds the library locally on the user's device using a trimmed LLVM toolchain. Source: https://raw.githubusercontent.com/bloodborne-native/bloodborne-recomp/HEAD/README.md

Reproduce it

setup

Clone the bbcpu repository, build the recompiler, and run the provided Python scripts (ps4elf.py, pointers.py, scan, imports.py, and recomp.sh) against a valid dump of the game (CUSA03173, 1.09). The resulting library is loaded via the BB_RECOMP_LIB environment variable.

Community

Ask a question, share what worked, or follow the next milestone.

Your library