mirror of
https://gitea.tendokyu.moe/beerpsi/x.git
synced 2026-09-30 18:58:09 +03:00
lock unitypy version and fix IV and salt length
This commit is contained in:
@@ -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()}")
|
||||
|
||||
Reference in New Issue
Block a user