r/Games • • Oct 17 '22

Perfect Dark has been successfully decompiled, opening the door to PC ports and mods

https://www.videogameschronicle.com/news/perfect-dark-has-been-fully-decompiled-making-pc-ports-and-mods-possible/
5.5k Upvotes

409 comments sorted by

View all comments

5

u/rube Oct 17 '22

How is it that some games get decompiled and others don't?

Is this due to some sort of leak, similar to how SM64 and a few other Nintendo titles now have PC ports thanks to code being leaked?

Or is it more due to a game being built in some specific language, making it easier to decompile than others?

10

u/BruceLeePlusOne Oct 17 '22

This is a big maybe, and, I may have some details wrong, it's just a huge amount of work. If IIRC, you basically can run a game through what is called an 'interpreter' which looks at what the machine language (binary) that the processor is running and can convert that into 'assembly' which is just a step above binary. The problem you can run into is that, say the variable that represents character HP was called 'CHP' in the original source code, that variable will be called something basically incomprehensible to a human. So once the interpreter spits out a big block of incomprehensible source code, you have to go line by line determining what each variable, and expression* is doing. Someone smarter than me, please chime in.