Exemplo n.º 1
0
def test(data):
    jce = JceInputStream(data)
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jcemapdata = jce.ReadValue()[6:]
    jce_1 = JceInputStream(jcemapdata)
    print jce_1.ReadValue()
    print jce_1.ReadValue()
Exemplo n.º 2
0
def AddFriendSetting(data):
    jce = JceInputStream(data)
    my_qqnumber = jce.ReadNumber()
    add_qqnumber = jce.ReadNumber()
    verify_type = jce.ReadByte()
    COUNT = jce.ReadList()
    if COUNT == 1:
        p = jce.data[2:]
        question = jce.ReadString()
    else:
        question = ''
    return [my_qqnumber, add_qqnumber, verify_type, question]
Exemplo n.º 3
0
def FriendGroupList(data):
    list = []
    value = data[7]
    friend_count = data[6]
    jce = JceInputStream(value)
    for item in range(friend_count):
        dict = {}

        jce.getHex(2)  #0A
        dict['friendUin'] = jce.ReadNumber()
        dict['groupId'] = jce.ReadByte()
        dict['faceId'] = jce.ReadShort()
        dict['name'] = jce.ReadString()
        dict['sqqtype'] = jce.ReadByte()
        dict['status'] = jce.ReadByte()
        dict['memberLevel'] = jce.ReadByte()
        dict['isMqqOnLine'] = jce.ReadByte()
        dict['sqqOnLineState'] = jce.ReadByte()
        dict['isIphoneOnline'] = jce.ReadByte()
        dict['detalStatusFlag'] = jce.ReadByte()
        dict['sqqOnLineStateV2'] = jce.ReadByte()
        dict['sShowName'] = jce.ReadString()
        jce.ReadByte()
        dict['nickname'] = jce.ReadString()
        jce.getHex(2)  #0B

        list.append(dict)
    return list
Exemplo n.º 4
0
def Un_SummaryCardReqSummaryCard_1(data):
    jce = JceInputStream(data)
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    data1 = jce.ReadValue()
    jce_1 = JceInputStream(data1)
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    data2 = jce_1.ReadValue()
    jce_2 = JceInputStream(data2)
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.ReadValue()
    nickname = jce_2.ReadValue()
    return nickname
Exemplo n.º 5
0
def Un_ProfileServiceReqBatchProcess(data):
    pblist = []
    data = data[8:]
    jce = JceInputStream(data)
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    data = jce.ReadValue()

    jce_1 = JceInputStream(data)
    jce_1.getHex(6)
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    jce_1.ReadValue()
    data1 = jce_1.ReadValue()
    jce_2 = JceInputStream(data1)
    jce_2.ReadValue()
    count = jce_2.ReadValue()
    for item in range(count):
        jce_2.ReadValue()  #0a
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        pblist.append(jce_2.ReadValue())
        jce_2.ReadValue()  #0b
    return pblist
Exemplo n.º 6
0
def Un_friendlistSetGroupReq(data):
    data = data[8:]
    jce = JceInputStream(data)
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    req = jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce_1 = JceInputStream(jce.ReadSimpleList())
    jce_1.getHex(6)
    if jce_1.ReadValue() == 'req':
        jce_1.getHex(6)
        jce_1.ReadValue()
        jce_2 = JceInputStream(jce_1.ReadSimpleList())
        jce_2.ReadValue()  #0A
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.getHex(6)
        jce_2.ReadValue()  #0A
        jce_2.ReadValue()
        jce_2.ReadValue()
        id = jce_2.ReadValue()
        id2 = jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadSimpleList()
        jce_2.ReadValue()
        pbdata = jce_2.ReadSimpleList()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        jce_2.ReadValue()
        code = jce_2.ReadValue()
        return {'id': id2, 'pbdata': pbdata, 'code': code}
    else:
        return False
Exemplo n.º 7
0
def Un_EncounterSvcReqGetEncounter(data):
    list = []
    data = data[8:]
    #print data
    jce = JceInputStream(data)
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    d1 = jce.ReadValue()
    d1 = d1[6:]
    jce_1 = JceInputStream(d1)
    jce_1.ReadValue()
    jce_1.getHex(6)
    jce_1.ReadValue()
    d3 = jce_1.ReadValue()
    jce_2 = JceInputStream(d3)
    jce_2.ReadValue()  #0a
    jce_2.ReadValue()
    jce_2.getHex(2)  #1A
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.ReadValue()
    jce_2.getHex(2)  #0B
    COUNT = jce_2.ReadValue()
    JCEDATA = JceInputStream(jce_2.data)
    for item in range(COUNT):
        dict = {}
        JCEDATA.ReadValue()  #0A
        dict['qq_number'] = JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        dict['timestamp'] = JCEDATA.ReadValue()
        dict['time'] = JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        dict['nickname'] = JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        dict['lat'] = JCEDATA.ReadValue()
        dict['lon'] = JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()  #0A
        JCEDATA.getHex(2)
        COUNT1 = int(JCEDATA.getHex(4), 16)
        for item1 in range(COUNT1):
            JCEDATA.ReadValue()
            JCEDATA.ReadValue()  #0A
            JCEDATA.ReadValue()
            JCEDATA.ReadValue()
            JCEDATA.ReadValue()
            JCEDATA.ReadValue()
            JCEDATA.ReadValue()  #0B
        JCEDATA.ReadValue()  #0B
        JCEDATA.ReadValue()  #0A
        tt = JCEDATA.ReadValue()  ##text

        JCEDATA.ReadValue()
        JCEDATA.ReadValue()  #0B
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()

        JCEDATA.ReadValue()  ##list
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        JCEDATA.ReadValue()
        list.append(dict)
    print json.dumps(list)
    return list
Exemplo n.º 8
0
def Un_friendlistgetFriendGroupList(data):

    list = []
    data = data[8:]
    jce = JceInputStream(data)
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.getHex(4)
    LONG = jce.ReadValue()
    jce.data = jce.data[:LONG * 2]
    jce.getHex(6)
    jce.ReadValue()
    jce.getHex(4)
    LONG1 = jce.ReadValue()
    jce.data = jce.data[:LONG1 * 2]
    jce.data = re.findall('^0a(.*?)0b$', jce.data)[0]
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    jce.ReadValue()
    CONT = jce.ReadList()
    for item in range(CONT):
        dict = {}
        jce.ReadValue()  #0A
        dict['friendUin'] = jce.ReadValue()
        dict['groupId'] = jce.ReadValue()
        dict['faceId'] = jce.ReadValue()
        dict['name'] = jce.ReadValue()
        dict['sqqtype'] = jce.ReadValue()
        dict['status'] = jce.ReadValue()
        dict['memberLevel'] = jce.ReadValue()
        dict['isMqqOnLine'] = jce.ReadValue()
        dict['sqqOnLineState'] = jce.ReadValue()
        dict['isIphoneOnline'] = jce.ReadValue()
        dict['detalStatusFlag'] = jce.ReadValue()
        dict['sqqOnLineStateV2'] = jce.ReadValue()
        dict['sShowName'] = jce.ReadValue()
        jce.ReadValue()
        dict['nickname'] = jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        CONT1 = int(jce.getHex(4), 16)
        for item1 in range(CONT1):
            jce.ReadValue()
            jce.ReadValue()
            jce.ReadValue()
            jce.ReadValue()
            jce.ReadValue()
            jce.ReadValue()
            jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadSimpleList()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        list.append(dict)
    return list
Exemplo n.º 9
0
def Un_friendlistgetTroopMemberList(data):
    GroupMemberInfo = []
    data = data[8:]
    jce = JceInputStream(data)
    jce.ReadByte()
    jce.ReadByte()
    jce.ReadByte()
    jce.ReadNumber()
    jce.ReadString()
    jce.ReadString()
    jce.getHex(4)
    LONG = jce.ReadValue()
    jce.data = jce.getHex(LONG * 2)
    jce.getHex(6)
    jce.ReadString()
    jce.getHex(4)
    LONG1 = jce.ReadValue()
    jce.data = jce.getHex(LONG1 * 2)
    jce.data = re.findall('^0a(.*?)0b$', jce.data)[0]
    jce.ReadNumber()
    jce.ReadNumber()
    jce.ReadNumber()
    jce.getHex(2)
    CONT = int(jce.getHex(4), 16)
    for item in range(CONT):
        jce.getHex(2)  #0A
        GroupMemberNumber = jce.ReadNumber()
        jce.ReadByte()
        GroupMemberAge = jce.ReadByte()
        Gender = jce.ReadByte()
        if Gender == 1:
            GroupMemberGender = 'Female'
        elif Gender == 0:
            GroupMemberGender = 'Male'
        else:
            GroupMemberGender = 'Unknown'
        GroupMemberNickName = jce.ReadString()
        jce.ReadByte()
        jce.ReadString()
        GroupMemberRemarkName = jce.ReadString()
        jce.ReadByte()
        jce.ReadString()
        jce.ReadString()
        jce.ReadString()
        jce.ReadString()
        jce.ReadByte()
        jce.ReadNumber()
        jce.ReadNumber()
        jce.ReadByte()
        jce.ReadByte()
        jce.ReadByte()
        jce.ReadByte()
        jce.ReadByte()
        jce.ReadByte()
        jce.ReadString()
        jce.ReadByte()
        jce.ReadString()
        jce.ReadByte()
        jce.ReadByte()
        jce.getHex(2)  #0b
        GroupMemberInfo.append({
            'GroupMemberNumber': GroupMemberNumber,
            'GroupMemberAge': GroupMemberAge,
            'GroupMemberGender': GroupMemberGender,
            'GroupMemberNickName': GroupMemberNickName,
            'GroupMemberRemarkName': GroupMemberRemarkName
        })
    return GroupMemberInfo
Exemplo n.º 10
0
def Un_FriendListGetTroopListReqV2(data):
    GroupInfoList = []
    data = data[8:]
    print data
    jce = JceInputStream(data)
    jce.ReadByte()
    jce.ReadByte()
    jce.ReadByte()
    jce.ReadShort()
    jce.ReadString()
    jce.ReadString()
    jce.getHex(4)
    long = jce.ReadValue()
    jce.data = jce.data[:long * 2]
    jce.getHex(6)
    jce.ReadString()

    jce.getHex(4)
    long2 = jce.ReadValue()

    jce.data = jce.data[:long2 * 2]
    print jce.data

    jce.data = re.findall('^0a(.*?)0b$', jce.data)[0]
    jce.ReadNumber()
    jce.ReadByte()
    jce.ReadByte()
    jce.ReadByte()
    jce.ReadValue()
    jce.getHex(2)

    cont = jce.ReadValue()
    print cont
    print jce.data
    for item in range(cont):
        jce.ReadValue()  #0a
        GroupCode = jce.ReadValue()  #code
        GroupNumber = jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        GroupName = jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()
        jce.ReadValue()  #0b
        GroupInfoList.append({
            'GroupCode': GroupCode,
            'GroupName': GroupName,
            'GroupNumber': GroupNumber
        })

    return GroupInfoList