News for hackers. Stuff that matters.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by landgenoot on Monday March 11, 2024 @03:21AM (#39665604)
Isn't this just a fork of the DCMA'ed repository?

The links in the readme still point to https://github.com/GTAmodding/re3

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by dawidpotocki on Monday March 11, 2024 @05:46AM (#39666221)
I wouldn't even call it a fork, it's just a mirror with a commit that replaces few links in a README.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by jumploops on Monday March 11, 2024 @02:03AM (#39665276)
> Due to everyone staying home during the start of the Corona pandemic everybody had a lot of time to work on re3 again and we finally got a standalone exe in April 2020 (around 180k lines by then).

This is awesome. I’m curious what other projects owe their success to the pandemic?

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by Y_Y on Monday March 11, 2024 @04:10AM (#39665784)
Zoom, 5g mind control, work-from-home
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by yieldcrv on Monday March 11, 2024 @04:17AM (#39665810)
SPACs
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by plaguna on Monday March 11, 2024 @02:37AM (#39665415)
mRNA vaccines
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by 3abiton on Monday March 11, 2024 @04:52AM (#39665954)
TikTok, unfortunately
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by tety on Monday March 11, 2024 @01:59AM (#39665258)
Can you share some of the tools and methods you used to reverse such a large C++ codebase into readable code?
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by supriyo-biswas on Monday March 11, 2024 @02:18AM (#39665339)
The history[1] section in the README file contains a description of how they did it. In summary, it seems they debugged GTA3 and wrote their stub implementations until the game was all reimplemented, presumably with only the assets from Rockstar’s GTA3.

[1] https://github.com/halpz/re3?tab=readme-ov-file#history

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by Hamuko on Monday March 11, 2024 @02:57AM (#39665502)
>"GTA 3 and Vice City were originally written in C++," aap explains. "The compiled executables that are shipped are in machine code. So the general task is to go from machine code back to C++.

>"Machine code can be (more or less) mapped 1:1 to a human readable form called assembly language, but it's still very tedious to read.

>"To go back to C++ is by no means a simple 1:1 mapping, but over the last 10 or so years decompilers have appeared that help with this process.

>"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."

https://www.eurogamer.net/how-a-small-group-of-gta-fanatics-...

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by euazOn on Monday March 11, 2024 @04:22AM (#39665827)
Im curious, since it seems to be mostly about walking back the one-way-street of C++ to assembly, what’s stopping us from training a ML model to help with decompilation by figuring out patterns in the compilation process? (there has to be a reason, otherwise someone would have done it already)
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by esrauch on Monday March 11, 2024 @04:54AM (#39665968)
The answer is that people have done it, ML guided decompilation is an active area.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by Eisenstein on Monday March 11, 2024 @05:09AM (#39666027)
I just tried with Claude Opus.

1. Write hello.cpp

2. Compile

3. Disassemble to asm with objdump -d

4. Give asm to Claude and ask it to write the C++ code that would result in that asm

5. Got back hello world in c++

So, it seems you might not need a specially trained model.

Original:

#include <iostream>

int main() { std::cout << "Hello, World!" << std::endl; return 0; }

Reproduced:

#include <iostream>

int main() { std::cout << "Hello, World!" << std::endl; return 0; }

asm: https://pastebin.com/SswUSh0u

* https://imgur.com/U1wbb0d

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by lstodd on Monday March 11, 2024 @02:43AM (#39665435)
Well you can look into how DFHack for Dwarf Fortress was redone. It involved a C++ decompiler written in clisp.

Since then Ghidra was released, so the process is somewhat simpler, if not as much *fun*.

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by iknowstuff on Monday March 11, 2024 @02:16AM (#39665328)
hmmm this was DMCA'd to hell earlier
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by yieldcrv on Monday March 11, 2024 @04:18AM (#39665813)
clone and move on!
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by whatever1 on Monday March 11, 2024 @02:48AM (#39665459)
Ok naive question, but how did they reverse engineer the source code comments?
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by 4gotunameagain on Monday March 11, 2024 @02:52AM (#39665476)
They didn't, they added them in while reverse engineering.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by ch33zer on Monday March 11, 2024 @02:55AM (#39665494)
Also all the other things that wouldn't be present in a pure decompilation, like preprocessor macros.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by Hamuko on Monday March 11, 2024 @02:00AM (#39665262)
RE3, meaning the project that was shut down because it was just straight up decompiled from Rockstar's binaries?
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by Pannoniae on Monday March 11, 2024 @02:32AM (#39665396)
it went to court and they settled, and the repo is still up. take it as you will
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by crummy on Monday March 11, 2024 @03:14AM (#39665566)
That must be unusual? I would have thought any settlement would have included "take down the code" as priority #1.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by Hamuko on Monday March 11, 2024 @03:20AM (#39665598)
This repository is a mirror by a completely unrelated third party. The original repo was https://github.com/GTAmodding/re3.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by lyu07282 on Monday March 11, 2024 @03:14AM (#39665570)
Rockstar should've just worked with modders instead of whoever produced the garbage re-masters. Like fans have more respect and love for GTA than anybody working at Rockstar. Fuck this company.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by Y_Y on Monday March 11, 2024 @06:27AM (#39666418)
That unfortunate release was done by an outside studio who had previously done mobile ports for Rockstar: https://en.wikipedia.org/wiki/Grove_Street_Games
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by webprofusion on Monday March 11, 2024 @03:59AM (#39665737)
"Reverse Engineered" doesn't mean what you think it means. This is just looks like a copy of the actual code.
Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by colonwqbang on Monday March 11, 2024 @04:03AM (#39665756)
"to study or analyze (a device, as a microchip for computers) in order to learn details of design, construction, and operation, perhaps to produce a copy or an improved version"

Isn't that what has happened here? They decompiled the program and gave each function and variable a meaningful name, added comments and fixed some bugs.

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by ThinkBeat on Monday March 11, 2024 @04:41AM (#39665909)
This is a truly monumental creation.

THe level of effort it must have taken is enormous.

I peeked at the source code expecting what asm - > C reverse engineering tools usually spit out, which is quite a mess, but this is clean and commented.

I stand in awe.

Re:Show HN: RE3 – Reversed Engineered GTA3 Source Code by ouraf on Monday March 11, 2024 @10:05AM (#39668388)
I keep stumbling onto this repo when looking for tools to reverse engineer old Resident Evil games.