APE Script Decompiler
Size 10917 bytes (11 kb)
Date 9th July 2004
Version 1.0
Language   Python
Description

This is a collection of Python code that together decompiles the compiled APE script files that come with the game Anachronox. The current version of the decompiler will decompile each one of those scripts without immediately visible error.

Why write this? Especially when there is an existing decompiler? The initial reason I wanted to be able to replace the existing game scripts with my own was so that I could access the parts of the game I had missed when reaching the end of it. Specifically, I had not obtained the master lockpicking skill for Boots and was curious what was in the areas that I could not access because of that. Species8372's existing decompiler gave incomplete or erroneous source files for the scripts I needed to change, shown by the non-displaying lock picking window when trying to pick a lock for one thing. And a bug in the decompiling of code statement nesting levels would result in completely uncompilable code in some cases. I did not understand the structure of the compiled script files enough to be able to understand why his decompiler did some of what it did, in order to modify the source of it, which he kindly made available. Once I started, it was so enjoyable that I continued and finished it.

Issues

Some factors anyone who plans on using this tool should keep in mind:

  • The recompiled scripts (using the dparse.exe tool that comes with Anachronox) do not end up the same size as the original compiled scripts.
  • Only a selected number of the decompiled scripts have been put through the recompilation process. While all available game scripts may decompile there is no guarantee they all recompile.
  • No decompiled scripts have been modified and used to replace the original compiled scripts from the game. Unknown failings in the decompiler may result in recompiled scripts that are not viable replacements of the originals.

Download: APEDecompiler100.zip
LinkDescriptionSize (bytes)Size (kb)
READMEText.11762
decompile.pyHTML formatted Python script1547216
decompile.pyPython script23293
defunc.pyHTML formatted Python script198153194
defunc.pyPython script2730127
extras/ape.synTextPad Syntax Highlighting31004
extras/test.txtTest APE script27423

copyright © Richard Tew 2004
last modified on 15th July 2004