Пример #1
0
class MySQL_Result_Error(Packet):
    name = "MySQL Result Error"
    fields_desc = [
        ByteField("ResultMarker", 0xff),
        LEShortField("Errno", 0),
        StrFixedLenField("SQLStateMarker", b'#', 1),
        StrFixedLenField("SQLState", b' ' * 5, 5),
        StrField("Message", b'')
    ]
Пример #2
0
class MySQL_Result_OK(Packet):
    name = "MySQL Result OK"
    fields_desc = [
        ByteField("ResultMarker", 0x00),
        LengthCodedIntField("AffectedRows", 0),
        LengthCodedIntField("InsertID", 0),
        LEShortEnumField("ServerStatus", SERVER_STATUS_AUTOCOMMIT,
                         MySQL_Server_Status),
        LEShortField("WarningCount", 0),
        StrField("Message", b'')
    ]
Пример #3
0
class TDS_Login7_Request(Packet):
    name = "TDS Login7 Request"
    fields_desc = [
        LEIntField("Length", 0),
        LEIntField("TDSVersion", 0),
        LEIntField("PacketSize", 0),
        LEIntField("ClientProgVer", 0),
        LEIntField("ClientPID", 0),
        LEIntField("PID", 0),
        FlagsField("OptionFlags1", 0, -8, TDS_OptionFlags1),
        FlagsField("OptionFlags2", 0, -8, TDS_OptionFlags2),
        FlagsField("TypesFlags", 0, -8, TDS_TypesFlags),
        FlagsField("OptionFlags3", 0, -8, TDS_OptionFlags3),
        LEIntField("ClientTimeZone", 0),

        # start of ClientLCID field
        LEShortField("LCID", 0x0),
        FlagsField("ColFlags", 0, -8, TDS_ColFlags),
        ByteField("Version", 0x0),
        # end of ClientLCID field

        # start of OffsetLength field
        LEShortField("ibHostName", 0),
        LEShortField("cchHostName", 0),
        LEShortField("ibUserName", 0),
        LEShortField("cchUserName", 0),
        LEShortField("ibPassword", 0),
        LEShortField("cchPassword", 0),
        LEShortField("ibAppName", 0),
        LEShortField("cchAppName", 0),
        LEShortField("ibServerName", 0),
        LEShortField("cchServerName", 0),
        LEShortField("ibUnused", 0),
        LEShortField("cbUnused", 0),
        LEShortField("ibCltIntName", 0),
        LEShortField("cchCltIntName", 0),
        LEShortField("ibLanguage", 0),
        LEShortField("cchLanguage", 0),
        LEShortField("ibDatabase", 0),
        LEShortField("cchDatabase", 0),
        StrFixedLenField("ClientID", "012345", 6),
        LEShortField("ibSSPI", 0),
        LEShortField("cbSSPI", 0),
        LEShortField("ibAtchDBFile", 0),
        LEShortField("cchAtchDBFile", 0),
        #LEShortField("ibChangePassword",0),	# introduce in TDS 7.2
        #LEShortField("ibChangePassword",0),	# introduce in TDS 7.2
        #LEIntField("cbSSPILong",0),		# introduce in TDS 7.2
        # end of OffsetLength field
        StrField("Payload", ""),
    ]
Пример #4
0
class TDS_SQLBatchData(Packet):
    name = "TDS SQL Batch Data"
    fields_desc = [
        #		StrLenField("SQLBatchData","", length_from=lambda x: x.underlayer.Length-8),
        StrField("SQLBatchData", ""),
    ]
Пример #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_INIT_DB(Packet):
    name = "MySQL Command INIT DB"
    fields_desc = [StrField("Database", b"")]