louisabraham / LaBot

Bot Dofus 2 en Python 3
MIT License
79 stars 37 forks source link

Read/verif fail avec les messages 6728 #13

Closed gmbno closed 5 years ago

gmbno commented 5 years ago

Bonjour,

le mitm fail chez moi sur le message 6728 après la selection du personnage, j'ai essayé de fixer par moi meme mais j'avoue ne pas vouloir trop toucher au binrw.py... Je suis sous Mac OS.

01:12:58.91 DEBUG: Thread-4 - msg.__init__(): Initialized Msg with id 6728

msg.data
Data(bytearray.fromhex('0000000000000000000000000100000000000005'))
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 63268)
Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/socketserver.py", line 720, in __init__
    self.handle()
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/server.py", line 426, in handle
    self.handle_one_request()
  File "/usr/local/Cellar/python/3.7.2_1/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/server.py", line 414, in handle_one_request
    method()
  File "/Users/gmblucas/Desktop/LaBot/labot/mitm/proxy.py", line 29, in do_CONNECT
    Bridge(self.connection, coServ, MsgBridgeHandler).run()
  File "/Users/gmblucas/Desktop/LaBot/labot/mitm/bridge.py", line 140, in run
    self.bridge_handler.handle(data, origin=r)
  File "/Users/gmblucas/Desktop/LaBot/labot/mitm/bridge.py", line 78, in handle
    parsedMsg = protocol.read(msgType, msg.data)
  File "/Users/gmblucas/Desktop/LaBot/labot/protocol.py", line 58, in read
    ans[var['name']] = read(var['type'], data)
  File "/Users/gmblucas/Desktop/LaBot/labot/protocol.py", line 58, in read
    ans[var['name']] = read(var['type'], data)
  File "/Users/gmblucas/Desktop/LaBot/labot/protocol.py", line 58, in read
    ans[var['name']] = read(var['type'], data)
  File "/Users/gmblucas/Desktop/LaBot/labot/protocol.py", line 46, in read
    return primitives[type][0](data)
  File "/Users/gmblucas/Desktop/LaBot/labot/data/binrw.py", line 100, in readInt
    return int.from_bytes(self.read(4), 'big', signed=True)
  File "/Users/gmblucas/Desktop/LaBot/labot/data/binrw.py", line 55, in read
    self.verif(l)
  File "/Users/gmblucas/Desktop/LaBot/labot/data/binrw.py", line 52, in verif
    raise IndexError(self.pos, l, len(self))
IndexError: (20, 4, 20)

Une idée ?

Merci !

louisabraham commented 5 years ago

See https://cadernis.fr/index.php?threads/probl%C3%A8me-de-lecture-du-gameroleplayarenaupdateplayerinfosallqueuesmessage.2298/ for the solution