pokestadium/tools/euc_jp.py
Maide 157454bf38
Some checks are pending
C/C++ CI / build (push) Waiting to run
fragment28 (#168)
2025-03-05 09:31:47 +00:00

16 lines
419 B
Python
Executable File

#!/usr/bin/env python3
import codecs
import sys
from pathlib import Path
import find_sym
if len(sys.argv) == 2:
print(codecs.decode(sys.argv[1].replace("0x", ""), "hex").decode("euc-jp"))
else:
offset = find_sym.find(sys.argv[2])["rom"]
data = (Path(sys.argv[0]).absolute().parent / "../baseroms/us/baserom.z64").read_bytes()
s = data[offset:data.find(b"\x00", offset)]
print(s.decode("euc-jp"))