trendmicro / RFQuack

RFQuack: the versatile RF-analysis tool that quacks!
https://git.io/rfquack
Other
90 stars 3 forks source link

DSL for packet manipulation rules #3

Open phretor opened 5 years ago

phretor commented 5 years ago

On the client side, provide an expressive packet-manipulation mini language. For instance:

q.add_packet_manipulation("/[ke]$/: [2] ^= 0x30")
q.add_packet_manipulation("[5] ^= 0x04")
q.add_packet_manipulation("[@'A')] &= 0x03")

would be equivalent to

q.add_packet_manipulation(pattern='[ke]$', position=2, operation=3, operand=0x30)
q.add_packet_manipulation(position=5, operation=3, operand=0x04)
q.add_packet_manipulation(content=b'\x42', operation=1, operand=0x03)