psx-modding-toolchain | ||
.gitignore | ||
lectures.txt | ||
README.md |
CTR-ModSDK
ModSDK. (noun) A toolkit that allows you to create mods for Crash Team Racing (1999) in C.
This repository also houses an effort to fully decompile and reverse-engineer CTR in C.
This SDK uses:
- psx-modding-tools by mateusfavarin for injecting and testing code
- CTR-Tools by DCxDemo for parsing and extracting the game files
📃 Features
- Extract and build ISO in few steps
- Supports all retail versions and two prototypes
- Compile C code into any address and overlay
- Integrated Xdelta patch generation
- Hot Swap: Load code replacements while the game is running
🏁 How to Start Modding
Requirements
- python 3+
- Open command prompt (CMD/Terminal) and install the dependencies:
pip install requests
pip install opencv-python
Downloading the SDK
Clone this repository:
$ git clone https://github.com/CTR-Tools/CTR-ModSDK.git
- You can find example mods in our repo.
- Each mod folder includes a
readme.txt
file on what the mod does and how to use it. - To build a mod, simply run
build.bat
in the mod folder.
CTR-in-C
Work-in-progress project to decompile Crash Team Racing into human-readable C code.
📊 Progress
Decompilation, Research and Documentation
Decompiling the binaries assisted by Ghidra, researching how it works and documentating them with comments.
Code Rewrite
Rewriting Ghidra output to human-readable C Code and testing if it's functional. Most of the source code are shared between versions.
* These are not accurate numbers and subject to change.
🤝 Contributing
Are you interested in contributing? Have any experience in C programming language? You're welcome to join!
How to rewrite functions:
- Make sure you have cloned this repo and installed the requirements.
- Choose a .c file from ghidra folder. Each file represents a code section or category. All non-numbered .c files are parts of the main EXE while the numbered files are overlays.
- Choose a function in that section to rewrite. Read the documentation comments on what the function does and what's the address.
- Add a new line for your new function to buildList.txt with this format:
common*, exe**, <name of original function to replace>, 0x0, <rewritten function .c file>
* Build codenames:
common: All versions;
926: USA Retail;
1006: Japan Trial;
1020: Europe Retail;
1111: Japan Retail.
** Code region:
exe: main EXE;
221-233: Overlays (use the original .c filename number)
- Run
build.bat
and choose "Compile", "build ISO", then test the game. - After you've confirmed that it's functional, add your new function c file to the decompile directory.
- Now you can make a pull request
If you have any questions, reach us out in our Discord server.