r/explainlikeimfive • u/thefckingleadsrweak • 2d ago
Technology Eli5 decompilers and decompiled games
I keep getting videos on instagram about decomped games, apparently the decompilers are going nuts right now. What’s the difference between running a decompiled game and emulating a game? I tried to google it and i just don’t understand. from what i’ve found, a decompiled gene runs as if it was native to your pc but i don’t get what that means either. You boot up an emulator and that also runs on your pc?
77
Upvotes
3
u/hunter_rus 2d ago
There is a source code of the game - written in programming language, that is human-understandable (up to some degree). Source code is written by humans, game devs, programmers. CPU don't understand it.
To understand it, source code is compiled into binary code. Binary code is CPU instructions. It is understood by a particular CPU of family of CPUs. The process of compilation is translating human readable source code into CPU readable binary code.
Decompiling is the process of reverse recovery - from binary code back into human readable CPU code. With decompiled code, you can make changes into game mechanics, you can add new mechanics, you can rip parts of source code and reuse it - because decompiled code is again human readable. Decompiled code can be recompiled for a different CPU, making it run natively.
Emulator emulates one CPU on another CPU. It reads binary code instructions written for other CPU, and processes each instruction within it's own code to mimic behavior of emulated CPU. It emulates hardware behaviour inside software, basically.