我现在正在编写 Wireshark Dissector lua 脚本。
如何转换userdata
为十六进制字符串?
我想得到这样的输出0102030405060708000a0b0c0d0e0f10
我可以使用tostring
.
但它省略了长数据。
输出图像
如何在userdata
不省略长数据的情况下转换为十六进制字符串?
proto = Proto("Test", "My Test Protocol")
function proto.dissector(buffer, pinfo, tree)
print(tostring(buffer()))
-- "userdata"
-- print(type(buffer()))
end
tcp_table = DissectorTable.get("tcp.port")
tcp_table:add(1234, proto)
环境
- Wireshark 3.2.1