how to invert two bytes in lua script dissector ?
Hello, I'm writting a wireshark dissector using .lua script. I meet a problem with fields where most significant byte is inverted. Two cases, 16bits and 32 bits fields. In the network packet, it is present with the format : "02 80" i want to display 80 02 "14 7d 00 00" i want to display 00 00 7d 14
I tried to use the bit.bswap()
function as followed :
local bit = require("bit")
...
local SAI_data = tvbuf:range(2,2):uint()
SAI_data = bit.bswap(SAI_data)
But i got an error as the bit library or bit.lua script is not installed. Is it possible to install it ? How to do that ? Or is there any other way to configure the range function to invert read bytes ?
Thank you