Agroup of dedicated coders has generated complete reverse-engineered raw source code for the PC versions of Grand Theft Auto III and Vice City, which comprises hundreds of thousands of lines of C++ code, in a years-long process.
Further ReadingBeyond emulation: The massive effort to reverse-engineer N64 source codeWe've discussed in the past how video game fan coders use reverse-engineering techniques to deconstruct the packaged executable files distributed by a game's original developers. This painstaking, function-by-function process creates raw programming code that can generate exactly the same binary file when compiled.
With that code in hand, coders can examine what makes the game tick and make improvements and changes at a much more granular level than with traditional modding. In the case of Grand Theft Auto, those improvements include bug fixes, reduced load times, improved rendering, widescreen monitor support, and a free-floating camera system, to name a few examples. The source code can also be used to generate ports of the game to new platforms like Linux, Switch, and PlayStation Vita (though these recompiled versions all require the copyrighted art and music files extracted from the original game).
Github contributor "aap" wrote that the project started in early 2018 "initially as a way to test reversed collision and physics code inside the game" by reverse-engineering specific DLLs. By 2019, the project grew to incorporate other contributors, who were able to generate a working executable by April of 2020. The team built off that code to generate a source version of Vice City that was ready by December 2020, aap wrote.
In addition to working on a similar decompilation for Grand Theft Auto: Liberty City Stories, the source code team has also expressed interest in generating PS2 and Xbox ports of the PC version of the game, as well as additional bug fixes.
Agroup of talented programmers reverse-engineered the source code of Grand Theft Auto III and GTA: Vice City, opening up a huge amount of possibilities for modders. In simpler terms, both games have been dismantled to source code level, allowing for the creation of extensive mods and porting the games to other hardware.
The developers working on the RE3 project have released the source code of both games (GTA III and Vice City) on GitHub. It can be used by anyone who knows what to do with it. Projects were tested on Windows, Linux and FreeBSD OS. Graphics are rendered using RenderWare (D3D8) or librw library implementation (D3D9, OpenGL 2.1 and newer, OpenGL ES 2.0 and newer). The sound is handled by OpenAL or the MSS library using the original GTA III files.
Well, you may ask what does it mean for me, a gamer? For one thing, it means that you can now enjoy the improved version of both games. In addition to fixing many minor bugs, the creators took care of:
But that's not all. Working ports of the game have been prepared for Switch, WiiU and PS Vita. Work is also underway on porting the "enhanced" version to PS2 and Xbox. It is worth remembering, however, that in order to run it, we need our own copy of GTA III, because the game files are used, without which RE3 will not work.
In future versions we can expect improved physics when the game runs in more than 30fps, better performance on weaker hardware and general tweaks to the code to minimise any problems caused by the size of the project. If you want to know more, check out the source code and possibly add something from yourself, I invite you to the project's GitHub page.
In the suit, the company stated that it wants to "halt the activities of a group of individuals who have sought unlawfully to copy, adapt, and distribute to the public infringing source code for two classic GTA titles... without the authorisation or consent of Take-Two."
Take-Two also attempted to have the project removed from Github, and claimed that three of the developers involved "knowingly filed bad faith counter notifications that materially misrepresented the legality of their content, apparently claiming that because they allegedly 'reverse engineered' the Games' source code, they somehow cannot be liable for copyright infringement."
The re3 project does not use any leaked source or copyrighted assets belonging to Rockstar or Take-Two. To access those, players will need to own their own copies of the games. The project also adds new features to the existing games, including a new camera, various bug fixes and widescreen support.
TorrentFreak reports on the restored version of the project, which was posted as a seemingly identical fork of the original by a New Zealand-based developer named Theo. While the original GitHub poster (who goes by the handle aac) has not contested Take-Two's original takedown, Theo told TorrentFreak he filed a counterclaim to restore his copy of the project, saying it "contained no code owned by Take Two."
In general, reverse-engineering source code from a compiled binary is less straightforwardly illegal than simply cracking a game's DRM for piracy purposes, for instance. As the Electronic Frontier Foundation explains, US case law includes certain fair use exceptions that can allow for this kind of decompilation work for research or interoperability purposes.
In the case of Grand Theft Auto, though, the game's End User License Agreement specifically asks players to agree not to "reverse engineer, decompile, disassemble, prepare derivative works based on or otherwise modify the Software, in whole or in part." Back in 2005, the 8th Circuit Court of Appeals upheld a similar anti-reverse-engineering EULA to take down BnetD, a reverse-engineered version of Blizzard's Battle.net that allowed the service to be emulated on private servers.
Whatever the legal status of the code, Theo told TorrentFreak that he "believe[s] Take-Two's claim to be wholly incorrect... since the code may be functionally identical, but not exactly identical, they hold no claim to the code." So Theo filed a DMCA counterclaim requesting the affected code be reposted within ten to 14 days. When that time passed without notice of a formal legal filing by Take-Two, GitHub followed the DMCA guidelines and reposted the code nine days ago without ruling definitively on the merits of either claim.
Take-Two hasn't responded to a request for comment from Ars Technica, so we don't know if the publisher will go through the legal motions to remove the code again. For now, though, fans with the technical know-how can enjoy improvements made on top of the reverse-engineered code, such as bug fixes, reduced load times, improved rendering, widescreen monitor support, and a free-floating camera system, to name a few examples (not to mention derivative ports of the game to new platforms like Linux, Switch, and the PlayStation Vita).
Re3 (reverse-engineered GTA 3) and reVC (reverse-engineered Vice City) offer a raft of eye-catching improvements over the original games that are available to play officially today on PC. The video below showcases the work and the changes made possible.
Bugs have been fixed, a debug menu and camera are available, there's instant compatibility with current controllers, no loading screens between islands, and widescreen support with a properly scaled HUD, menu and field of view, among other improvements. There are even improved effects from the PS2 versions. Re3 also includes a map of Liberty City in the pause menu - something missing from all original versions of GTA 3.
One such attempt, dubbed Open ReWrite, or OpenRW, saw some active development but now appears dormant. There have also been projects that recreated Grand Theft Auto 3 in engines such as Unity and Unreal. aap, though, was more interested in reverse-engineering the original code into source code. At some point in 2016, aap began to reverse engineer the GTA 3 code on a casual basis, getting to the point where the player could fly around the map.
aap then focused on reverse-engineering collision and physics code, injecting this into the actual game for testing. This is how the re3 project began. aap replaced the functions of the original game until everything was replaced by the spring of 2018.
The skill, time and energy required to reverse-engineer a video game should not be underestimated. This is not an easy thing for professionals to do - let alone enthusiasts. There's a huge amount of code to work through, and mistakes are inevitable, especially if they don't result in any obvious wrong behaviour in the game. There are almost certainly still bugs in the re3 code that aren't original, aap admits.
"So what we typically do is work with the output of the decompiler and massage it back into readable C++. This is sometimes quite easy and sometimes hard, but in any case it's a lot of code and you're bound to make mistakes."
Thankfully, the code for GTA 3 on PS2 and Android includes debug symbols. Debug symbols contain all the extra information needed to debug a game during the development process, but are often stripped out for release executables to avoid bloat. For whatever reason, Rockstar left these symbols in, giving the reverse-engineering team a huge leg-up.
"We were very lucky we had symbols for the games," aap says. "PS2 [GTA] 3 and all the Android releases have names for the global stuff (functions and global variables). This was a huge help and I don't think we'd be anywhere near reversed GTA without them."
Others took notice and joined the effort. After work stalled in the second half of 2019, the project was picked up again in early 2020 as the hackers found they had more time on their hands due to the coronavirus pandemic. In April 2020 the re3 team had its first standalone executable. The core team was just six people.
Why choose GTA 3 in the first place? "It was the first game of that era, the smallest (so less code to reverse), and generally liked by everyone on the team," aap explains. After GTA 3, Vice City was the logical next step. It's similar to GTA 3, after all, and much liked. reVC was started in early May 2020, and the team called it done in December 2020.
3a8082e126