# ran-j/ps2recomp

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/ran-j-ps2recomp).**

2,689 stars · 74 forks · C++ · gpl-3.0

## Links

- GitHub: https://github.com/ran-j/PS2Recomp
- awesome-repositories: https://awesome-repositories.com/repository/ran-j-ps2recomp.md

## Topics

`ps2` `recompile` `reverse-engineering` `static-recompilation` `tool`

## Description

PS2Recomp is a static recompiler for PlayStation 2 that translates machine instructions from executable binaries into source code to enable execution on modern hardware. It functions as a binary-to-source translator and a binary analysis tool designed to facilitate the preservation of legacy software.

The project distinguishes itself through a hardware emulation runtime that manages memory models and register contexts, combined with a static binary patcher for replacing raw instructions and overriding function bindings. It utilizes a specialized vector unit instruction execution system that maps wide-bit macro mode instructions to hardware-accelerated intrinsics for mathematical operations.

The system encompasses broad capabilities for binary reverse engineering, including function symbol recovery, library stub detection, and the identification of function boundaries via heuristic jump scanning or external symbol databases. It also provides tools for risky instruction flagging and the implementation of custom system calls to extend or override internal function behavior.

## Tags

### Programming Languages & Runtimes

- [Static Binary Translation](https://awesome-repositories.com/f/programming-languages-runtimes/static-binary-translation.md) — Translates PlayStation 2 machine instructions into source code for native execution on modern hardware.
- [PlayStation 2 Static Recompilers](https://awesome-repositories.com/f/programming-languages-runtimes/mips-static-recompilers/playstation-2-static-recompilers.md) — Translates PlayStation 2 machine instructions into source code to enable execution on modern hardware.
- [Binary-to-C Translation](https://awesome-repositories.com/f/programming-languages-runtimes/source-code-compilers/c-source-translators/binary-to-c-translation.md) — Translates machine code binary instructions into static C source code to eliminate the need for interpreters.

### Part of an Awesome List

- [Binary Execution Environments](https://awesome-repositories.com/f/awesome-lists/devtools/build-and-compilation/binary-execution-environments.md) — Ships a runtime environment for executing recompiled binaries using guest memory models and syscall dispatchers. ([source](https://github.com/ran-j/PS2Recomp/blob/main/.gitignore))

### Game Development

- [Retro Game Preservation](https://awesome-repositories.com/f/game-development/retro-gaming-frameworks/retro-game-preservation.md) — Enables the preservation of legacy games by translating original binaries into source code for modern hardware.

### Hardware & IoT

- [Recompilation Runtimes](https://awesome-repositories.com/f/hardware-iot/embedded-robotics/hardware-in-the-loop-simulators/binary-emulators/hardware-accelerated-emulators/recompilation-runtimes.md) — Provides a dedicated execution environment managing memory models and register contexts for recompiled PlayStation 2 binaries.

### Mobile Development

- [Reverse Engineering Guides](https://awesome-repositories.com/f/mobile-development/mobile-infrastructure-security/mobile-reverse-engineering-tools/reverse-engineering-guides.md) — Analyzes stripped executable files to recover function symbols and identify library calls for modification.

### Networking & Communication

- [Hardware State Emulators](https://awesome-repositories.com/f/networking-communication/protocol-emulation-layers/hardware-state-emulators.md) — Implements a runtime environment that manages memory models and register contexts to execute recompiled software.

### Operating Systems & Systems Programming

- [Hardware Emulators](https://awesome-repositories.com/f/operating-systems-systems-programming/virtualization-emulation/hardware-emulators.md) — Simulates physical hardware components, including memory and register contexts, to provide a compatible execution environment. ([source](https://github.com/ran-j/PS2Recomp/tree/main/ps2xRuntime))
- [Binary Analysis Tools](https://awesome-repositories.com/f/operating-systems-systems-programming/binary-analysis-capabilities/binary-analysis-tools.md) — Includes utilities for inspecting binaries, identifying function boundaries, and recovering symbol names.
- [Binary Patchers](https://awesome-repositories.com/f/operating-systems-systems-programming/binary-analysis-capabilities/binary-patchers.md) — Provides a mechanism for replacing raw instructions and overriding function bindings in compiled executables.
- [Binary Instruction Patching](https://awesome-repositories.com/f/operating-systems-systems-programming/binary-instruction-patching.md) — Provides capabilities to overwrite specific machine instructions to resolve stability issues or bugs during translation.
- [Translated Code Patching](https://awesome-repositories.com/f/operating-systems-systems-programming/binary-instruction-patching/translated-code-patching.md) — Modifies specific instructions within the translated source code to resolve bugs or introduce behaviors. ([source](https://github.com/ran-j/PS2Recomp/tree/main/ps2xRuntime))
- [Custom System Call Handlers](https://awesome-repositories.com/f/operating-systems-systems-programming/kernel-core-internals/system-calls/system-call-mapping/system-call-dispatching/custom-system-call-handlers.md) — Allows registration of user-defined function implementations to override system call behavior. ([source](https://github.com/ran-j/PS2Recomp/tree/main/ps2xRuntime))
- [Library Stub Detection](https://awesome-repositories.com/f/operating-systems-systems-programming/library-stub-detection.md) — Identifies common library functions to replace them with runtime stubs or syscall handlers. ([source](https://github.com/ran-j/PS2Recomp/tree/main/ps2xAnalyzer))
- [Runtime Stub Dispatching](https://awesome-repositories.com/f/operating-systems-systems-programming/runtime-stub-dispatching.md) — Replaces identified library functions and system calls with dedicated handlers during execution.

### Software Engineering & Architecture

- [Guest State Emulation](https://awesome-repositories.com/f/software-engineering-architecture/integer-arithmetic/pointer-arithmetic/emulated-memory-access/guest-state-emulation.md) — Implements a guest memory model and register context to provide a compatible execution environment for translated code.
- [Vector Instruction Mapping](https://awesome-repositories.com/f/software-engineering-architecture/performance-reliability/performance-optimization/computational-efficiency/cpu-optimization-strategies/hardware-instruction-targeting/vector-instruction-mapping.md) — Maps wide-bit macro mode instructions to hardware-accelerated intrinsics for high-performance mathematical operations. ([source](https://github.com/ran-j/PS2Recomp/tree/main/ps2xRuntime))
- [Symbol-To-Address Mapping](https://awesome-repositories.com/f/software-engineering-architecture/reference-management/symbolic-reference-tracing/symbol-to-address-mapping.md) — Binds stripped memory addresses to runtime handlers using debug information or external symbol databases.

### Development Tools & Productivity

- [Heuristic Function Discovery](https://awesome-repositories.com/f/development-tools-productivity/binary-boundary-detection/heuristic-function-discovery.md) — Identifies function entry points and code structure through heuristic jump scanning and pattern matching.
- [Vector Instruction Mappings](https://awesome-repositories.com/f/development-tools-productivity/custom-task-functions/compiler-functions/intrinsic-function-declarations/target-specific-intrinsic-mappings/vector-instruction-mappings.md) — Maps wide-bit macro mode vector instructions to hardware-accelerated intrinsics for high-performance math.
- [Stripped Function Mapping](https://awesome-repositories.com/f/development-tools-productivity/debugging-profiling-testing/debugging-diagnostics/debugging-inspection-tools/debugging-and-inspection-tools/runtime-debugging/debug-symbol-stripping/stripped-binary-debugging-tools/stripped-function-mapping.md) — Binds stripped function addresses to runtime handlers using configuration files or exported maps. ([source](https://github.com/ran-j/PS2Recomp/blob/main/README.md))

### Security & Cryptography

- [Symbol Recovery Tools](https://awesome-repositories.com/f/security-cryptography/symbol-recovery-tools.md) — Extracts function names and addresses using debug information and reverse-engineering tool exports. ([source](https://github.com/ran-j/PS2Recomp/tree/main/ps2xAnalyzer))
- [Function Boundary Discovery](https://awesome-repositories.com/f/security-cryptography/symbol-recovery-tools/function-boundary-discovery.md) — Discovers code structure in binaries using debug symbols, heuristic jump scanning, or symbol databases. ([source](https://github.com/ran-j/PS2Recomp/blob/main/ps2xAnalyzer/Readme.md))
- [SDK Symbol Recovery](https://awesome-repositories.com/f/security-cryptography/symbol-recovery-tools/sdk-symbol-recovery.md) — Matches stripped library functions against known symbol databases to identify kernel and system calls. ([source](https://github.com/ran-j/PS2Recomp/blob/main/ps2xAnalyzer/Readme.md))
