Open smarek opened 4 years ago
Lua runtime modified for 5.2 provided in cdc83b0f8933cb3ec28f5b8e7b7370fd5b55c1d3
BTW, can the dissector generator either be a separate project from Hytera Homebrew Bridge, or even better a part of KSC (wireshark dissectors target is a long awaited item in the wishlist).
@KOLANICH It should be, kaitai-to-wireshark is not really generator, as it does not reflect upon KSC definitions and hierarchy, and what I'm coding here is not generator either
if the KSC Lua runtime will be compatible with Lua 5.2, it should be doable, however I'm really unqualified in Lua, and it seems to me, that the dissector must be generated directly from KSC definitions, and it's not possible to just wrap around generated Lua classes.
It largery depends on the API Wireshark exposes and on availibility of "debug" code generation for lua target.
More precisely, debug API allows to get offsets for each seq
member. I have built upon "debug" API a tool generating tags for WxHexEditor
I might have dive depper into debug, because I hoped for some kind of object introspection/reflection on java/python to generate the final lua, instead of using the generated lua and wrapping around them
But seeing the tests Translator, it might be easier to write similar Wireshark translator instead
I've just updated ksy definitions and Lua runtime as well, so now it should be quite easy to finish that, but I'd still appreciate any help on that
This is related issue, not core issue, however I'm not skilled in Lua, so I'm gonna need some help here
cd kaitai ; kaitai-struct-compiler -t lua *.ksy
bit
classes instead of 5.3 bitwise operationsb(1) 0x00
keepalive / connection reset0x7e ...
hytera_radio_network_protocol0x5a 0x5a 0x5a 0x5a ...
ip_site_connect_protocol0x00 0x00 0x00 0x00 ...
if len==72 => ip_site_connect_protocolGuide on how to import sub-classes in wireshark dissectors https://mika-s.github.io/wireshark/lua/dissector/2018/12/18/creating-a-wireshark-dissector-in-lua-5.html
Also it might be easier to develop the dissector as binary plugin in C/C++ instead of Lua, due to wireshark Lua limitations