This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

LUA: modifying http.post data.data

0

I wrote a function that read the data from:

f_data = Field.new("data.data")

and then decode the data of the post request, how do I put the decoded data back in the Packet Bytes window so that the "new" data gets higlighted / showen by clicking on "Hypertext Transfer Protocol" --> Data (data.data)?

asked 18 May '11, 00:57

chill's gravatar image

chill
16223
accept rate: 0%


2 Answers:

0

You can't. Modifying the underlying data in a packet is completely forbidden.

What you can do, however, is put the decoded data in a bytearray (if it's not already in a bytearray), construct a new tvbuff with Tvb.new_real, and then put the contents of that tvbuff into the protocol tree as a new item. Tvb.new_real will arrange that there will be a new tab in the Packet Bytes pane for the decoded data; clicking on the new protocol tree item will select that tab and highlight all the data in it.

answered 19 May '11, 14:30

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

1

Note that Tvb.new_real has been replaced by ByteArray.tvb (undocumented). The parameters of the new function are exactly the same as the old.

(20 May '11, 07:50) bstn

0

answered 28 Apr '13, 00:35

moceletsor's gravatar image

moceletsor
111
accept rate: 0%