Пример #1
0
class MySQL_Client_Authentication(Packet):
    name = "MySQL Client Authentication"
    fields_desc = [
        FlagsField("ClientCapabilities", 0, -16, MySQL_Capabilities),
        FlagsField("ClientExCapabilities", 0, -16,
                   MySQL_Extended_Capabilities),
        LEIntField("MaxPacketSize", 0),
        ByteField("CharSetNumber", 0),
        StrFixedLenField("Filler", b"", 23),
        StrNullField("User", "bob"),
        LengthCodedBinaryField("ScrambleBuffer", b""),
        StrNullField("DatabaseName", b"")
    ]
Пример #2
0
class MsgQuery(Packet):
    name = "Wire Protocol OP_QUERY"
    fields_desc = [
        LEIntField("flags", 0),
        StrNullField("fullCollectionName", ""),
        LEIntField("numberToSkip", 0),
        LEIntField("numberToReturn", 0)
    ]
Пример #3
0
class MySQL_Server_Greeting(Packet):
    name = "MySQL Server Greeting"
    fields_desc = [
        ByteField("ProtocolVersion", 10),
        StrNullField("ServerVersion", "5.0.54"),
        IntField("ThreadID", 4711),
        StrFixedLenField("ScrambleBuffer", "a" * 8, 8),
        ByteField("Filler0", 0),
        FlagsField(
            "ServerCapabilities", CLIENT_LONG_FLAG | CLIENT_CONNECT_WITH_DB
            | CLIENT_COMPRESS | CLIENT_PROTOCOL_41 | CLIENT_TRANSACTIONS
            | CLIENT_SECURE_CONNECTION, -16, MySQL_Capabilities),
        ByteField("ServerLanguage", 33),
        LEShortEnumField("ServerStatus", SERVER_STATUS_AUTOCOMMIT,
                         MySQL_Server_Status),
        StrFixedLenField("Unused", b"", 13),
        StrNullField("Salt", " " * 12)
    ]
Пример #4
0
class MsgCommand(Packet):
    name = "Wire Protocol OP_COMMAND"
    fields_desc = [
        StrNullField("database", ""),
        StrNullField("commandName", "")
    ]
Пример #5
0
class MySQL_COM_FIELD_LIST(Packet):
    name = "MySQL Command FIELD LIST"
    fields_desc = [StrNullField("Table", b""), StrField("Column", b"")]
Пример #6
0
class MySQL_COM_QUERY(Packet):
    name = "MySQL Command QUERY"
    fields_desc = [StrNullField("Query", b"")]