decrypt_launcher.py 1023 B

1234567891011121314151617181920212223242526272829303132
  1. """Decrypt the mod_launcher Lua files (44 files) and search for Encode6BitBuf."""
  2. import sys
  3. from pathlib import Path
  4. sys.path.insert(0, str(Path(__file__).parent))
  5. from decrypt_client_lua import decrypt_file
  6. LAUNCHER = Path(
  7. r"D:\ProgramFiles\996box\GameBoxDownload\1\cq\cache_206923\mod_launcher"
  8. )
  9. OUT = Path("lua-dec2/launcher")
  10. files = list(LAUNCHER.rglob("*.lua"))
  11. print(f"decrypting {len(files)} launcher lua files...")
  12. ok = 0
  13. for f in files:
  14. rel = f.relative_to(LAUNCHER)
  15. if decrypt_file(f, OUT / rel):
  16. ok += 1
  17. print(f"decrypted {ok}/{len(files)} -> {OUT}")
  18. print()
  19. print("=== grep Encode6BitBuf / Encode6 / 6Bit in launcher ===")
  20. for f in OUT.rglob("*.lua"):
  21. txt = f.read_text(encoding="utf-8", errors="replace")
  22. for needle in ("Encode6BitBuf", "Encode6", "6BitBuf"):
  23. idx = txt.find(needle)
  24. if idx >= 0:
  25. print(f"--- {f.relative_to(OUT)} @ {idx} ({needle}) ---")
  26. print(txt[max(0, idx - 100) : idx + 600])
  27. print()
  28. break