Page 1 of 1

HxD: partition table editor/viewer

Posted: 11 Dec 2008 08:31
by hans_meier
hi Maël and all the others,

thank you for the *nice* HxD editor!

what i've missed sometimes was the ability to view a disk's partition table
(and ideally edit it) in a human readable format.

what do you think?

Re: HxD: partition table editor/viewer

Posted: 13 Dec 2008 01:47
by Maël
Indeed, sounds useful and is planned.

Re: HxD: partition table editor/viewer

Posted: 12 Mar 2009 03:18
by g3gg0
maybe its generally a good idea to specify some format templates.
e.g. similar to C structs and displaying the data at cursor position in this format.

types i can think of:
uint8, uint16, uint24, uint32, int8, ... - integer values
float, double, quad - floating point numbers
bit - used for bitmasks
char[...], utf8[...], utf16[...], utf32[...] - character array.
any_type[...] - arrays of any structure or type. so nesting is possible.

if "..." is a value, its fixed length. if "..." is text, use the field with that name as length.
for every multi-byte type should be types for big and little endianess (_le, _be)


Code: Select all

struct some_descriptor {
    uint32_le entries;
    some_format[entries] data;

struct some_format {
    uint32_le length;
    uint16_le type;
    some_bitmask flags;
    char[32] name;
    char[length] data;

struct some_bitmask {
    bit used;
    bit deleted;
    bit truncated;
    bit hidden;
    bit[4] unused;
now when clicking at some data in the hexdump, show the structure dumps in an extra window/toolbar.
maybe also coloring of the hexdump for every entry and highlighting hexdump bytes when selecting some struct entry in the extra window.

i wonder if its possible to design this thing on a per-bit basis, so that its possible to have e.g. a bit field followed by a char.
especially in serial protocols you often have 1 or 2 bits for synchronisation and maybe 8 data bits.
that would allow to analyze raw serial stream dumps also.
that requires to calculate in bit sizes, but should be not a big issue. its not much processing overhead to allow this :)

if i can help you with programming this, just tell me :)

Re: HxD: partition table editor/viewer

Posted: 12 Mar 2009 03:22
by g3gg0
oh i forgot to add a type:
align[n] - align the struct to n-bit boundary

Code: Select all

struct test {
    uint32_le length;
    char[length] data;
    align[32] padding;
will align the struct size to a 32-bit boundary, multiple of 4 bytes.

Re: HxD: partition table editor/viewer

Posted: 18 Mar 2009 15:16
by Maël
Something along those lines is planned, including support for importing structs from several languages. The main method would be to enter structs using a GUI and selecting parts in the hex editor as your work your way through the file and identify specific portions that you think should be of a specific type. Templates/structs defined this way will also be exportable.