128technology / protobuf_dissector

A Wireshark Lua plugin for decoding Google protobuf packets
MIT License
186 stars 56 forks source link

Lua: Error during loading on macOS #7

Open imdreamrunner opened 7 years ago

imdreamrunner commented 7 years ago

Hey guys, I have the following error during launch of the Wireshark.

Lua: Error during loading:
 ...gins/protobuf_dissector/modules/generic/proto_fields.lua:36: bad argument #3 to 'bytes' (Display must be either base.NONE, base.DOT, base.DASH, base.COLON or base.SPACE)

Wireshark version Version 2.4.2 (v2.4.2-0-gb6c63ae). macOS version 10.12.6 (16G29)

3fr61n commented 7 years ago

Error message at start up....

Lua: Error during loading: ...otobuf_dissector-master/modules/generic/proto_fields.lua:36: bad argument #3 to 'bytes' (Display must be either base.NONE, base.DOT, base.DASH, base.COLON or `base.SPACE)

macOS version 10.12.6 (16G29) Wireshark Version 2.4.2 (v2.4.2-0-gb6c63ae)

hashtree commented 6 years ago

I got the same error. According to the latest wireshark lua api wiki, just figure out it caused by the update of api(ProtoField.bytes) in certain version after 1.12.0. So the fix is to update the 3 lines to as below in file proto_fields.lua.

36: value    = ProtoField.bytes ("protobuf.value", "Value", base.SPACE, "Field value bytes"),
43: GROUP    = ProtoField.bytes ("protobuf.group", "Group", base.SPACE, "Unknown Group Field"),
44: LENGTH_BYTES = ProtoField.bytes("protobuf.length_delimited_bytes", "Length Delimited Bytes", base.SPACE, "Unknown Length Delimited Field"),

Hope the helpful!


Ref: https://www.wireshark.org/docs/wsdg_html_chunked/lua_module_Proto.html

11.6.7.21. ProtoField.ubytes(abbr, [name], [display], [desc]) Creates a ProtoField for an arbitrary number of unsigned bytes.

Arguments abbr Abbreviated name of the field (the string used in filters). name (optional) Actual name of the field (the string that appears in the tree). display (optional) One of base.NONE, base.DOT, base.DASH, base.COLON or base.SPACE. desc (optional) Description of the field.

BlackHobbiT commented 6 years ago

Btw it's also appears on ubuntu 16.04 wireshark=2.4.3-1 too. And @hashtree recipe works!

super-sean commented 5 years ago

I got another error Lua: Error during loading: .../protobuf_dissector-master/modules/generic/proto.lua:35: bad argument #1 to 'new' (Proto_new: there cannot be two protocols with the same name)

adityavikasd commented 5 years ago

Changing line 35 in proto.lua to this helped: GenericProto.proto = Proto.new("Protobuf2", "Google Protobuf Format")

zoeyTM commented 5 years ago

Running MacOS 10.14.5; Wireshark version 3.0.3

Got the plugin loaded without errors after following the suggestions from both @hashtree & @adityavikasd. Thanks guys!

qjh-nj commented 3 years ago

Running MacOS 10.14.5; Wireshark version 3.0.3

Got the plugin loaded without errors after following the suggestions from both @hashtree & @adityavikasd. Thanks guys!

Agree! Thanks you! @hashtree & @adityavikasd