YY.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:YY 作者: gamegrd 项目源码 文件源码
def on_connected(self):
        self.state = YY_CLIENT_HANDSHAKING

        proto = YYProto_pb2.YYProto()
        (pub_key, pri_key) = rsa.newkeys(512, 3)

        self.rsa_pub_key = pub_key
        self.rsa_pri_key = pri_key

        proto.cmd = 0x1
        proto.key_req.f1 = chr(0x01) + chr(0x00) + chr(0x01)
        rsa_key = rsa.transform.int2bytes(pub_key.n)
        reversed(rsa_key)
        proto.key_req.rsa_key = chr(0x00) + rsa_key

        buffer = proto.SerializeToString()
        #hexdump.hexdump(buffer)
        self.stream.write(struct.pack('I', len(buffer)) + buffer)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号