othrayte / lppb

Length Prefixed Protocol Buffers, plugin to Wireshark to add TCP support to dex/protobuf_dissector
GNU General Public License v3.0
7 stars 4 forks source link

can't process multiple messages of different lengths in one packet #3

Open wiedmann opened 6 years ago

wiedmann commented 6 years ago

FYI: there's an error in the handling that prevents multiple messages in one packet from working. The fix is easy:

  1. get_message_len third parameter change to offset from tree
  2. get the length from tvb:range(offset, .... instead of tvb:range(0, ....
  3. change dissect_message to call tvb:len() to retrieve length instead of calling get_message_len directly

Without the fix, lppb tries to dissect each message with the length of the first in the packet because get_message_len always looks at the first bytes of the tvb.

wiedmann commented 6 years ago

Here's a patched version of lppb.lua.

lppb.lua.txt