747929791 / majsoul_wrapper

自动化雀魂AI的SDK,实时解析雀魂对局信息,并模拟鼠标动作出牌
MIT License
379 stars 60 forks source link

ActionPrototype下层的协议解不出来,难道包了别的加密方式? #27

Closed dapiao-zhangwan closed 2 months ago

dapiao-zhangwan commented 2 months ago

will parse buf:010a132e6c712e416374696f6e50726f746f74797065122508021211416374696f6e4469736361726454696c651a0e957c636850ae4e9c75ca999edf93 msg block:[{'id': 1, 'type': 'string', 'data': b'.lq.ActionPrototype', 'begin': 0}, {'id': 2, 'type': 'string', 'data': b'\x08\x02\x12\x11ActionDiscardTile\x1a\x0e\x95|chP\xaeN\x9cu\xca\x99\x9e\xdf\x93', 'begin': 21}] method name:.lq.ActionPrototype, message name:ActionPrototype dict obj:{'step': 2, 'name': 'ActionDiscardTile', 'data': 'lXxjaFCuTpx1ypme35M='} B:b'\x95|chP\xaeN\x9cu\xca\x99\x9e\xdf\x93', name:ActionDiscardTile Failed to parse message: Wrong wire type in tag. Message content: 010a132e6c712e416374696f6e50726f746f74797065122508021211416374696f6e4469736361726454696c651a0e957c636850ae4e9c75ca999edf93 None

类似这样,解到ActionDiscardTile这一层,base64解码后解不出protobuf

dapiao-zhangwan commented 2 months ago

另一个项目找到了 def decode(data: bytes): keys = [0x84, 0x5e, 0x4e, 0x42, 0x39, 0xa2, 0x1f, 0x60, 0x1c] data = bytearray(data) k = len(keys) d = len(data) for i, j in enumerate(data): u = (23 ^ d) + 5 * i + keys[i % k] & 255 data[i] ^= u return bytes(data) 这样再解一下就行