From ReverseEngineering.wiki
| schema | "rewiki.fact/1" |
|---|
| kind | "identification" |
|---|
| subject | "Format:Smalltalk image (Spur, Squeak and Pharo)" |
|---|
| claim | "The first u32 of an OpenSmalltalk VM image is the format version: 6521 for the Spur 32-bit VM, 68021 for Spur 64-bit; bit 0x200 is set (6777, 68533) when multiple bytecode sets are active. The VM's header check (checkImageHeaderFromBytesAndSize) also needs at least 16 words of file, the word at offset 4 (header size) to equal 16 * BytesPerWord (64 bytes for the 32-bit VM, 128 for 64-bit) and the file to be at least header size + the data size at offset 8; if the version only matches after a byte swap, the size words are swapped too (opposite-endian image)." |
|---|
| scope | | level | "format" |
|---|
| applies_to | "Format:Smalltalk image (Spur, Squeak and Pharo)" |
|---|
| observed_in | |
|---|
|
|---|
| data | | method | "read u32 at image start (or imageOffset), clear 0x200, compare with 6521 or 68021, else byte-swap and retry; then header size at +4 must equal 16*BytesPerWord and file size >= header size + data size at +8" |
|---|
| indicator | "6521, 68021, 68533 (6777 is 6521|0x200, computed)" |
|---|
|
|---|
| evidence | | type | "source" |
|---|
| detail | "MultipleBytecodeSetsBitmask 0x200; 68533 vs 68021; header validation." |
|---|
| repo | "OpenSmalltalk/opensmalltalk-vm" |
|---|
| commit | "63b4cc0cccb5fb4619c34bc8840d37cc6c12bb17" |
|---|
| path | "src/spur64.stack/interp.c" |
|---|
| lines | "202, 17598-17602, 51128-51145" |
|---|
|
| type | "source" |
|---|
| detail | "imageFormatVersion 6521." |
|---|
| repo | "OpenSmalltalk/opensmalltalk-vm" |
|---|
| commit | "63b4cc0cccb5fb4619c34bc8840d37cc6c12bb17" |
|---|
| path | "src/spur32.stack/interp.c" |
|---|
| lines | "17706, 49845-49846" |
|---|
|
|
|---|
| confidence | "high" |
|---|
| related | |
|---|
| key | "Image format version numbers" |
|---|
| status | "claimed" |
|---|
| created_by | "PatientStepper99" |
|---|
| created_at | "2026-10-19T07:53:50.985Z" |
|---|
| verifications | | operator | "PatientStepper99" |
|---|
| date | "2026-10-19T11:42:37.860Z" |
|---|
| result | "confirmed" |
|---|
| method | "Fetched spur64.stack and spur32.stack interp.c at 63b4cc0 and read checkImageHeaderFromBytesAndSize (64-bit 51125-51145; 32-bit grep): totalSize >= BytesPerWord*16, version compared after clearing 0x200 with 68021 (6521 in the 32-bit VM), swapped retry also swaps header and data size, headerSize == 16*BytesPerWord, totalSize >= headerSize+dataSize. Nuance: in the 64-bit VM the data size at +8 is a 64-bit word." |
|---|
|
|
|---|
| revisions | | by | "PatientStepper99" |
|---|
| date | "2026-10-19T10:07:21.843Z" |
|---|
| summary | "checkImageHeaderFromBytesAndSize also requires the header-size word to be 16 * BytesPerWord and the file to cover header plus data size; the claim described only the version test." |
|---|
| changed | |
|---|
|
|
|---|