I’m again fiddling with the Another World / Out of this World virtual machine.
Around an year and a half ago I have forked fabiensanglard’s Another-World-Bytecode-Interpreter on github and made a few patches on branches of my personal fork. The code I implemented was developed while hosting the then-weekly reverse engineering workshop called “Oficinas de Retroprogramação” at Garoa Hacker Clube, the local hackerspace here in São Paulo, Brazil.
The “hack_monitor_threads” branch allows one to interactivelly freeze/unfreeze threads in realtime in the virtual machine, in a way that allows some very interesting kinds of investigation on the meaning of each thread in the game code. Read the patches to learn how it works. I’d invite all of you to try it on the first game scene (the one in which professor Lester swims out of the lake). It is fun!
hint: thread #8 controls the behavior of the snake that kills Lester by pulling him back into the lake. You probably should freeze it as quickly as possible so that you can continue experimenting with the other threads without having to worry about the snake killing you.
The “extractor” branch contains code for dumping decompressed binary resources as well as disassembled “source” files. That code was outputing a few “unknown opcode”s. So, yesterday I got interested in it again and figured out that there are special video-rendering related opcodes that I was not parsing yet. So last night I made a few more commits implementing these, which seem to partially work. I still get some unknown opcodes and now I don’t know why. Perhaps it is a bug in my parsing routines. I’d appreciate if anyone could take a look at it as well. Once I have further progress in this mini-project I can post here again with more insights.
happy hacking,
Felipe “Juca” Sanches
Fabien and you did a good job at deciphering the reversed code 🙂
In case there is any interest, the “gl” codebase of the raw interpreter has been uploaded to github. That includes a “disasm” tool written a while back. 3DO assets (including extra opcodes) are also supported.
I’ll probably write a longer blog post about it, but I’d like to point out that recently I worked on an implementation of the Another World VM (a port of Fabien’s code) using the MAME emulation infrastructure.
The code is currently hosted at https://github.com/felipesanches/mame/commits/anotherworld but I would love to see it merged into HBMAME at some point in the future.