Giter VIP home page Giter VIP logo

if-decompiler's Introduction

Glulxtoc and IF-Decompiler

In this repository you will find:

Glulxtoc logo

Glulxtoc will decompile your Glulx storyfile into C code which you can then compile against any Glk library.

Glulxtoc installation and usage instructions.

Decompile various interactive fiction formats.

Relooper turns unstructured branches and jumps into structured blocks.

if-decompiler's People

Contributors

curiousdannii avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

if-decompiler's Issues

Relooper, Stackifier, decompiler problems

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?

Possible Disassembly issue

disassembling a story file threw up this message "Disassembling the storyfile...Stopping on unknown object type 4 at 41549699"

Support Inform's debug files

If given a debug file (inline or external) we should be able to at least get function names, if not more.

It would let us immediately disassemble the functions instead of the fragile code that currently parses the file, skipping other objects, and would also tell us how long each function is, so that we can find late branch targets. This might be the only way to get dynamic jumps to work.

Combine branch instructions

Adjacent branch instructions could be combined before identifying basic blocks, to simply the output and improve performance. However I'm not sure if Inform actually compiles many adjacent branch instructions?

Optimisation: if a loop has no next edge pull one non-scc node out

Currently nodes that are not part of a loop scc are not pulled out (ie, made a next edge) unless they are not dominated by the loop header. This means that a series of loops becomes deeply nested. As most loops have only one exit node, we can put it out as long as there isn't already a next edge. We could simply pull the first non-scc node out, or try to weigh the options somehow.

Directly output some common Glk functions

The most common Glk functions (those in perform_glk) could be directly output. Match on the function ID and number of arguments so that wrong argument number calls will fall through to the default implementation.

Optimise stack operands

Optimise stack operands. Easy to do within a basic block, but across block boundaries would probably require some sort of phi function?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.