From 0beba796faf1eead17c117512a5e5135bfb4236e Mon Sep 17 00:00:00 2001 From: klensy Date: Wed, 5 Aug 2020 18:07:09 +0300 Subject: [PATCH] wrpl_unpacker: should fix parsing replays --- src/wt_tools/formats/wrpl_parser.py | 32 +++++++++++++++++++---------- 1 file changed, 21 insertions(+), 11 deletions(-) diff --git a/src/wt_tools/formats/wrpl_parser.py b/src/wt_tools/formats/wrpl_parser.py index 885b6bf..01abe52 100644 --- a/src/wt_tools/formats/wrpl_parser.py +++ b/src/wt_tools/formats/wrpl_parser.py @@ -1,6 +1,7 @@ import struct -from construct import Enum, Int16ul, Const, Struct, Int32ub, Int32ul, Bytes, this, Int24ul, Seek +from construct import Enum, Int16ul, Const, Struct, Int32ub, Int32ul, Bytes, this, Int24ul, Seek, Switch, If,\ + IfThenElse, Pass, Probe from .common import zlib_stream @@ -9,14 +10,15 @@ def simple_blk_build(obj): return b"".join([obj.magic, struct.pack('>I', obj.unknown_0), struct.pack('= wrpl_versions_list['version_1_63-99'], + Seek(0x444), + IfThenElse( + this.version >= wrpl_versions_list['version_1_63'], + Seek(0x440), + Seek(0x450) + ) + ), "m_set" / simple_blk, "wrplu" / zlib_stream, "rez" / simple_blk,