79485746

Date: 2025-03-05 07:44:56
Score: 0.5
Natty:
Report link

When you have weird/complex fields, you typically want to implement your own Field class in Scapy. This is rather easy to do, you just have to define a getfield function for dissection and addfield for build.

Here's an example that is somewhat relevant: https://github.com/secdev/scapy/blob/bff1ea03f5258f713ec900fd7bdaa546c7b566aa/scapy/contrib/mqttsn.py#L93

The longer documentation would be located over https://scapy.readthedocs.io/en/latest/build_dissect.html#fields

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Starts with a question (0.5): When you have we
  • High reputation (-1):
Posted by: Cukic0d