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

what is the LUA console and evaluator menu options?

1

i believe these are new features added in wireshark 2, but i don't know how to use them exactly i was hoping the console would at least print out any messages i use with print function in a dissector , but it does not.

asked 14 Mar '16, 02:38

EXM1110b's gravatar image

EXM1110b
21224
accept rate: 0%


One Answer:

1

I'm guessing that you're on Windows?

From the Wireshark Lua wiki page:

Please note: On Windows, you may not see any output when running Lua scripts in Wireshark. If the console window is enabled it will be opened after the lua engine is loaded. This does not affect TShark, since it is a console program.

That said, if you open the Lua -> Console and the Lua -> Evaluate dialogs, you can force your dissector to be loaded by typing the following and then clicking on Evaluate:

dofile("path/to/file.lua")

You should then see your output in the Lua console. Note that you will almost certainly need to keep your Lua dissector in a directory other than %APPDATA%\Wireshark\plugins\ until you're done testing it to avoid having Wireshark automatically load it when it starts up, because in almost all but the simplest of cases can it be loaded/run more than once - something like the hello.lua example being one that can be loaded more than once without a problem.

The Qt Wireshark version allows reloading of Lua dissectors via Analyze -> Reload Lua Plugins; however, that affects all plugins and the Qt version is missing the Tools -> Lua sub-menu altogether, so I don't know how you could achieve this with the Qt version.

Final note: Initially I was able to get Lua debug printed to the Lua Console, but after a bit of testing, it stopped for some unknown reason. I was at least able to open a console via Edit -> Preferences -> Open a console window -> Always (debugging) and obtain the Lua debug output that way instead.

answered 15 Mar '16, 11:15

cmaynard's gravatar image

cmaynard ♦♦
9.4k1038142
accept rate: 20%