/gta-reversed

Reversed code of GTA:SA executable (gta_sa.exe) 1.0 US

Primary LanguageC++

gtasa-reversed Build Status

A project to reverse Grand Theft Auto San Andreas completely, and to rewrite and document every function.

Discord

Join our discord server. You can request us to decompile a function for you. If you wish to contribute, then we'll be happy to assist you.

What exactly is this project?

Building this project will result in a DLL file, that DLL file can be injected into GTA:SA using any ASI loader out there. After the DLL file has been injected, the ingame functions will be replaced by the reversed code. The game will behave exactly the same. Now if we make any changes to the reversed code, it will take effect in the game. The goal is to keep reversing until we have the entire game reversed to compile a standalone executable.

Progress

The progress of reversed classes can be tracked here.

Coding Guidelines

Before you start writing code, please make sure to read the coding guidelines for this project.

Requirements

Game

You can download this in a single archive. Using other plugins is strongly discouraged.

Build Instructions

You can either build with Premake5 or CMake, that's up to you.

First of all clone the project, including the submodules:

git clone --recurse-submodules https://github.com/codenulls/gta-reversed.git
Premake5
  1. Execute premake5.bat (Visual Studio 2019 is required)

  2. You'll find gta_reversed.sln shortcut in the same folder as premake5.bat.

CMake
  1. Download and install latest CMake for windows from HERE and make sure to add it to your PATH.
GUI
  1. Open CMake GUI

  2. Set the Source and Build directories (Don't forget to append "Bin" after the path for build), like this:

Capture

  1. Click configure, you'll see a dialogue box. Choose "Visual Studio 16 2019" and "Win32," then click Finish.

CMakeSettings

  1. Once configuration is complete, click the Generate button.

  2. You'll find GTASA.sln in Bin folder.

CLI
  1. Open Command Prompt in the gta-reversed directory and run cmake -Bbuild -H. -A Win32.

  2. To open the Visual Studio project, simply run cmake --open build or open build/GTASA.sln manually.

  3. Once configuration is complete, click the Generate button.

  4. You'll find GTASA.sln in Bin folder.

Preparing Environment (Optional)

For better experience you can create symlinks for artifacts and you no longer need to copy files every time.

Run console (administrator privileges may be needed) and type these commands (don't forget change paths).

cd "c:\Games\GTA San Andreas\scripts"
mklink gta_reversed.asi c:\Games\gta-reversed\Bin\Debug\gta_reversed.asi
mklink gta_reversed.ilk c:\Games\gta-reversed\Bin\Debug\gta_reversed.ilk
mklink gta_reversed.pdb c:\Games\gta-reversed\Bin\Debug\gta_reversed.pdb

Credits