diff options
Diffstat (limited to 'wireshark/pictochat.lua')
-rw-r--r-- | wireshark/pictochat.lua | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/wireshark/pictochat.lua b/wireshark/pictochat.lua index 79345f6..9f8cad0 100644 --- a/wireshark/pictochat.lua +++ b/wireshark/pictochat.lua @@ -1,7 +1,11 @@ +require "util" + local p = Proto("pictochat", "PictoChat") p.fields.unknown = ProtoField.uint16("pictochat.unknown", "Unknown") +p.fields.magic = ProtoField.bytes("pictochat.magic", "Magic") +p.fields.new = ProtoField.bool("pictochat.new", "New") p.fields.msg_type = ProtoField.uint8("pictochat.msg_type", "Message type", base.DEC, { [0] = "???", [1] = "???", @@ -19,7 +23,6 @@ p.fields.data_offset = ProtoField.uint16("pictochat.data_offset", "Data offset") p.fields.data_sequence = ProtoField.uint16("pictochat.data_sequence", "Data sequence") p.fields.data = ProtoField.bytes("pictochat.data", "Data") p.fields.sequence = ProtoField.uint16("pictochat.sequence", "Packet sequence") -p.fields.magic_trailer = ProtoField.bytes("pictochat.magic_trailer", "Magic (trailer)") p.fields.user_mac = ProtoField.ether("pictochat.user.mac", "Address") p.fields.user_name = ProtoField.string("pictochat.user.name", "Nickname") p.fields.user_msg = ProtoField.string("pictochat.user.msg", "Message") @@ -47,11 +50,16 @@ p.fields.msg_start_len = ProtoField.uint8("pictochat.msg.start_len", "Total leng local state = {} +function p.init() + local dt = DissectorTable.get("dslmp") + dt:add(GAMEID.PICTOCHAT, p) +end + function p.dissector(buffer, pinfo, tree) local subtree = tree:add(p, buffer(), string.format("%s: %d bytes", p.description, buffer():len())) - subtree:add_le(p.fields.unknown, buffer(0x00, 2)) - subtree:add_le(p.fields.unknown, buffer(0x02, 2)) + subtree:add_le(p.fields.magic, buffer(0x00, 2)) + subtree:add_le(p.fields.new, buffer(0x02, 2)) subtree:add_le(p.fields.msg_type, buffer(0x04, 1)) local msg_type = buffer(0x04, 1):le_uint() subtree:add_le(p.fields.unknown, buffer(0x05, 1)) |