Question

Pretty much as the title asks. For example, if I took a Playstation disc, could a program be written that converts all the binary on the disk back into its original code files, art assets, etc? Isn't it just kidn of like decryption? If not, is it possible to make a language or add code to our current languages that would make future programs possible to convert backwards? Thanks!

No correct solution

OTHER TIPS

Let's take it easy.

Suppose you know that x^2 = 4, you cannot tell whether x was 2 or -2.

similarly is you have a binary executable or assembly code you cannot tell which language it was written in.

But you can convert binary file to assembly code. There are many good tools available for linux and windows both paid and free. They are called disassemblers. You can use them to see if what is a program doing and can even modify it in runtime.

In certain scenarios, yes you can get the original or near original set of code back from an executable or script. Certain development platforms are easier to do what is called decompiling. Decompiling uses a special tool called a decompiler for a certain language and will to try essentially reverse engineer the program so that you can get code that does the actual program does. It will probably like a little different since there will be no comments and the way it was compiled down might be different than the way it was written (e.g. optimizations, compiler generated code).

This is much easier especially if the code is compiled to byte codes like in Java (i.e. Java bytecode) for the JVM or .NET CLI (which is JITed but that is another story). In the case of a Playstation, I would assume that most games a probably going to be written in C++. The case is with C or C++, there is no easy way to decompile it since its output is straight machine code that runs straight on the processor. Yes, you can turn it into assembly code with a disassembler and read it yourself but is nothing close to the original high level language code. You can sort of call it "encryption" and yes is is possible to "decrypt it" by heavily reverse engineering the code which could possible take years with how big and complex games are these days.

You may be able to get the assets, but you would have to figure out what format they are stored and if they are actually encrypted or something.

Additional the Playstation discs are probably stored in a proprietary format meaning that Sony doesn't want you to figure out how the data is formatted and stored and is not public knowledge relayed from Sony (but of course that does not stop people from trying to reverse engineer it)

tl;dr:

  • The code is probably written in C++ which is essentially impossible to decompile to the original source code.
  • Unless you want to spend years reading assembly code, its very unlikely you can get the original code.
  • Though, there are other languages that don't compile to assembly code or machine code and instead execute in the form of bytecodes, scripts, or what not. This includes
    • Essentially all scripting languages
    • JVM languages - e.g. Java, Scala
    • CLR languages - e.g. C#, VB.NET, F#
    • Other bytecode interpreters or JITed languages in general
  • I'm sure Sony uses a proprietary format meaning that its most-likely not using just a standard DVD file format. In other words, you should not expect to be able to pop it in DVD drive in your computer and expect it to be able to read it.

tl;dr my tl;dr:

Sorry, but it's not happening today. I suggest waiting to the next millennium and see how it fairs then.

Simply: nope. You can not convert binary 1 to 1 to original source code on C++ or something alike. But you can do reverse engineering.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top