MCPcopy Index your code
hub / github.com/secdev/scapy / FILE_BOTH_DIR_INFORMATION

Class FILE_BOTH_DIR_INFORMATION

scapy/layers/smb2.py:554–592  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

552
553
554class FILE_BOTH_DIR_INFORMATION(Packet):
555 fields_desc = (
556 [
557 LEIntField("Next", None), # 0 = no next entry
558 LEIntField("FileIndex", 0),
559 ]
560 + (
561 FileNetworkOpenInformation.fields_desc[:4]
562 + FileNetworkOpenInformation.fields_desc[4:6][::-1]
563 + [FileNetworkOpenInformation.fields_desc[6]]
564 )
565 + [
566 FieldLenField("FileNameLength", None, fmt="<I", length_of="FileName"),
567 MultipleTypeField(
568 # "If FILE_ATTRIBUTE_REPARSE_POINT is set in the FileAttributes field,
569 # this field MUST contain a reparse tag as specified in section
570 # 2.1.2.1."
571 [
572 (
573 LEIntEnumField("EaSize", 0, REPARSE_TAGS),
574 lambda pkt: pkt.FileAttributes.FILE_ATTRIBUTE_REPARSE_POINT,
575 )
576 ],
577 LEIntField("EaSize", 0),
578 ),
579 ByteField("ShortNameLength", 0),
580 ByteField("Reserved1", 0),
581 StrFixedLenField("ShortName", b"", length=24),
582 PadField(
583 StrLenFieldUtf16(
584 "FileName", b".", length_from=lambda pkt: pkt.FileNameLength
585 ),
586 align=8,
587 ),
588 ]
589 )
590
591 def default_payload_class(self, s):
592 return conf.padding_layer
593
594
595class _NextPacketListField(PacketListField):

Callers

nothing calls this directly

Calls 8

LEIntFieldClass · 0.90
FieldLenFieldClass · 0.90
MultipleTypeFieldClass · 0.90
LEIntEnumFieldClass · 0.90
ByteFieldClass · 0.90
StrFixedLenFieldClass · 0.90
PadFieldClass · 0.90
StrLenFieldUtf16Class · 0.90

Tested by

no test coverage detected