scapy.layers.usb

Default USB frames & Basic implementation

class scapy.layers.usb.USBpcap(_pkt, /, *, headerLen=None, res=0, irpId=0, usbd_status=0, function=0, info=0, bus=0, device=0, endpoint=0, transfer=0, dataLength=None)[源代码]

基类:Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|   HEADERLEN   |      RES      |             IRPID             |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
|                                                               |
+                               +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |          USBD STATUS          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                               |            FUNCTION           |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|      INFO     |              BUS              |     DEVICE    |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|               |    ENDPOINT   |    TRANSFER   |   DATALENGTH  |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                                               |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                           Fig. USBpcap                           
USBpcap fields

headerLen

ByteField

None

res

ByteField

0

irpId

XLELongField

0

usbd_status

LEIntEnumField

0

function

LEShortEnumField

0

info

XByteField

0

bus

LEShortField

0

device

LEShortField

0

endpoint

XByteField

0

transfer

ByteEnumField

0

dataLength

LenField

None

guess_payload_class(payload)[源代码]
post_build(p, pay)[源代码]
class scapy.layers.usb.USBpcapTransferControl(_pkt, /, *, stage=0)[源代码]

基类:Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|     STAGE     |
+-+-+-+-+-+-+-+-+

                   Fig. USBpcapTransferControl                    
USBpcapTransferControl fields

stage

ByteField

0

class scapy.layers.usb.USBpcapTransferInterrupt(_pkt, /, *, startFrame=0, numberOfPackets=0, errorCount=0)[源代码]

基类:Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           STARTFRAME                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                        NUMBEROFPACKETS                        |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                           ERRORCOUNT                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                  Fig. USBpcapTransferInterrupt                   
USBpcapTransferInterrupt fields

startFrame

LEIntField

0

numberOfPackets

LEIntField

0

errorCount

LEIntField

0

class scapy.layers.usb.USBpcapTransferIsochronous(_pkt, /, *, offset=0, length=0, usbd_status=0)[源代码]

基类:Packet

aliastypes
fields_desc
Display RFC-like schema
 0                   1                   2                   3
 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             OFFSET                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                             LENGTH                            |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|                          USBD STATUS                          |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

                 Fig. USBpcapTransferIsochronous                  
USBpcapTransferIsochronous fields

offset

LEIntField

0

length

LEIntField

0

usbd_status

LEIntEnumField

0