zahniser.net :: software

— Hexie —

Hex editor

 

— HyperList —

Hierarchical to-do lists

— hsiloP —

Calculator program

— Mirth —

Read daily comics

— Strange —

Chaotic attractors

— etc. —

Other programs

 

 

 

contact email:

michael at zahniser dot net

Hexie :: Screenshots

The screenshot below shows Hexie running on Mac OS X, editing a TIFF image file. Below is a more detailed explanation of the TIFF format and how Hexie was used to make that format visible.

 

A screenshot of Hexie on Mac OS X

The image file being edited is available here, if you want to follow along with the steps described below.

When the file is first opened, it is displayed in raw hexadecimal. A TIFF begins with an eight-byte header. The first two bytes are ASCII characters, either "II" or "MM" depending on whether the endian mode of the file is little (Intel) or big (Motorola) endian. So, I select the first two bytes and type C to mark them as characters, then press space to continue to the next block of data. This file is in little-endian mode, Hexie's default. You can toggle endian modes with the E key.

Next comes the "magic number", a two-byte value which, read in the proper endian mode, equals 42. I type U 2 <space> to mark the next two bytes as an unsigned 2-byte value. The next 4 bytes are the offset in the file of the TIFF property fields (the "image file directory" or "IFD"). I type H 4 <space> to mark them, then <return> to separate the header from what follows.

It turns out that the IFD begins at byte offset 8, which is where I am already. The IFD begins with a 2-byte value, giving the number of fields. I type U S ("unsigned short," the equivalent of "U 2") and discover that there are twelve fields. I insert another line break after the field count.

Each field consists of a 2-byte tag, a 2-byte type indicator, a 4-byte count, and either the field value in the next 4 bytes (if it fits) or the file offset where the value is stored (if it does not fit). For example, notice that the tags of type 5 (rational number) are stored as a pair of 4-byte values, which don't fit in the field itself. Therefore, those values are stored after the IFD (at file offsets 0x9e and 0xa6).

At the end of the IFD is the byte offset of the next IFD in the file (if the file contains multiple images) or 0 if, as in this case, the file only contains one image.

Tags 256 and 257 show that this image's dimensions are 12 x 12 pixels. Tag 273 tells where the pixel data begins; it is stored beginning at offset 0xae, in one "strip" with 144 bytes in it (the byte count is given by tag 279). This image is rather boring: an alternating pattern of light and dark bars.