Dmitry Jemerov's homepage
Dmitry Jemerov's photo   yole.ru - the e-side
English
Русский

About the project

Structorian is, essentially, a viewer and editor for structured binary data. After you describe the structure of your data in a special language, Structorian enables you to view and edit data files.

The structure description language supported by Structorian is quite powerful, and its syntax resembles that of C. Describing simple data formats in Structorian is no more difficult than writing C structures. For more complex tasks, Structorian provides support for hierarchical data, loops and conditions, a comprehensive expression evaluator and other powerful features. Ideally, Structorian should be able to describe adequately any real-world file format or protocol.

Project Status

Structorian has been under development since the beginning of June 2002. By now, most of the features planned for version 1.0 have already been implemented, and the remaining work is bugfixing, polishing, writing documentation and describing various data formats in Structorian.

You can view the Structorian development log here.

Download

The latest build of Structorian is Structorian_20041015.zip (675K). It includes structure definition files for the following formats:

  • RAR and ZIP archives;
  • PE EXE files and resources;
  • BMP images;
  • MIDI music files;
  • Data structures of Infinity Engine-based games (Baldur's Gate, Icewind Dale and so on);
  • Quake 3 BSP files;
  • The Bat! message bases;
  • and some others.

Most of the structure definitions are not comprehensive, but still they can serve as good examples of Structorian usage.

Examples and Screenshots

To demonstrate some of the possibilities of the structure definition language, an example structure is provided, describing the local file header of a ZIP archive:

[filemask="*.zip"]
struct LocalFileHeader
{
  u32         Signature;
  assert (Signature == 0x04034b50);
  u16         VersionToExtract;
  set16       Flags [enum=ZipFlags];
  enum16      CompressionMethod [enum=ZipCompressionMethod];
  dosdatetime LastModification [timefirst];
  x32         CRC32;
  u32         CompressedSize;
  u32         UncompressedSize;
  u16         FileNameLength;
  u16         ExtraFieldLength;
  str         FileName [len=FileNameLength];
  nodename    FileName;
  if (ExtraFieldLength > 0)
  {
    blob      ExtraField [len=ExtraFieldLength];
  }

  skip CompressedSize;
  [hidden] u32 _nextSignature;
  skip -4;
  if (_nextSignature == 0x04034b50)
  {
    sibling LocalFileHeader;
  }
  elif (_nextSignature == 0x02014b50)
  {
    sibling CentralFileHeader;
  }
}

The screenshot below shows how this structure looks when actually loaded into Structorian.

StructorianExample.gif

This example demonstrates a variety of Structorian features, namely:

  • integer, string and date fields;
  • enums (fields containing one value from a certain list) and sets (fields that may contain several flags from a certain set);
  • simple expressions and conditional processing;
  • building the structure hierarchy (sibling).