I defined the following packet:
p = IP()/TCP()/Unique()
where Unique is a new layer:
class Unique(Packet):
name = "Unique"
fields_desc=[ IntField("a", 0),
IntField("b", 0),
IntField("c", 0)]
I want to make a graphical PDF dump of p but If I use the command
p.pdfdump(test.pdf)
in the resulting .pdf file the Unique layer is not decoded and therefore it is represented just as Raw. How can I draw a custom layer?
You should use
rebuild
input parameter ofpdfdump
method. I don't know why (because lack of documentation on source code) but if you setrebuild=0
, your custom protocol details will appear in output. For example: