Beispiel #1
0
def Pack_GroupRemovesMember(self, targetQQ, GroupNumber):
    msg = ''
    msg += '08a0111000180022'
    data = '080510' + PB.encode_Varints(int(GroupNumber)) + '1800'
    d1 = '08' + PB.encode_Varints(int(targetQQ)) + '12' + PB.encode_Varints(
        len(data) / 2) + data
    msg += PB.encode_Varints(len(d1) / 2) + d1
    print msg
    retdata = Coder.num2hexstr(len(msg) / 2 + 4, 4) + msg
    value = Make_sendSsoMsg(self, 'OidbSvc.0x8a0_0', retdata)
    return Pack(self, value, 2)
Beispiel #2
0
def Pack_ProfileServicePbReqSystemMsgActionGroup(targetQQ, GroupNumber):
    hex16time = str(int(time.time())) + '000000'
    msg = ''
    msg += '080210'
    msg += PB.encode_Varints(int(hex16time))
    msg += '18'
    msg += PB.encode_Varints(int(targetQQ))
    msg += '200128013005380142'
    data = '080b10' + PB.encode_Varints(int(GroupNumber))
    msg += PB.encode_Varints(int(len(data) / 2)) + data
    return msg
Beispiel #3
0
def Pack_LongConnOffPicUp(self, qqnumber, targetQQ, imgname):
    imgnamehex = (imgname + '.jpg').encode('hex')
    msg = '080112'
    msg1 = '08' + PB.encode_Varints(int(qqnumber))
    msg1 += '10' + PB.encode_Varints(int(targetQQ))
    msg1 += '18002210' + imgname + '28b6ea0132'
    msg1 += Coder.num2hexstr(len(imgnamehex) / 2) + imgnamehex
    msg1 += '3805400950006001680070d00578c0078001eb078a0109352e382e302e323634'
    msg += Coder.num2hexstr(len(msg1) / 2) + msg1 + '5003'
    data = Coder.num2hexstr(len(msg) / 2 + 4, 4) + msg
    value = Make_sendSsoMsg(self, 'LongConn.OffPicUp', data)
    return Pack(self, value, 2)
Beispiel #4
0
def Pack_ProfileServicePbReqSystemMsgActionFriend(self, targetQQ):
    hex16time = str(int(time.time())) + '000000'
    msg = ''
    msg += '080110'
    msg += PB.encode_Varints(int(hex16time))
    msg += '18'
    msg += PB.encode_Varints(int(targetQQ))
    msg += '2001280130003800420f0802980300a20300b2030408001000'
    data = Coder.num2hexstr(len(msg) / 2 + 4, 4) + msg
    value = Make_sendSsoMsg(self,
                            'ProfileService.Pb.ReqSystemMsgAction.Friend',
                            data)
    return Pack(self, value, 2)
Beispiel #5
0
def Pack_AutoReceiveGroupRequests(self, targetQQ, GroupNumber):
    """
    同意申请加入群(压缩)暂未完成
    """
    number = random.uniform(10000, 99999)
    msg = ''
    msg += '08' + PB.encode_Varints(int(number))
    msg += '121c50726f66696c65536572766963652e47657453696d706c65496e666f187222'
    GetSimpleInfo = Pack_GetSimpleInfo(targetQQ)
    msg += Coder.num2hexstr(len(GetSimpleInfo) / 2) + GetSimpleInfo + '2801'
    d1 = '0a' + PB.encode_Varints(int(len(msg) / 2)) + msg
    msg1 = ''
    msg1 += '08' + PB.encode_Varints(int(number + 1))
    msg1 += '122a50726f66696c65536572766963652e50622e52657153797374656d4d7367416374696f6e2e47726f7570'
    ActionGroup = Pack_ProfileServicePbReqSystemMsgActionGroup(
        targetQQ, GroupNumber)
    msg1 += '182722' + PB.encode_Varints(int(
        len(ActionGroup) / 2)) + ActionGroup + '2801'
    d2 = '0a' + PB.encode_Varints(int(len(msg1) / 2)) + msg1
    msg2 = ''
    msg2 += '08' + PB.encode_Varints(int(number + 2))
    msg2 += '122850726f66696c65536572766963652e50622e52657153797374656d4d7367526561642e47726f7570180f220b10'
    hex16time = str(int(time.time())) + '123123'
    msg2 += PB.encode_Varints(int(hex16time)) + '20032801'
    d3 = '0a' + PB.encode_Varints(int(len(msg2) / 2)) + msg2
    data = d1 + d2 + d3
    print data
    gzip = zlib.compress(data.decode('hex'))
    gzipdata = gzip.encode('hex')
    retdata = Coder.num2hexstr(len(gzipdata) / 2 + 4, 4) + gzipdata
    value = Make_sendSsoMsg(self, 'SSO.LoginMerge', retdata)
    return Pack(self, value, 2)
Beispiel #6
0
def Pack_ProfileServiceReqBatchProcess(self, groupnumber):
    PB1 = '088d1110012240089484af5f123908' + PB.encode_Varints(
        int(groupnumber)
    ) + '122f08001000180020002800300040007a008a0100920100a00200a80200b00200c20200ca02023000d202023200b803001800'
    PB2 = '0899111001221208' + PB.encode_Varints(
        int(groupnumber)) + '100018022a02080030063800'
    msg = '10032c3c42047dfcfc560e50726f66696c6553657276696365660f526571426174636850726f636573737d0001'
    msg1 = '080001060f526571426174636850726f636573731d0000'
    msg2 = '0a090002'
    msg2_1 = '0a00011c2d0000' + Pack_Len(PB1) + '0b'
    msg2_2 = '0a00011c2d0000' + Pack_Len(PB2) + '0b'
    msg2 += msg2_1 + msg2_2 + '0b'
    msg1 += Pack_Len(msg2)
    msg += Pack_Len(msg1, 2) + '8c980ca80c'
    data = Coder.num2hexstr(len(msg) / 2 + 4, 4) + msg
    value = Make_sendSsoMsg(self, 'ProfileService.ReqBatchProcess', data)
    return Pack(self, value, 2)
Beispiel #7
0
def SendfriendImageMsg(
    self,
    targetQQ,
    imgnamehex,
):
    # 1085db041a252f35336236353830352d633831392d343333332d623035392d62343333663835313135346428eb073a10ca391533c21daa0db3fbaa6e5e3bddc240c00748d00552252f35336236353830352d633831392d343333332d623035392d6234333366383531313534646800800103c0019466c801e7ad02208d830128bbb0a79505322408c4c08bc20510c4c08bc205288ad4979c0248a5af96c60558c6c38f8e0b68c4c08bc2054000
    QQpbdata = PB.encode_Varints(int(targetQQ))
    msg = '0a080a0608' + QQpbdata
    msg += '120808011000188d8301'
    msg1 = '0a24' + imgnamehex
Beispiel #8
0
    # F'
    F1 = 2 * Fs  #16000

    # coeficientes
    aB = wcB / (F1 + wcB)
    bB = (wcB - F1) / (F1 + wcB)
    aA = wcA / (F1 + wcA)
    bA = (wcA - F1) / (F1 + wcA)

    read_path = "Sweep10_3600.pcm"
    with open(read_path, 'rb') as f:
        buf = f.read()
        data_i = np.frombuffer(buf, dtype='int16')
        data_len = len(data_i)

    data_o = PB(data_i, data_len, saida, media_buf, aB, bB) + PA(
        data_i, data_len, saida, media_buf, aA, bA)

    print("Valor de aA: " + str(aA))
    print("Valor de bA: " + str(bA))
    print("Valor de aB: " + str(aB))
    print("Valor de bB: " + str(bB))

    plt.figure("Gráficos", figsize=(25, 12))

    plt.subplot(211)
    plt.title("Entrada")
    plt.xlabel("Frequência")
    plt.ylabel("Amplitude")
    plt.grid(1)
    plt.plot(data_i)
Beispiel #9
0
    # F'
    F1 = 2 * Fs  #16000

    # coeficientes
    aB = wcB / (F1 + wcB)
    bB = (wcB - F1) / (F1 + wcB)
    aA = wcA / (F1 + wcA)
    bA = (wcA - F1) / (F1 + wcA)

    read_path = "Sweep10_3600.pcm"
    with open(read_path, 'rb') as f:
        buf = f.read()
        data_i = np.frombuffer(buf, dtype='int16')
        data_len = len(data_i)

    data_o = np.convolve(PB(data_i, data_len, saida, media_buf, aB, bB),
                         PA(data_i, data_len, saida, media_buf, aA, bA))
    #data_o = PB(data_i, data_len, saida, media_buf, aB, bB) * PA(data_i, data_len, saida, media_buf, aA, bA)

    print("Valor de aA: " + str(aA))
    print("Valor de bA: " + str(bA))
    print("Valor de aB: " + str(aB))
    print("Valor de bB: " + str(bB))

    plt.figure("Gráficos", figsize=(25, 12))

    plt.subplot(211)
    plt.title("Entrada")
    plt.xlabel("Frequência")
    plt.ylabel("Amplitude")
    plt.grid(1)
Beispiel #10
0
def PA(data_i, data_len, saida, media_buf, a, b):
    data_pb = PB(data_i, data_len, saida, media_buf, a, b)
    data_o = data_i - data_pb
    return data_o
Beispiel #11
0
def SendImageMsg(self, GroupQQ, targetQQ, ImgName, ImaFileName, ImgPath):
    ImgNameHex = ImgName
    ImaFileNameHex = ImaFileName.encode('hex')
    ImgPathHex = ImgPath.encode('hex')
    PBtarget = PB.encode_Varints(int(targetQQ))
    if GroupQQ:
        PBGroup = PB.encode_Varints(int(GroupQQ))
        PB_0A_1 = '08' + PBGroup + '10' + PBtarget
    else:
        PB_0A_1 = '08' + PBtarget
    PB_0A_2 = '1a' + PB.encode_Varints(len(PB_0A_1) / 2) + PB_0A_1
    PB_0A_3 = PB.encode_Varints(len(PB_0A_2) / 2) + PB_0A_2
    PB_0A = '0a' + PB_0A_3
    PB_12_D = int(random.uniform(1000000000, 9999999999))
    PB_12 = '120a0801100018' + PB.encode_Varints(PB_12_D)
    PB_Send_MSG_0A = '0a' + PB.encode_Varints(
        len(ImaFileNameHex) / 2) + ImaFileNameHex
    PB_Send_MSG_10 = '10b9d203'
    PB_Send_MSG_1a = '1a' + PB.encode_Varints(len(ImgPathHex) / 2) + ImgPathHex
    PB_Send_MSG_28 = '28eb07'
    PB_Send_MSG_3a = '3a' + PB.encode_Varints(len(ImgNameHex) / 2) + ImgNameHex
    PB_Send_MSG_40 = '40c007'
    PB_Send_MSG_48 = '48d005'
    PB_Send_MSG_52 = '52' + PB.encode_Varints(len(ImgPathHex) / 2) + ImgPathHex
    PB_Send_MSG_68 = '6800'
    PB_Send_MSG_8001 = '800103'
    PB_Send_MSG_C001 = 'c001a18e01'
    PB_Send_MSG_C801 = 'c801868902'
    PB_Send_MSG = PB_Send_MSG_0A + PB_Send_MSG_10 + PB_Send_MSG_1a + PB_Send_MSG_28 + PB_Send_MSG_3a + PB_Send_MSG_40 + PB_Send_MSG_48 + PB_Send_MSG_52 + PB_Send_MSG_68 + PB_Send_MSG_8001 + PB_Send_MSG_C001 + PB_Send_MSG_C801
    PB_1A_1 = '22' + PB.encode_Varints(len(PB_Send_MSG) / 2) + PB_Send_MSG
    PB_1A_2 = '12' + PB.encode_Varints(len(PB_1A_1) / 2) + PB_1A_1
    PB_1A_3 = '0a' + PB.encode_Varints(len(PB_1A_2) / 2) + PB_1A_2
    PB_1A = '1a' + PB.encode_Varints(len(PB_1A_3) / 2) + PB_1A_3
    PB_20_D = int(random.uniform(10000, 99999))
    PB_20 = '20' + PB.encode_Varints(PB_20_D)
    PB_28_D = int(random.uniform(1000000000, 9999999999))
    PB_28 = '28' + PB.encode_Varints(PB_28_D)
    PB_32_MSG = PB.msg()
    PB_32 = '32' + PB.encode_Varints(len(PB_32_MSG) / 2) + PB_32_MSG
    PB_40 = '4000'
    PB_DATA = PB_0A + PB_12 + PB_1A + PB_20 + PB_28 + PB_32 + PB_40
    data = Coder.num2hexstr(len(PB_DATA) / 2 + 4, 4) + PB_DATA
    value = Make_sendSsoMsg(self, 'MessageSvc.PbSendMsg', data)
    return Pack(self, value, 2)