lock unitypy version and fix IV and salt length

This commit is contained in:
beerpsi
2026-04-19 23:43:43 +07:00
parent baa6f19890
commit 8a8f534f07
+18 -3
View File
@@ -1,3 +1,9 @@
# /// script
# requires-python = ">=3.10"
# dependencies = [
# "unitypy==1.21.2",
# ]
# ///
import argparse
from hashlib import blake2b
from pathlib import Path
@@ -36,7 +42,16 @@ with (cast(Path, args.mu3_data_path) / "resources.assets").open("rb") as f:
data = cast(TextAsset, object.read())
if data.name in FILE_MAP:
key = blake2b(data.m_Script, digest_size=32, key=args.key_iv_digest_fixed).hexdigest()
if data.m_Name in FILE_MAP:
key = blake2b(
data.m_Script.encode("utf-8", "surrogateescape"),
digest_size=32,
key=args.key_iv_digest_fixed
).digest()
print(f"{FILE_MAP[data.name]}: {key}")
if data.m_Name == "noise1":
key = key[:16]
elif data.m_Name == "noise2":
key = key[:8]
print(f"{FILE_MAP[data.name]}: {key.hex()}")