有没有办法使用 Lua 在 Wireshark 中为自定义协议创建配置文件?

Is there a way to create a config file for a custom protocol in Wireshark, using Lua?

各位。我为 Wireshark 构建了一个自定义协议解析器,它有一些自己的偏好。截至目前,我已经成功地使用 Lua 以编程方式添加文本框、复选框等首选项。现在我想动态地允许用户在协议的首选项中添加一些自定义配置,如附图所示。

你能帮我做吗,如果有办法的话,最好在Lua?

不幸的是,Wireshark Lua Preferences API doesn't provide a User Access Table (UAT) preference, which is what would be needed here I think. You could open a Wireshark Issue asking for Lua UAT preference support though. In the meantime, it may be possible to read the parameters from a file directly from your Lua dissector, but you won't be able to edit/change those parameters like you can with other preferences. It might be possible to add a TextWindow 用于显示参数并允许用户更改它们,但该解决方案不会与您的 Lua 解析器集成,您可能需要重新加载 Lua 解剖器以便获取更改,可能 可以在用户更改参数时自动执行。

Wireshark wiki 和其他地方可能有一些用户贡献的 Lua 示例可以提供一些帮助?参见:

也许还有另一种方法可以完全解决这个问题,但没有想到其他方法。您可能想在 Wireshark's Q&A Site 上查询,以防万一该社区的其他人对您有进一步的建议。