LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Ultraedit like for binary file decoding (https://www.linuxquestions.org/questions/linux-software-2/ultraedit-like-for-binary-file-decoding-524367/)

nx5000 01-31-2007 09:42 AM

Ultraedit like for binary file decoding
 
I'm looking for a tool to automate the analysis of a binary file. Like ultraedit
This binary file is an excerpt of a network protocol. I have the definition of headers and data, bit by bit.
I would like to write a mapping like
Quote:

bit 0-10: Size
bit 11-13: Source
bit 14-16: Destination
...
byte 13: CRC
...
next packet
...
And the tool should decode the binary file and produce a symbolic human readable text file, detailing every packet. They have fixed length so it shouldn't be a problem.

I know wireshark can do this but its a bit huge for what I want to do.

As usual, only GPL or BSD license software ;)

matthewg42 01-31-2007 09:55 AM

tcpdump is an alternative which knows how to parse network traffic.

nx5000 01-31-2007 09:59 AM

Its my own protocol. Will tcpdump understand it?

matthewg42 01-31-2007 10:30 AM

Probably not then. I don't know maybe it has some mechanism for this.

If your protocol was happily byte-aligning it's data I'd hack up a perl script with pack and unpack to pretty-print the data, but since you're using compressed, non-byte aligned data, it's probably easier with C.

I don't know, maybe there is a nice utility which can do this. If there is I'd like to know about it too. I didn't know ultraedit could do this. Myabe it runs under wine?

nx5000 01-31-2007 10:51 AM

That's nice of you for the perl script but I have to do it myself (..)
Yeah I did a C program a few month ago for extracting some information of the packets but now I would like some pretty display and I'm not really keen on programming at the moment, lazy me.

I'm currently looking at dissectors of ethereal (wireshark) but it seems it doesn't take arbitrary input file format. argggh

Any other idea for an advanced editor that does this is welcome.

nx5000 01-31-2007 11:51 AM

Ok I've found 2 after googling like maniac
http://hachoir.org/wiki/WriteYourParser
hachoir seems very interesting for a lot of purpose like editing video, music tags, lots of things
https://gna.org/projects/dataworkshop

matthewg42 01-31-2007 12:07 PM

data workshop looks interesting.

nx5000 01-31-2007 01:07 PM

Yes very interesting.
I hope it doesn't take me more time to understand how it works than it took me to learn C language :)


All times are GMT -5. The time now is 01:11 AM.