Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:Smalltalk image (Spur, Squeak and Pharo)

From ReverseEngineering.wiki
Format
Magic first u32 = image format version (6521 or 68021, 6505 older)
Extensions .image
License MIT (OpenSmalltalk/opensmalltalk-vm)
On this wiki Facts · Code · Notes · Topics

Saved object memory (.image) of Squeak, Pharo and Cuis loaded by the OpenSmalltalk VM: the file starts with a 32-bit image format version (6521 for Spur 32-bit, 68021 for Spur 64-bit, plus 0x200 when multiple bytecode sets are active), then header size and data size.

Overview

Recognition level. The VM sources (generated interpreter C, src/spur64.stack/interp.c and src/spur32.stack/interp.c at OpenSmalltalk/opensmalltalk-vm commit 63b4cc0cccb5) read the first 32-bit word as the image format version, then the header size and the data size. The VM accepts a version when, after clearing the multiple-bytecode-sets bit (MultipleBytecodeSetsBitmask = 0x200), it equals the build's imageFormatVersion; it also tries the byte-swapped value, which is how an image of the other endianness is detected. See Fact:Smalltalk image (Spur, Squeak and Pharo)/identification/Image format version numbers.

Version numbers

  • 6521: Spur 32-bit (spur32.stack interp.c).
  • 68021: Spur 64-bit (spur64.stack interp.c); 68533 (= 68021 | 0x200) is written when multiple bytecode sets are active (for example Sista or the Pharo bytecode set). Likewise the 32-bit value with the bit set is 6521 | 0x200 = 6777 (computed).
  • 6505: Unverified: the pre-Spur Cog/Squeak 32-bit format; not found in the Spur sources read here.

The loader error text is "This ver %d vm cannot read ver %d image file %s". The 64-bit validity check expects header size equal to 16 words (BytesPerWord * 16) and a file at least header size plus data size long. After loading, the header fields include the old base address, the special objects array and the full-screen flag; Unverified: exact field offsets, read readImageFromFile / the SpurImageReader Smalltalk sources.

Code & repositories

  • https://github.com/OpenSmalltalk/opensmalltalk-vm @ 63b4cc0cccb5fb4619c34bc8840d37cc6c12bb17 · license: MIT (read from LICENSE; GitHub's API was busy)
    OpenSmalltalk VM (Squeak, Pharo, Cuis): generated Spur interpreter sources with image loading.
    Tested on: source read, not run: read source only · checked 2026-10-19

Evidence & references

  • OpenSmalltalk/opensmalltalk-vm at 63b4cc0cccb5: src/spur64.stack/interp.c (lines 17598-17602, 51128-51145, 62262-62270), src/spur32.stack/interp.c. The brief named pharo-project/opensmalltalk-vm; the repository that exists with these sources is OpenSmalltalk/opensmalltalk-vm.