Closed jsoucheiron closed 11 years ago
Sure it's useful. Create transcript files and run xxd on the resulting files. Are you saying you want hex in the console mode output?
On Jan 17, 2013, at 6:54 AM, jsoucheiron notifications@github.com wrote:
It would be very useful to have an option to have a hex output of the flow. Sadly as of right now tcpflow is not usable for binary protocols.
— Reply to this email directly or view it on GitHub.
I would be extremely happy with an option that prints the output in both ascii and hex, quite like the -X option of tcpdump, but without all the headers. I haven't got time to set up my computer to compile the project myself yet (the version of libboost in ubuntu 10.04LTS is 1.40, it may take me a while to workaround this).
We will be incorporating the boost headers in the next release. Hex output is available now with the debug switch. I will add it for console output as well.
On Jan 17, 2013, at 7:29 AM, jsoucheiron notifications@github.com wrote:
I would be extremely happy with an option that prints the output in both ascii and hex, quite like the -X option of tcpdump, but without all the headers. I haven't got time to set up my computer to compile the project myself yet (the version of libboost in ubuntu 10.04LTS is 1.40, it may take me a while to workaround this).
— Reply to this email directly or view it on GitHub.
Thank you. I wasn't expecting such an incredibly fast response.
I updated my ubuntu and now I'm able to build it. Great! I can see the new -D option, but it doesn't seem to work (yet).
Glad it builds. Do you want to implement the -D option? If not, can you describe for me precisely what you want it to do? On May 22, 2013, at 7:08 AM, jsoucheiron notifications@github.com wrote:
I updated my ubuntu and now I'm able to build it. Great! I can see the new -D option, but it doesn't seem to work (yet).
— Reply to this email directly or view it on GitHub.
Have you ever tried the -X version of tcpdump? Something like that. Unfortunately I don't know when I'll have time to do it. But at least I'll try
Do you want this output to console? There are fundamental problems with reconstruction to console since it happens as the packets arrive. Or is this for offline? If it is offline, why not just use xxd?
On May 22, 2013, at 9:04 AM, jsoucheiron notifications@github.com wrote:
Have you ever tried the -X version of tcpdump? Something like that. Unfortunately I don't know when I'll have time to do it. But at least I'll try
— Reply to this email directly or view it on GitHub.
I have some devices that send data to a server. This devices send the data using a binary protocol. I'd like to be able to follow in realtime the binary comunication. I'll have to look into the code, but I'm guessing that somewhere there's a print buffer to console function. Instead of printing chars and dots when the value is not representable I'd like a plain hex chain all the time. I don't really need any ascii representation at all. I'll look into it, don't worry.
Yes, there is such a function. print_packet()
On May 22, 2013, at 9:25 AM, jsoucheiron notifications@github.com wrote:
I have some devices that send data to a server. This devices send the data using a binary protocol. I'd like to be able to follow in realtime the binary comunication. I'll have to look into the code, but I'm guessing that somewhere there's a print buffer to console function. Instead of printing chars and dots when the value is not representable I'd like a plain hex chain all the time. I don't really need any ascii representation at all. I'll look into it, don't worry.
— Reply to this email directly or view it on GitHub.
This should work. Please review the changes ;)
Why are you sprintf
ing into a buffer and then doing a fwrite
? It would be better to just do an fprintf
to stdout (or even a printf
. Also, you should insert line breaks so it doesn't wrap over 80 characters. Why not do a proper hex dump?
Unfortunately my c++ knowledge is limited. This is the first solution I got working. Feel free to improve it anyway you like. What would you add to have proper hex dump? A new line every 64 chars should work great. It's good to debug and good to read.
It would be very useful to have an option to have a hex output of the flow. Sadly as of right now tcpflow is not usable for binary protocols.