How to tell if a Z-code file was produced by Inform 7?

Is there a good way to tell by the contents of a Z-code file that it was produced by Inform 7?

Actually, it would be good to have such rules for Inform 6, Dialog and ZIL as well.

simple.

VERSION. if the author hasn’t tampered with the banner int core library for some strange reasons, will give you something along the lines of:

>version
Lab
An Interactive Fiction by PGdE
Release 1 / Serial number 220606 / Inform 7 v10.1.0
Inform 7 v10.1.0-beta+6U99

the same applies also for I6, Dialog and ZIL, provided that the author don’t have tampered with the banner/version mechanism for strange reasons.

Best regards from Italy,
dott. Piergiorgio.

This doesn’t seem very easy to find by inspecting the contents of the file.

Dialog writes Dia+version info in username:

***** HEADER (00000-0003F, 64 bytes) *****

00000 05 00 00 02 24 D8 24 D9 1A 35 0F E0 14 BC 16 A8  ....$.$..5......
00010 00 10 32 31 30 36 32 33 15 DC 7F E6 06 F5 00 00  ..210623........
00020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00030 00 00 00 00 00 00 00 00 00 44 69 61 30 6D 30 33  .........Dia0m03

00000 VERSION Z-machine version:         5
00001 MODE    Flags 1:                   00
00002 ZORKID  Release number:            2
00004 ENDLOD  Base of high memory:       24D8
00006 START   Initial value of pc:       24D9
00008 VOCAB   Dictionary:                1A35
0000A OBJECT  Object table:              0FE0
0000C GLOBALS Global variables table:    14BC
0000E PURBOT  Base of static memory:     16A8
00010 FLAGS   Flags 2:                   0010
00012 SERIAL  Serial number:             210623
00018 FWORDS  Abbreviations table:       15DC
0001A PLENTH  Length of file:            1FF98
0001C PCHKSM  Checksum of file:          06F5
0001E INTWRD  Interpreter number:        0
0001F         Interpreter version:       0
00020 SCRWRD  Screen height (lines):     0
00021         Screen width (chars):      0
00022 HWRD    Screen width in units:     0000
00024 VWRD    Screen width in units:     0000
00026 FWRD    Font width/height:         0
00027         Font width/height:         0
00028 FOFF    Routines offset:           0000
0002A SOFF    Static strings offset:     0000
0002C CLRWRD  Default backgr. color:     0
0002D         Default foregr. color:     0
0002E TCHARS  Terminating chars table:   0000
00030 TWID    Output loc for DIROUT:     0000
00032         Standard revision number:  0000
00034 CHRSET  Alphabet table address:    0000
00036 EXTAB   Header extension address:  0000
00038 USRNM   Username:                  .Dia0m03

ZILF/ZAPF writes ZAPF in username.

***** HEADER (00000-0003F, 64 bytes) *****

00000 05 00 00 03 2B A2 6C 09 20 DB 03 EA 03 92 20 DB  ....+.l. ..... .
00010 00 00 32 32 30 31 32 38 02 D2 25 B1 C2 C3 00 00  ..220128..%.....
00020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00030 00 00 00 00 00 00 00 00 00 00 00 00 5A 41 50 46  ............ZAPF

00000 VERSION Z-machine version:         5
00001 MODE    Flags 1:                   00
00002 ZORKID  Release number:            3
00004 ENDLOD  Base of high memory:       2BA2
00006 START   Initial value of pc:       6C09
00008 VOCAB   Dictionary:                20DB
0000A OBJECT  Object table:              03EA
0000C GLOBALS Global variables table:    0392
0000E PURBOT  Base of static memory:     20DB
00010 FLAGS   Flags 2:                   0000
00012 SERIAL  Serial number:             220128
00018 FWORDS  Abbreviations table:       02D2
0001A PLENTH  Length of file:            96C4
0001C PCHKSM  Checksum of file:          C2C3
0001E INTWRD  Interpreter number:        0
0001F         Interpreter version:       0
00020 SCRWRD  Screen height (lines):     0
00021         Screen width (chars):      0
00022 HWRD    Screen width in units:     0000
00024 VWRD    Screen width in units:     0000
00026 FWRD    Font width/height:         0
00027         Font width/height:         0
00028 FOFF    Routines offset:           0000
0002A SOFF    Static strings offset:     0000
0002C CLRWRD  Default backgr. color:     0
0002D         Default foregr. color:     0
0002E TCHARS  Terminating chars table:   0000
00030 TWID    Output loc for DIROUT:     0000
00032         Standard revision number:  0000
00034 CHRSET  Alphabet table address:    0000
00036 EXTAB   Header extension address:  0000
00038 USRNM   Username:                  ....ZAPF

It would be helpful if it in future versions also wrote the version number.

Inform6 writes the version number in username. This was introduced in some version 6 that I don’t remember offhand.

***** HEADER (00000-0003F, 64 bytes) *****

00000 05 02 00 05 25 C4 25 C5 1A 00 01 F0 0C 9F 12 5D  ....%.%........]
00010 00 50 32 31 30 39 33 30 01 28 2A E8 B8 98 00 00  .P210930.(*.....
00020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 5C  ...............\
00030 00 00 00 00 00 00 01 E8 00 00 00 00 36 2E 33 35  ............6.35

00000 VERSION Z-machine version:         5
00001 MODE    Flags 1:                   02
00002 ZORKID  Release number:            5
00004 ENDLOD  Base of high memory:       25C4
00006 START   Initial value of pc:       25C5
00008 VOCAB   Dictionary:                1A00
0000A OBJECT  Object table:              01F0
0000C GLOBALS Global variables table:    0C9F
0000E PURBOT  Base of static memory:     125D
00010 FLAGS   Flags 2:                   0050
00012 SERIAL  Serial number:             210930
00018 FWORDS  Abbreviations table:       0128
0001A PLENTH  Length of file:            ABA0
0001C PCHKSM  Checksum of file:          B898
0001E INTWRD  Interpreter number:        0
0001F         Interpreter version:       0
00020 SCRWRD  Screen height (lines):     0
00021         Screen width (chars):      0
00022 HWRD    Screen width in units:     0000
00024 VWRD    Screen width in units:     0000
00026 FWRD    Font width/height:         0
00027         Font width/height:         0
00028 FOFF    Routines offset:           0000
0002A SOFF    Static strings offset:     0000
0002C CLRWRD  Default backgr. color:     0
0002D         Default foregr. color:     0
0002E TCHARS  Terminating chars table:   125C
00030 TWID    Output loc for DIROUT:     0000
00032         Standard revision number:  0000
00034 CHRSET  Alphabet table address:    0000
00036 EXTAB   Header extension address:  01E8
00038 USRNM   Username:                  ....6.35

A serial number between 700101 and 891231 could probably be assumed to been compiled with Zilch.

I7 unfortunately prints the version of the underlying i6 compiler in username but the high strings seem to hold i7-specific data (Version 10.1 may do it completely different, if it even supports output to Z-machine?).

313A8 S0001 "6G60"
313B0 S0002 "080126"
313B8 S0003 "6/12N"
313C0 S0004 "Craverly Heights"
313D0 S0005 "An Interactive Fiction"
313E8 S0006 "Standard Rules version 2/090402 by Graham Nelson^"
31418 S0007 "Standard Rules version 2/090402 by Graham Nelson^"
31448 S0008 "Basic Screen Effects version 7 by Emily Short^"

Translates to game:

Craverly Heights
An Interactive Fiction by Ryan Veeder
Release 2 / Serial number 140414 / Inform 7 build 6G60 (I6/v6.32 lib 6/12N) 

Roland Memorial Hospital
The whirring and chirping of medical instruments is all around—a worrying commotion, to some, but to your ears it is as regular as a heartbeat, as usual as business. While you walk these sterile halls, you are in your element: the element of health. The exit is east.

Pauline, pale and frail, looks up at you pleadingly from her supine position aboard her hospital bed.

One can use glulx-strings to dump the text of any z-code or glulx file (and other formats), in or out of a blorb (and you can run glulx-strings online). The python version only does glulx; the javascript version is the polyglot. So this isn’t a nice, neat look at byte number X approach, but you should find distinctive strings like “Inform 7 build” in there for I7-compiled games. (There may be a viable look at byte number X solution, but I don’t know it.)

2 Likes
if
 (it is huge)
then
 (probably) (it was i7)
3 Likes

Can you identify a PunyInform game?

Well… PunyInform is still compiled with the Inform6 compiler, but the library probably leaves a specific footprint in the z-code from some of the library functions.

1 Like

Gotcha. So that version number in username is the compiler version number, not the library version number.

Correct

1 Like