问题
I have a C++ file defining a certain protocol. The file contains structs which define the messages used in the protocol. Each struct contains fields for a certain message. An example would be as follows:
struct STATS00_MESSAGE_T
{
uint8_t message_type
uint16_t num_sends;
uint8_t num_failures;
};
What is the best or easiest way to convert a C++ file containing a lot of structs like these into a Lua dissector for Wireshark? The Lua dissector should be able to dissect the fields of the messages.
The C++ file is quite complex containing several enums, typedefs, Boost macros, includes, etc. So, writing a brute-force parsing script like Perl to do the automated conversion from C++ to Lua dissector is not that easy to do. Are there existing tools we can use to facilitate the conversion process?
来源:https://stackoverflow.com/questions/34705116/how-to-automate-conversion-of-c-file-to-wireshark-lua-dissector