News for hackers. Stuff that matters.
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