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

Function _SMBStrNullField

scapy/layers/smb.py:292–306  ·  view source on GitHub ↗

Returns a StrNullField that is either normal or UTF-16 depending on the SMB headers.

(name, default)

Source from the content-addressed store, hash-verified

290
291
292def _SMBStrNullField(name, default):
293 """
294 Returns a StrNullField that is either normal or UTF-16 depending
295 on the SMB headers.
296 """
297
298 def _isUTF16(pkt):
299 while not hasattr(pkt, "Flags2") and pkt.underlayer:
300 pkt = pkt.underlayer
301 return hasattr(pkt, "Flags2") and pkt.Flags2.UNICODE
302
303 return MultipleTypeField(
304 [(StrNullFieldUtf16(name, default), _isUTF16)],
305 StrNullField(name, default),
306 )
307
308
309def _len(pkt, name):

Calls 3

MultipleTypeFieldClass · 0.90
StrNullFieldUtf16Class · 0.90
StrNullFieldClass · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…