if-decompiler icon indicating copy to clipboard operation
if-decompiler copied to clipboard

Relooper, Stackifier, decompiler problems

Open kdabwl opened this issue 3 years ago • 3 comments

Thank you for bringing the Relooper problem class to my attention (and indirectly the Stackifier problem class). . I had previously assumed that bytecode was "always" a 100% decompilable substitute for missing source code (100% identical, except temporary names), as is the case with Smalltalk decompiler. . What might be the reason for the problems of Relooper and Stackifier that are not present in the Smalltalk system?

kdabwl avatar Jun 15 '22 09:06 kdabwl

I'm not familiar with Smalltalk.

But the main issue is a mismatch between structured code (loops and if/else) and jump/branch to address models. Some languages only support one of them, and some VM formats use the other.

Also many, probably most, bytecodes definitely aren't 100% reversible. That sounds like Python's which is really just a compressed source code. Most bytecodes for VMs are truly compiled for them, and lots of information is lost.

curiousdannii avatar Jun 15 '22 10:06 curiousdannii

what information can be lost by Inform7 compiled bytecode; I'm sure I can find examples (going the very long way), but your experience could shortcut that for me; thanks

kdabwl avatar Jun 15 '22 13:06 kdabwl

Whether the code used loops, switch statements, arbitrary jumps, etc. That's the main difficult for which reloopers are designed to solve.

curiousdannii avatar Jun 15 '22 13:06 curiousdannii