Library / SDK
gta-reversed/gta-reversed avatar
gta-reversed/gta-reversed

gta-reversed: reimplementing Grand Theft Auto San Andreas in C++

Reimplementation of GTA:SA 1.0 US

1,148 stars263 forksC++License varies

At a glance

What is it?
gta-reversed is a project to reverse Grand Theft Auto San Andreas function by function and rewrite every one of them in modern C++, currently estimated at 50 to 60 percent complete. Building it produces a DLL that replaces the game's own functions at runtime through an ASI loader, with the longer-term goal of compiling a standalone executable.
Who is it for?
gta-reversed fits a reverse engineer who wants the game's logic as readable, documented C++ rather than as an opaque executable, and it fits a modder who wants to change a function and rebuild the DLL. It does not fit anyone without the original game and assets, since the build targets a specific executable and the injection model assumes you own the game.
Can I use it commercially?
Not without permission. GitHub finds no licence file in the repository, and without a licence all rights are reserved by default: you may read the code but not reuse it. Check the README, or ask the authors, before using it.
Is it still maintained?
Yes. The repository last received commits 1 day ago.
What is it written in?
Mainly C++, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on October 23, 2026, and from our analysis. They are not legal advice.

Editorial analysis

The deliverable is a DLL that swaps the game's own functions

The project is described as an attempt to reverse Grand Theft Auto San Andreas completely, and to rewrite and document every function. The documentation of the approach is specific about how that works today.

Building the project results in a DLL file that can be injected into GTA:SA using any ASI loader. After the DLL is injected, the in-game functions are replaced by the reversed ones, and the game behaves the same. And then the point becomes clear: if any change is made to the reversed code, it takes effect in the game.

That is the whole thesis of the project. The value is not a mod. The value is that a large body of game logic, which normally exists only as machine code inside a shipped executable, becomes source code that can be read, reasoned about, changed and compiled with a modern toolchain. The stated goal is to keep reversing until the entire game is reversed and can be compiled as a standalone executable.

The scale of the work is stated as a rough estimate rather than a plan. Progress of reversed classes is tracked in a document at `docs/ReversedClasses.md`, and the current estimate is that about 50 to 60 percent of the code is done. Because the project is a hobby worked on at irregular intervals, there is no time estimate on when it will be finished. That is an unusually candid thing for a project to publish about itself.

The code is C++ and the repository is organised for modern tooling, with a `CMakeLists.txt`, `CMakePresets.json`, a `conanfile.py`, a `setup.py`, a `cmake/` directory and a `source/` directory, plus `.clang-format` and `.clang-tidy` configuration files.

The build is Conan, CMake and Visual Studio, with a Python wrapper

The requirements are listed as four things: Visual Studio 2026, Python 3.x or newer for Conan, Conan 2.x or newer, and CMake 4.2.0 or newer.

The setup has three steps, and the first is Conan itself. You install the latest Python with the Add to PATH option ticked, install Conan with `pip install conan`, and if this is your first time, also run `conan profile detect`.

The second step runs the setup script, `python setup.py`, which defaults to the `windows-msvc` x86 Debug configuration. A different configuration needs Conan settings passed through, for example `python setup.py -s arch=x86 -s build_type=Release`, or a custom profile. After that you open the folder with Visual Studio's native CMake integration by right clicking and choosing Open in Visual Studio, and the documentation notes that the `.sln` generated by CMake should work as well, though the CMake integration works somewhat better. If you just want to build, `python setup.py --build` does it, or you can use Conan directly if you are experienced with it.

What the script actually does is worth knowing, because it explains the flags. The wrapper parses its own arguments and passes everything it does not recognise straight to Conan.

python
subprocess.run(["conan", "install", ".", "--build=missing", "--profile", profile, *conan_args], check=True)

So `setup.py` is a thin convenience layer over `conan install . --build=missing --profile <profile>`, followed by `conan build .` when `--build` is passed. The profile defaults to `windows-msvc.txt` looked up in the `./conan/profiles` directory, and there is a platform detail in the script: on Linux the profile switches to `wine.txt`, which is how the Windows toolchain is driven from a non-Windows host.

The compact executable is required, and the size check is not optional

The installation step carries the most important warning in the whole project, and it is a warning about a file most users already have in a different form.

The project requires the GTA SA compact executable, and the documentation is emphatic that other executables will produce random crashes. The check is given precisely: the compact executable is not the same as the 1.0 US executable, so you should check that your file is exactly `5'189'632 bytes` (4.94 MiB). The project description calls itself a reimplementation of GTA:SA 1.0 US, and the build instructions point at the compact executable, which is the detail that trips people up: a wrong executable does not fail the build, it crashes later in apparently random places.

The requirement is also explicit about ownership: you must own the original game and assets for this to work.

Once the project is built, the files are installed by running `contrib/install.py` with administrator privileges, in the root directory, and the reason given is that creating symlinks on Windows needs them. The install covers the ASI Loader and a mouse fix, `dinput8.dll`, which can be found in a zip in the `contrib` folder, and the same files are available as a single archive.

The alternative is to install them by hand, and the documentation is unusually firm about the rest of the plugin situation: using plugins other than the ones they have tested is strongly discouraged, and no support is provided for that. For a project whose entire premise is that a wrong executable causes random crashes, insisting on a known plugin set is consistent.

Debugging means a DLL in the scripts folder and a ReAttach session

The debugging loop is short, and the tooling choice is specific.

The first step is to make sure the latest DLL is in the `scripts` folder of the GTASA installation, and the documentation says to skip this step if you used `contrib/install.py`, because that script uses symlinks pointing at the debug version. That distinction matters when you rebuild: a symlink means the new build is picked up automatically, a copied file means you have to copy it again.

The second step is to launch the game. The third is to attach using the ReAttach plugin from the Visual Studio marketplace, which the documentation recommends to make your life easier.

The build configuration matters for this loop too. The default for `setup.py` is a Debug build, and the install script points at the debug version, so a developer gets symbols and a debuggable DLL by default rather than having to configure it.

The project also keeps a coding guide at `docs/CodingGuidelines.MD`, and the contribution rules are specific about why. The guidelines exist for a reason, changes should focus on a single subject rather than covering many things at once because such pull requests are hard to test and review, and anyone intending to add non-vanilla features should consult the maintainers first so as not to waste their time. A repository where a single pull request is a few hundred lines of rewritten game logic cannot be reviewed any other way.

The credits show this is one thread in a much larger reversing effort

The credits section is worth reading for what it says about the state of game reverse engineering as a field.

The project credits all contributors of the plugin-sdk project, all contributors of the original project, hundreds of people on gtaforums.com who have spent years documenting GTA:SA memory addresses, the re3 team, and everyone who contributed to GTA:SA reversing.

That is a useful picture of the ecosystem. A reverse engineering project of this scale is not achievable from a single codebase; it is built on top of a shared SDK for the game's types, on a body of community documentation of memory addresses, and on the work of an existing reimplementation team. The gtaforums thread in particular points at the foundational problem, which is that for a game this old and this closed, the addresses and structures had to be established by the community before anything could be rewritten.

The project also runs a community Discord with a permanent invite, and a repository-wide workflow badge for the build, so the project is actively built in CI rather than only on one contributor's machine.

On licensing, the project metadata does not state a licence. That is not unusual for this kind of work, and the reason is implicit in the setup instructions: the project requires the original game and its assets, and it is a reimplementation of copyrighted game logic, so the legal position of the reversed code is a question the project does not answer in the repository. Anyone considering using this code commercially should look at that absence rather than assume a permissive default.

Where gta-reversed is the wrong tool

The first case is a player who wants a better game rather than better source. This project is a development effort, not a distribution of a playable thing. The output is a DLL that behaves identically to the game until somebody changes the code, so installing it changes nothing for a player, and the standalone executable is a stated future goal rather than something you can download.

The second case is a platform other than Windows with the 1.0 or compact executable at hand. The build is Visual Studio and CMake with a Conan profile for `windows-msvc`, and the script has a `wine.txt` profile for Linux hosts, so the toolchain can be driven from Linux but the target is still a 32-bit Windows DLL injected into a Windows game with an ASI loader. The native x64 San Andreas reimplementation line of work is a different project.

The third case is a modder who wants a feature rather than a foundation. A multi-thousand-function reimplementation is a platform, not a plugin, and the project explicitly asks people to consult before adding non-vanilla features and discourages untested plugins. Someone looking for a specific gameplay tweak in an afternoon is better served by an existing plugin for the stock game.

The last practical constraint is the maturity of the work itself. At an estimated 50 to 60 percent of the code done, a large part of the game's behaviour is still the original binary, so a build is a mixture of reversed and unreversed functions. That mixture is why the project insists on the exact executable and the tested plugin set, and it is why the goal is stated as keeping reversing until the whole game compiles standalone.

Editorial conclusion

gta-reversed fits a reverse engineer who wants the game's logic as readable, documented C++ rather than as an opaque executable, and it fits a modder who wants to change a function and rebuild the DLL. It does not fit anyone without the original game and assets, since the build targets a specific executable and the injection model assumes you own the game. Before attempting a build, read the size check in the setup instructions, because the project requires the compact executable of exactly 5'189'632 bytes and running the wrong one produces random crashes rather than a clear error.

Frequently asked questions

What does gta-reversed produce when you build it?

A DLL file that can be injected into GTA:SA with any ASI loader. Once injected, the in-game functions are replaced by the reversed ones and the game behaves the same, so any change made to the reversed code takes effect in the game. The longer-term goal is a standalone executable.

How do I build gta-reversed?

Install Python, Conan and CMake, then run `conan profile detect` once, followed by `python setup.py` for the default windows-msvc x86 Debug configuration or `python setup.py --build` to build as well. The script passes everything it does not recognise to Conan, so `python setup.py -s arch=x86 -s build_type=Release` selects another configuration.

Which GTA:SA executable does gta-reversed require?

The compact executable, and the documentation tells you to check that your file is exactly 5'189'632 bytes (4.94 MiB), because the compact executable is not the same as the 1.0 US executable. Using the wrong one causes random crashes, and you must own the original game and assets.

How do you debug the reversed code?

Put the latest DLL in the `scripts` folder of the GTASA installation, launch the game, and attach with the ReAttach plugin for Visual Studio. If you installed with `contrib/install.py` the DLL is already symlinked, so you do not need to copy it after each rebuild.

Official sources

  1. gta-reversed/gta-reversed on GitHub
  2. Issues
  3. README
Add this badge to your README

If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.

Add this badge to your README

markdown
[![Hysen Labs](https://hysenlabs.com/badge/gta-reversed-gta-reversed.svg)](https://hysenlabs.com/projects/gta-reversed-gta-reversed)

Was this useful?