mirror of
https://github.com/Kaisaan/lostkefin.git
synced 2025-06-18 08:35:38 -04:00
25 lines
561 B
Python
25 lines
561 B
Python
import os
|
|
|
|
slpm = open("extracted/SLPM_663.60", "rb")
|
|
|
|
table = open("font.tbl", "w", encoding="shift-jis")
|
|
|
|
start = 0x1A31F0
|
|
end = 0x1A3E98
|
|
|
|
fileptr = start
|
|
|
|
while fileptr < end:
|
|
|
|
slpm.seek(fileptr)
|
|
charval = slpm.read(2)
|
|
char = charval.decode(encoding="shift-jis", errors="backslashreplace").lstrip(" ")
|
|
# char
|
|
charval = int.from_bytes(charval, "big")
|
|
charval = hex(charval).removeprefix("0x").upper().removeprefix("20")
|
|
|
|
table.write(f"{charval}={char}\n")
|
|
print(fileptr)
|
|
print(char)
|
|
print(charval)
|
|
fileptr += 2 |