Bless - Gtk# Hex Editor

Contents
Documentation

Table Of Contents

Requirements
Building and Installing Bless
Layouts
Contact information and bug reports

Requirements

The main target platform for bless is GNU/Linux. However all the libraries it uses are cross-platform, so it should be possible able to run without problems on all the major platforms (GNU/Linux, *BSD, Solaris, Win32) To build and run Bless you need:
  • GTK+ 2.x (Included in all modern GNU/Linux distributions, http://www.gtk.org)
  • mono/.NET runtime and C# compiler (http://www.mono-project.com)
  • Gtk# bindings for GTK+ (http://gtk-sharp.sourceforge.net)
  • pkg-config (Included in all modern GNU/Linux distributions)
Development is done using the latest stable versions of the above libraries. Although using an older version may be OK, there is no guarantee that there will not be problems.

Building, Installing and Running Bless

To build Bless you should follow the standard ./configure & make procedure. Note that the ./configure script is hand-made (not from autoconf) and just serves to make sure that your system has the mono libraries and set the installation directory prefix.

To build and install bless follow these steps:

Step 1: Untar the source package

For a tar.gz package use: tar -xzvf bless-a.b.c.tar.gz
For a tar.bz2 package use: tar -xjvf bless-a.b.c.tar.gz

Step 2: Configure the build

Enter the directory created in the previous step (bless-a.b.c) and type './configure'. The script will check if your system has all the required libraries. Use the "--prefix=*" option to set the installation directory prefix. By default the prefix is '/usr/local'.

Step 3: Build the program

Type 'make'. This will create 'bless.exe' in the src/ directory and the 'bless' launcher script in the bless-a.b.c directory.

Step 4: Install the program (optional)

Become root and type 'make install'.

Running the program

If you chose to install the program, just type 'bless'. In any case you can run the program by typing 'bless' in the 'bless-a.b.c' directory. Enjoy!

Layouts

The way Bless presents the data is highly customizable. The configuration is done through layout description files. Currently there is no way to graphically edit the layouts but one is planned for a later version.

Selecting a Layout

Bless searches for layout description files in the .bless/layouts directory in the user's home directory. You can preview and select the available layouts with the layout selection dialog, which can be accessed by the View->Layouts menu item.

Layout file format

Layout description files are XML files ending with the .layout suffix. They consist of the <layout> tag which contains a series of <area> tags that describe each area in the layout. The <area> tag takes one attribute, type, which defines the type of the area. The valid values for type are:

Type Description
hexadecimal Displays the data in hexadecimal format.
decimal Displays the data in decimal format.
octal Displays the data in octal format.
binary Displays the data in binary format.
ascii Displays the data in ascii format.
offset Displays the data offsets
separator A vertical line that visually separates areas.

For example, the following simple layout file:
<layout>
	<area type="offset"></area>
	<area type="separator"></area>
	<area type="offset"></area>
	<area type="separator"></area>
	<area type="ascii"></area>
</layout>
produces the standard offset-hex-ascii view with default colors:

Standard offset-hex-ascii view

Each area may include additional options about how to display the data. Some options are available to all areas whereas others are area-specific. The options that aren't explicitly defined assume their default values. Also if an option is specified for an area that doesn't support it, the option is just ignored.

Option Values Description Areas
display see below The fonts and colors that should be used for the display. all
case upper|lower Whether to display hexadecimal values using lowercase or uppercase. offset, hexadecimal
grouping #int The number of bytes that should be grouped together in each column. hexadecimal, decimal, octal, binary

The display option

The <display> option is the most complicated of the lot and deserves additional explanation.
Bless distinguishes between even and odd rows, and even and odd columns. You can choose how to color each of the above items thus creating a visual result tailored to your needs. This is achieved by using the <display> tag. Note that the first row and column are numbered as 0 and are therefore considered even.

A <display> tag may contain a <evenrow> and a <oddrow> tag which describe how the even and odd rows will look like. Each of the <evenrow> and <oddrow> tags may contain a <evencolumn>, an <oddcolumn> and a <selectedcolumn> tag. The first two describe the appearance of the respective columns and the latter the appearance of selected bytes in that row. The description is accomplished by using the <foreground> and <background> tags which specify the foreground and background colors to use.

The colors can be specified either by name (eg dark blue) or by an RGB triad (eg #ff004e).

display tag hierarchy

An example:
<layout>
    <area type="offset">
        <display>
            <evenrow>
                <evencolumn>
                    <foreground>dark red</foreground>
                </evencolumn>
            </evenrow>
            <oddrow>
                <evencolumn>
                    <foreground>dark red</foreground>
                </evencolumn>
            </oddrow>
        </display>                        
    </area>
    
    <area type="separator">
        <display>
            <evenrow>
                <evencolumn>
                    <foreground>dark green</foreground>
                    <background>white</background>
                </evencolumn>
            </evenrow>
        </display>                        
    </area>
    
    <area type="hexadecimal">
        <grouping>2</grouping>
        <case>upper</case>
        <display>
            <evenrow>
                <selectedcolumn>
                    <foreground>white</foreground>
                    <background>#8faec8</background>
                </selectedcolumn>
            </evenrow>    
            <oddrow>
                <evencolumn>
                    <background>#eeeeee</background>
                </evencolumn>
                <oddcolumn>
                    <background>#eeeeee</background>
                </oddcolumn>
                <selectedcolumn>
                    <foreground>white</foreground>
                    <background>#7b96ac</background>
                </selectedcolumn>
            </oddrow>    
        </display>    
    </area>

    <area type="separator">
        <display>
            <evenrow>
                <evencolumn>
                    <foreground>dark green</foreground>
                    <background>white</background>
                </evencolumn>
            </evenrow>
        </display>                        
    </area>
    
    <area type="decimal">
    </area>

    <area type="separator">
        <display>
            <evenrow>
                <evencolumn>
                    <foreground>dark green</foreground>
                    <background>white</background>
                </evencolumn>
            </evenrow>
        </display>                        
    </area>

    <area type="binary">
    </area>
</layout>


The result is:

display tag example

Not all font options are used in all areas. The hexadecimal, decimal, octal and binary areas use all options. The ascii, offset and separator areas do not use the <oddcolumn> tag.

Note: the */evencolumn/background colors are considered the primary background colors for their respective row. They are used to paint all parts of the row that are not otherwise painted (eg space between columns). The evenrow/evencolumn/background color is also considered the main background color of the area and is used to paint the unused parts of the area.

Contact information and bug reports

See the contact page.