How to automate conversion of C++ file to Wireshark Lua dissector

孤街醉人 提交于 2019-12-10 17:12:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!