Crusader_Decomp/tmp_extract_asset_strings.py

13 lines
425 B
Python
Raw Permalink Normal View History

2026-03-30 00:19:01 +02:00
import re
from pathlib import Path
path = Path(r"E:\\emu\\psx\\Crusader - No Remorse\\SLUS_002.68")
data = path.read_bytes()
pattern = re.compile(rb"[ -~]{4,}")
needle = re.compile(r"WDL|LSET|MENU|SPEC|MAP|SPR|TILE", re.I)
seen = set()
for m in pattern.finditer(data):
s = m.group().decode("ascii", errors="ignore")
if needle.search(s) and s not in seen:
seen.add(s)
print(f"0x{m.start():08X}\t{s}")