Decompilation of Sly Cooper and the Thievius Raccoonus for the PS2
Go to file
2023-11-26 20:23:14 -05:00
src Merge pull request #19 from TheOnlyZac/file-iso 2023-11-26 19:43:04 -05:00
test Added splice lib target 2022-07-20 22:19:30 -04:00
tools Wording and layout tweaks 2023-02-21 18:01:45 -05:00
.gitattributes Add .gitignore and .gitattributes. 2021-11-08 19:59:05 -05:00
.gitignore Wording and layout tweaks 2023-02-21 18:01:45 -05:00
CMakeLists.txt Added splice lib target 2022-07-20 22:19:30 -04:00
CMakeSettings.json Fixed some stuff and made more progress 2023-05-24 20:49:35 -04:00
CONTRIBUTING.MD Added contributing.md 2023-02-21 18:16:49 -05:00
README.md Update readme 2023-11-26 20:23:14 -05:00

Sly Cooper and the Thievius Raccoonus

Build status Discord Channel Wiki Contributors

This is a work-in-progress decompilation of Sly Cooper and the Thievius Raccoonus for the PlayStation 2. It is based on the NTSC-U version of the game (SCUS-971.98). Documentation of the game's internal structures and mechanics can be found on the SlyMods Wiki.

The goal of this project is to better understand how the game works. This repo does not contain any game assets or code from the game's executable.

New contributors are welcome and encouraged to make a pull request! If you would like to help but aren't sure where to begin, you can join our Discord server and/or read CONTRIBUTING.md for info on how to get started.

Frequently Asked Questions

What is a decompilation?

When the developers created the game they wrote programming code that we call the source code. Then they compiled the source code into machine code that can run on the PS2. Our job is to reverse-engineer the compiled code and produce new, original code that behaves the same way. This process leaves us with code that is very similar (but not identical) to the source code and helps us understand what the programmers were thinking when they made the game.

How does it work?

We use a tool called Ghidra which was created by the NSA for reverse-engineering software. Ghidra analyzes the game binary to identity functions, variables, data types and structures. We then reimplement each individual function by writing C++ code that produces the same output. We do not copy/paste any code or include any original assembly code from the game binary in the decompilation.

Has this ever been done before?

This is one of the first large-scale PS2 decompilation projects. We take inspiration from other projects like the Super Mario 64 decomp for the N64 and the Breath of the Wild decomp for the Wii U (the latter being more similar in scope to this project). There is also a Jak & Daxter decomp/PC port called OpenGOAL, though that game is written in 98% GOAL language rather than C/C++.

Is this a matching decomp?

Most of the decompiled code is not yet matching. We are actively researching the PS2 compiler and working to come up with with a process for function matching.

How can I help?

If you would like to contribute but have no idea where to start, you can join our discord server and/or read CONTRIBUTING.md for some resources and advice to get started!

Getting Started

Windows/Linux - CLI

Prerequisites: gcc, cmake, ninja

git clone https://github.com/TheOnlyZac/sly1
cd sly1
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .

To build unit tests, cd into the build directory and run cmake --build . --target check or make check. Run them with ctest -C Debug.

Windows - Visual Studio

Prerequisites: C++ CMake tools for Windows

Clone the repo and open Visual Studio. Click File > Open > CMake... and open the file CMakeLists.txt in the main project folder. Set the startup item to SCUS_971.98.

For unit testing, build the target "Check" and the tests should appear in the Test Explorer window. It will run the tests, and the results will show in the Test Explorer as well as the Output window.