Error when reloading lua plugins with a capture file loaded via a custom lua file handler
Summary
When using a custom lua file handler to open a file, the Reload Lua plugins feature doesn't quite work as expected. It does reload the plugins, but an internal error occurs and the packets are not rescanned and the packet list is blanked out.
The error dialog reads as follows:
An internal error occurred while reading the capture file "sample.iphex". (Error in file seek_read: Lua FileHandler is not registered
Steps to reproduce
- Create and register a custom lua file handler. I've attached a very simple example that is registered for files ending in
.iphex
and tries to read hex strings into raw IP packets, one per line. hex2pcap.lua - Open a file with your custom lua file handler. I've attached a simple custom file that can be loaded with the above file handler. It shows a simple DNS query and for "google.com" for PTR, A, and AAAA records. dns.iphex
- Run the "Reload Lua Plugins" command from the Analyze menu or using CTRL>SHIFTL.
- Observe that an error dialog pops up and the packet list is now empty.
What is the current bug behavior?
The capture file contents from a custom lua file handler are blanked out when reloading lua plugins.
What is the expected correct behavior?
The lua file handler should be re-run to reload the file contents when reloading the lua plugins.
Sample capture file
From above:
- hex2pcap.lua - a sample custom lua file handler
- dns.iphex - a sample file to load with the hex2pcap lua file handler
Build information
3.5.1-master (v3.5.1rc0-325-g92d77cef7a53)
Compiled (64-bit) using Microsoft Visual Studio 2019 (VC++ 14.29, build 30133),
with Qt 5.15.2, with libpcap, with GLib 2.66.4, with zlib 1.2.11, with Lua
5.2.4, with GnuTLS 3.6.3 and PKCS #11 support, with Gcrypt 1.8.3, with MIT
Kerberos, with MaxMind DB resolver, with nghttp2 1.42.0, with brotli, with LZ4,
with Zstandard, with Snappy, with libxml2 2.9.10, with libsmi 0.4.8, with
QtMultimedia, with automatic updates using WinSparkle 0.5.7, with AirPcap, with
SpeexDSP (using bundled resampler), with Minizip.
Running on 64-bit Windows 10 (21H1), build 19043, with Intel(R) Core(TM)
i7-2600K CPU @ 3.40GHz (with SSE4.2), with 16367 MB of physical memory, with
GLib 2.66.4, with Qt 5.15.2, with Npcap version 1.31, based on libpcap version
1.10.1-PRE-GIT, with c-ares 1.17.0, with GnuTLS 3.6.3, with Gcrypt 1.8.3, with
nghttp2 1.42.0, with brotli 1.0.9, with LZ4 1.9.2, with Zstandard 1.4.0, with
AirPcap 4.1.0 build 1622, with light display mode, without HiDPI, with
LC_TYPE=English_United States.utf8, binary plugins supported (21 loaded).