diff --git a/ai5win_arc.py b/ai5win_arc.py index b63ad5b..b8161c1 100644 --- a/ai5win_arc.py +++ b/ai5win_arc.py @@ -203,6 +203,19 @@ def hack_size_and_crypto_keys(input_file) -> tuple: good_size = next_offset - start_offset second_key = bad_size ^ good_size + try: + for entry in range(entry_count): + starter = 4 + entry*(8 + bytes_for_name) + input_file.seek(starter, 0) + new_bytes = input_file.read(bytes_for_name) + tester = b'' + for i in new_bytes: + tester += struct.pack('B', i ^ first_key) + tester = tester.rstrip(b'\x00') + tester.decode(SilkyArc.name_encoding) + except UnicodeDecodeError: + continue + if good_size <= 0: continue diff --git a/setup.py b/setup.py index e3e3dc1..c499eea 100644 --- a/setup.py +++ b/setup.py @@ -14,8 +14,8 @@ )] cx_Freeze.setup( - name="SilkyArcTool", - version="1.0", + name="AI5WINArcTool", + version="2.1", description="Dual languaged (rus+eng) tool for packing and unpacking archives of Silky Engine.\n" "Двуязычное средство (рус+англ) для распаковки и запаковки архивов Silky Engine.", options={"build_exe": {"packages": []}},