A
A
Anton Alisov2013-02-08 00:05:18
Programming
Anton Alisov, 2013-02-08 00:05:18

What tools do you use when debugging saving/loading native format files?

Every time I suffer when I have to write code for saving / loading files of my own (binary) format. Files can have a rather complex structure, with indication of local and global offsets, sometimes with compression of individual blocks within the file by standard algorithms. After writing the code for saving the file, there is a need to "trace" the contents of the file itself, that it meets expectations.
Maybe there is some convenient tool and / or editor in which I could move in the file by offsets (by global offset, as well as locally (from the current location), back and forth by a given number of bytes). Is there also a need to tear out separate pieces of data from the middle of the file to another file, view the file both in a purely binary form, and, for example, in the form of a list of 4-byte, 8-byte values ​​or structures of a previously described type? A sort of very sophisticated, modern, powerful hex editor?
need help!

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Killy, 2013-02-08
@alan008

I know one such hex editor where you can create your own structure templates: 010 Editor (not free, though).

A
Alexey Huseynov, 2013-02-08
@kibergus

And what forces you to use complex native binary formats? There is protobuf, which provides the possibility of cross-platform reading of received records and the ability to add new fields without losing binary compatibility. There is also bson.
Or do you need super efficiency and the ability to load data as it is into memory, cast a pointer and use an already loaded class?

M
MikhailEdoshin, 2013-02-08
@MikhailEdoshin

Maybe just write tests - write a spreading example with all possible options and test code to see how it reads? Of the Python tools, for example, there is such construct , a declarative parser for binary formats, it seems to me that it should be convenient to test with it (although specialized tests can be easily written with a regular struct).
In general, I join the previous speaker - why not use a standard serializer?

K
Killy, 2013-08-31
@Killy

Another editor with file format templates. HexEdit . Free. (There is also a pro version, but I did not find how it differs.)
The interface is hello from the 90s. Usability leaves much to be desired. But at least there are more features than in other free editors.
There is a suspicion that working with templates is very tricky, but perhaps I have not figured everything out yet.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question