diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-09 02:00:43 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-09 02:00:43 +0300 |
commit | 73c5db63ab53190e82adca823c6e400e0d1fa8ca (patch) | |
tree | fa25850b24989503cf9b4fab1e5e54b447c22237 /servergreps/hercules/src/threeceam.py | |
parent | fe161e907c03f6c148c45658367a57eb2349534c (diff) | |
download | evol-tools-73c5db63ab53190e82adca823c6e400e0d1fa8ca.tar.gz evol-tools-73c5db63ab53190e82adca823c6e400e0d1fa8ca.tar.bz2 evol-tools-73c5db63ab53190e82adca823c6e400e0d1fa8ca.tar.xz evol-tools-73c5db63ab53190e82adca823c6e400e0d1fa8ca.zip |
servergreps: add parsing more packets.
Diffstat (limited to 'servergreps/hercules/src/threeceam.py')
-rwxr-xr-x | servergreps/hercules/src/threeceam.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/servergreps/hercules/src/threeceam.py b/servergreps/hercules/src/threeceam.py index 7d4c73d..3639f47 100755 --- a/servergreps/hercules/src/threeceam.py +++ b/servergreps/hercules/src/threeceam.py @@ -33,6 +33,9 @@ class Threeceam: ourPacketre4 = re.compile("int cmd([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") ourPacketre5 = re.compile("int cmde([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") ourPacketre6 = re.compile(" (packet|packet_num|PacketType|packet_type)([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") + ourPacketre7 = re.compile( + "(WFIFOW|WBUFW)([ ]*)[(]([ ]*)([\w>_-]+),([ ]*)" + + "(count[*]p_len)([ ]*)[)]([ ]*)=([ ]*)(?P<packet>[0-9\w]+)([ ]*)[;]") outPacketLoginre = re.compile( "([ ]*)PACKET_ID_(?P<name>[A-Z0-9_]+)([ ]*)=" + "([ ]*)0x(?P<packet>[0-9a-fA-F]+),") @@ -66,6 +69,10 @@ class Threeceam: return self.packetsSet.add(val) else: + if len(data) > 2 and data[:2] == "0x": + data = data[2:] + while len(data) < 4: + data = "0" + data try: if int(data, 16) > 4096: return @@ -107,6 +114,13 @@ class Threeceam: while len(data) < 4: data = "0" + data self.addServerPacket(data) + m = self.ourPacketre7.findall(line) + if len(m) > 0: + for str in m: + data = str[9] + while len(data) < 4: + data = "0" + data + self.addServerPacket(data) m = self.outPacketLoginre.findall(line) if len(m) > 0: for str in m: |