diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-09-19 22:46:58 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-09-19 22:52:14 +0300 |
commit | cc03a3c52b714eb9519c17e8d3d5ae68aa1dffc5 (patch) | |
tree | 987d081ca609d8b432a38f0b1491661cd0ef228c /servergreps/hercules | |
parent | 1ec0f534c8f38c605f638282b4432e558106d699 (diff) | |
download | evol-tools-cc03a3c52b714eb9519c17e8d3d5ae68aa1dffc5.tar.gz evol-tools-cc03a3c52b714eb9519c17e8d3d5ae68aa1dffc5.tar.bz2 evol-tools-cc03a3c52b714eb9519c17e8d3d5ae68aa1dffc5.tar.xz evol-tools-cc03a3c52b714eb9519c17e8d3d5ae68aa1dffc5.zip |
servergreps: add parsing for additional out packets in servers.
Diffstat (limited to 'servergreps/hercules')
-rwxr-xr-x | servergreps/hercules/src/utils.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/servergreps/hercules/src/utils.py b/servergreps/hercules/src/utils.py index de42a36..d05aa0a 100755 --- a/servergreps/hercules/src/utils.py +++ b/servergreps/hercules/src/utils.py @@ -17,12 +17,15 @@ class Utils: ourPacketre3 = re.compile( "(WFIFOW|WBUFW)([ ]*)[(]([ ]*)([\w>_-]+),([ ]*)" + "(?P<offset>0)([ ]*)[)]([ ]*)=([ ]*)(?P<packet>[0-9\w]+)([ ]*)[;]") - ourPacketre4 = re.compile(" cmd([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") + ourPacketre4 = re.compile(" cmd([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+)(;|,)") ourPacketre5 = re.compile( "(WFIFOW|WBUFW)([ ]*)[(]([ ]*)([\w>_-]+),([ ]*)" + "(count[*]p_len)([ ]*)[)]([ ]*)=([ ]*)(?P<packet>[0-9\w]+)([ ]*)[;]") ourPacketre6 = re.compile("int cmde([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") - ourPacketre7 = re.compile(" (packet|packet_num|PacketType|packet_type)([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") + ourPacketre7 = re.compile(" (packet|packet_num|PacketType|packet_type|header)([ ]*)=([ ]*)0x(?P<packet>[0-9a-fA-F]+);") + ourPacketre8 = re.compile( + "(WFIFOW|WBUFW)([ ]*)[(]([ ]*)([\w>_-]+),([ ]*)" + + "(?P<offset>0)([ ]*)[)]([ ]*)=([ ]*)([a-zA-Z]+)[?]0x(?P<packet1>[0-9a-fA-F]+)([ ]*)[:]([ ]*)0x(?P<packet2>[0-9a-fA-F]+)([ ]*)[;]") @staticmethod def enumCasePackets(fileName, startCode): @@ -114,3 +117,14 @@ class Utils: while len(data) < 4: data = "0" + data server.addServerPacket(data) + m = Utils.ourPacketre8.findall(line) + if len(m) > 0: + for str in m: + data = str[10] + while len(data) < 4: + data = "0" + data + server.addServerPacket(data) + data = str[13] + while len(data) < 4: + data = "0" + data + server.addServerPacket(data) |