by wpak » Sat Jan 14, 2006 4:46 pm
Mofi,
Thank you for asking!!
I want to decode some traces from the applications. Some information (communication dump) look like this:
06-01-11 19:45:21 - 0 TCP_MNAC : IP msg received - vcid 4
.0301010}`X@094037540004A0000010015.... ...117x.1
06-01-11 19:48:08 - 0 TCP_MNAC : IP msg received - vcid 4
.0399800h@]h09403754@0000000117x001000000020.... ...253.!
In this example, if I translate the message myself, it read like this:
For the first message:
Start of message (1 byte): . (hex 02)
Application Code (2 bytes): 03
Message Type (4 bytes): 0101
More Byte (1 byte): 0
Bit Map (4 bytes): }`X@ (hex 7D605840)
(bit 0111 1101 0110 0000 0101 1000 0100 0000)
Terminal Id: (8 bytes): 09402754
Seq number: (4 bytes): 0004
WCC: (1 byte): A
..
..
So on
For the second message:
Start of message (1 byte): .(hex 02)
Application Code (2 bytes): 03
Message Type (4 bytes): 9980
More Byte (1 byte): 0
Bit Map (4 bytes): h@]h (hex 68405D68)
(bit 0110 1000 0100 0000 0101 1101 0110 1000)
Terminal Id: (8 bytes): 09402754
WCC: (1 byte): @
..
..
So on
The challenge is:
The existing of fields (after the bitmap) is based on the bitmap. For example, the seq number field does not show in the second message because the 4th bit is '0' in the second message. I think I can write a VB script to decode the message (one at a time, on request). However, I have a problem to invoke the VB script (or a program) and pass the data to it in a quick and simple way.
The solution I have in mind is:
Place the cursor in the message that I want to decode. Invoke a macro: the macro will copy the message (let say, the whole line) in the clipboard and pass it to the VB script. But too bad, I don't know how to do it in UltraEdit.
At this current moment, how it display (a pop up window, or re-format the exiting file) is not important for me.
Thanks!!