Extracting object descriptions from zcode files?

Does anyone know of a good way to extract the object descriptions from a zcode game? I tried using ztools but the object “descriptions” infodump extracts aren’t the descriptions I’m after. They’re just the name / title of the object. I’m trying to extract the text that comes up when you type “look” in a room or “examine” an object. Using txd I noticed that these descriptions do appear as strings at the bottom of the disassembly output. But I have no way of linking the strings to their proper objects.

Is there a way I can extract this data?

Unfortunately, there’s no easy universal way.

“Objects” in a Z-code file contain a short string, which Infocom called the DESC, that’s generally used for the short name/printed name of that object.

But that’s the only string property that’s actually built into the Z-machine like that. For “look” and “examine”, all the output is handled by the game code. Usually there’ll be a property on the object that’s a pointer into the string table (what you’re seeing at the bottom of the disassembly output), but this isn’t a requirement: in Inform, for example, it’s not uncommon to store a pointer to a routine that prints the description instead.

I see. That’s too bad. I appreciate your help, though!

I remember Inform Mapper, although I don’t remember if it attempted to extract the descriptions of objects.

Also the site is now down, but the source is on GitHub if you want to try running it locally.