LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-31-2007, 09:42 AM   #1
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 57
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
 
Old 01-31-2007, 09:55 AM   #2
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
tcpdump is an alternative which knows how to parse network traffic.
 
Old 01-31-2007, 09:59 AM   #3
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 57
Its my own protocol. Will tcpdump understand it?
 
Old 01-31-2007, 10:30 AM   #4
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
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?
 
Old 01-31-2007, 10:51 AM   #5
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 57
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.

Last edited by nx5000; 01-31-2007 at 11:19 AM.
 
Old 01-31-2007, 11:51 AM   #6
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 57
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
 
Old 01-31-2007, 12:07 PM   #7
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
data workshop looks interesting.
 
Old 01-31-2007, 01:07 PM   #8
nx5000
Senior Member
 
Registered: Sep 2005
Location: Out
Posts: 3,307

Original Poster
Rep: Reputation: 57
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ASN.1 BER file decoding maheshdf Linux - Newbie 1 11-29-2006 05:49 AM
Decoding the contents of .Doc file yashwantpinge Programming 1 04-07-2006 11:35 AM
decoding a sys file on a windows machine damoncf Linux - Software 1 05-05-2005 02:10 AM
Ultraedit lookalike Dnpa Linux - Software 3 02-19-2005 10:46 PM
UltraEdit on Linux? correro Linux - Software 9 03-12-2003 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:44 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration