Пример #1
0
    def handleEvent(self, event):
        if not event.isDataTransaction():
            return
        if not event.data.startswith("USBC"):
            return

        header = Struct.Group(None, Struct.UInt32("sig"), Struct.UInt32("tag"),
                              Struct.UInt32("datalen"), Struct.UInt8("flag"),
                              Struct.UInt8("lun"), Struct.UInt8("cdblen"))
        cdb = header.decode(event.data)
        command = SCSICommand(cdb)

        event.pushDecoded("Storage Command: %s" % command)
        event.appendDecoded("\n%s" % command.params)
Пример #2
0
    def handleEvent(self, event):
        if not event.isDataTransaction():
            return
        if not event.data.startswith("USBS"):
            return

        header = Struct.Group(None, Struct.UInt32("sig"), Struct.UInt32("tag"),
                              Struct.UInt32("residue"), Struct.UInt8("status"))
        header.decode(event.data)

        if header.residue:
            residue = ', residue=%d' % header.residue
        else:
            residue = ''

        event.pushDecoded("Storage Status (%s%s)" %
                          (self._statusCodes[header.status], residue))
        event.appendDecoded("\n%s" % header)