MCPcopy Create free account
hub / github.com/secdev/scapy / NDRFieldListField

Class NDRFieldListField

scapy/layers/dcerpc.py:2037–2057  ·  view source on GitHub ↗

A FieldListField for NDR

Source from the content-addressed store, hash-verified

2035
2036
2037class NDRFieldListField(NDRConstructedType, FieldListField):
2038 """
2039 A FieldListField for NDR
2040 """
2041
2042 islist = 1
2043
2044 def __init__(self, *args, **kwargs):
2045 kwargs.pop("ptr_pack", None) # TODO: unimplemented
2046 if "length_is" in kwargs:
2047 kwargs["count_from"] = kwargs.pop("length_is")
2048 elif "size_is" in kwargs:
2049 kwargs["count_from"] = kwargs.pop("size_is")
2050 FieldListField.__init__(self, *args, **kwargs)
2051 NDRConstructedType.__init__(self, [self.field])
2052
2053 def i2len(self, pkt, x):
2054 return len(x)
2055
2056 def valueof(self, pkt, x):
2057 return [self.field.valueof(pkt, y) for y in x]
2058
2059
2060class NDRVaryingArray(_NDRPacket):

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…