Blog
Hex Editor Data Visualisation
Date: 30/8/2005
Over the last few days I've implemented a data visualisation tool for i.Hex. The basic idea is to allow the user to define the format of the data they are viewing. This is displayed in a 2nd pane as an object dump. Check out the screen shot:



The structure "Main" defined in the "Map Editor" window is being formatted from the current cursor location into the pane on the bottom right. Fields can be base types like "uint32" and "float" or user defined types, like "IccDateTime" which are defined in the Map Editor as well. e.g. the field "CreationDate" has sub fields.

You can reuse fields defined above the current member variable as array lengths.

You can also define specialisations of a classes that furthur define data. For instance you might have something like a generic field:
struct Field
{
    uint32 Id;
    uint32 Size;
    uint8 Data[Size];
};
But then go on to furthur define sub-types of "Field" like this:
struct StringField : inherits Field
{
    uint32 Id = 1001;
    uint32 Size;
    char String[Size];
}

struct IntField : inherits Field
{
    uint32 Id = 1002;
    uint32 Size = 4;
    uint32 IntValue;
}
Where the "= ????" parts define conditions that if met mean that the sub-type is to be used. Otherwise the parent type is used. This is the start of a powerful binary data definition language.

I don't know of any software package that lets you do this, even C++ isn't this powerful. I have thought that maybe a great C++ library would be something that reads the same structure map file that i.Hex now reads and then gives you access to the fields via a DOM so that you never have to do direct serialization in C++ ever again. Hmmm that sounds kinda nice. And if the file format changes you just edit the schema and don't have to recompile any code. My only thought is that it might be dog slow. However trading some flexibility for speed is often benificial, as long as you don't go too far. The right tool for the right job is a good motto.
Comments:

23/02/2014 7:57pm
A
 
Reply
From:
Email (optional): (Will be HTML encoded to evade harvesting)
Message:
 
Remember username and/or email in a cookie.
Notify me of new posts in this thread via email.
BBcode:
[q]text[/q]
[url=link]description[/url]
[img]url_to_image[/img]
[pre]some_code[/pre]
[b]bold_text[/b]