PhiLiZound Software
Index
Page updated: 28-Oct-2013

HexAnno

Overview

This is a command-line utility for assisting in decoding files - all a bit 'belt & braces' and nothing really clever, but was useful for getting my head round the convoluted structure of EMU sampler files (see DecodeEMU).

HexAnno is used to gradually build up a 'steering' file which holds annotation info. When you first run it, it creates a straight hex dump of the target file which you manually inspect as normal.

If you spot any patterns, items of interest or suspected tables etc, you add these offsets & comments to the annotation file. You then re-run hexanno and it uses the extra info to create a better hex dump. You then look for more patterns, tweak the annotation file and repeat... so the annotation file ends up being the 'spec' for the file structure.

Here's an example of a binary file (an EMU 'E3B' file, not fully cracked yet), along with the latest state of the annotation file and the hex output obtained using it.

HexAnno can be used with any type of file, but there have been a few enquiries about the EMU file structure so click here for more details.


Command syntax

HexAnno -f <file> [<text-options> | <hex-options>]
  Output the contents of <file> in text mode (default) or annotated hex mode

  Text mode options: -t [<len>] [-i] [-v [<level>]] [-r]
  File is searched for contiguous text of specified size
    -t = text length, 1..64, default 16
    -i = indent line if text seems useful; helps separate wanted from unwanted text
    -v = verbosity level, 1..3, default 1
    output generated by levels 2..3 can be used directly in hex annotation file
    -r = recurse sub-folders

  Hex mode options: -w [<width>] [-a [<anno-file>]]
  File is output with <width> hex chars per line
    -w  set <width> to initial value, 1..64, default 16
    -a  use <anno-file> for further annotation/layout controls
    output annotation syntax if <anno-file> is blank

Filenames can contain wildcards; use quotes if any filenames contain spaces.

Output defaults to screen but you can redirect to a file for inspecting later, e.g.
HexAnno -f *.e3b -i -r > E3B.txt

Annotation file syntax

Blank lines, leading spaces and any text after ';' is ignored
Each line can be one of the following:-

  {0|-}<block-offset>[,<width>]
    When <block-offset> offset reached, a newline is output followed
    by any annotation entries up to next <block-offset> entry
    A -ve offset terminates processing when offset reached
    <width> overrides current hex width setting

  <start-tag><tag-offset>[-<tag-offset>]<end-tag>[<tag-annotation>]
    Start/end tags are pairs of bracket symbols (,<,[,{, for tagging
    hex chars within specified offset range
    Only one of each tag type allowed within a block
    Line is output if <tag-annotation> present

  <annotation>
    any text not starting with '0', '-', or <start-tag>

Minimum system requirements

Windows 98SE and later.
Tested on Windows XP.

Downloads

HexAnno V1.10  28-Oct-2013

The program is free, but if you pass it on, please keep the package intact.  

Installing

There is no 'installation' - the downloadable file is the main executable you run, so download & save it to a folder of your choice.
This is a command-line utility so unless you add parameters to its shortcut it needs to be run from a command window; nothing will happen if you just double-click it. Starting a command window varies according to your version of Windows; some examples are:-
In the command window, type HexAnno to see the list of options.
Contact me if you have any problems.

Uninstalling

Just delete the executable file you downloaded.

Phil Tipping, 2013