Statically analyse this

By | January 8, 2013

profileIt’s time for SkoolKit 3.3. As has become quite the tradition by now, release tarballs, zip archives and whatnot are available from the trusty download page, which has been reliably serving up SkoolKit releases since January 2010. Why not pop by and grab yourself a copy?

The main new feature in 3.3 – which, since we’re all here, I should take a moment to explain – is support for reading code execution logs produced by the Fuse, SpecEmu, Spud, Zero and Z80 emulators. Perhaps that doesn’t sound very exciting, but it actually is. One of the more tedious things about starting to disassemble a Spectrum game is figuring out what’s code and what’s not. SkoolKit will perform a static analysis of the memory snapshot, and do a fair job of finding some of the code, but it cannot get everything right (except by chance); the final decision on whether a chunk of bytes is code or data still requires a human eye (and brain). And given the pressures of daily life in 2013, who really has time for this?

Enter the code execution log. Each of the emulators mentioned in the previous paragraph has the ability to produce a file containing the addresses of the machine code instructions that are executed while a program is running. Some call this file a map, some call it a profile, and others call it a trace; to keep things simple, we’ll call it a code execution log, or log for short. Now SkoolKit has the ability to read such logs, and thus do a much better job of finding the code in a memory snapshot. Of course, this does mean that a bit of work may be required to create the log itself, but playing a Spectrum game while the emulator does the hard work of identifying code should be more fun than trying to find the code by eye. However, if your chosen emulator has the ability to play back RZX recordings, you could take the hands-free approach and just sit back and sip coffee while the emulator does all the work for you. Sorted.

So there it is. Now that SkoolKit has support for reading code execution logs, there’s never been a better time to get started on that Spectrum game disassembly you’ve always wanted to do but were too daunted by the sheer mass of unidentified code and data. Get to it!