2023-05-04 11:03:02 +02:00
|
|
|
#!/usr/bin/env python3
|
2020-11-01 23:36:59 +01:00
|
|
|
|
|
|
|
from collections import OrderedDict
|
|
|
|
import os
|
|
|
|
import sys
|
|
|
|
|
|
|
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
|
|
|
|
|
|
|
|
2021-02-22 10:21:23 +01:00
|
|
|
for version in ["us", "jp"]:
|
2023-02-17 03:06:56 +01:00
|
|
|
syms = {}
|
2021-12-28 18:11:07 +01:00
|
|
|
file_path = os.path.join(script_dir, f"../ver/{version}/symbol_addrs.txt")
|
2020-11-01 23:36:59 +01:00
|
|
|
|
2021-02-22 10:21:23 +01:00
|
|
|
with open(file_path) as f:
|
|
|
|
symbol_lines = f.readlines()
|
2020-11-01 23:36:59 +01:00
|
|
|
|
2021-02-22 10:21:23 +01:00
|
|
|
for line in symbol_lines:
|
|
|
|
addr_text = line.split(" = ")[1][:10]
|
|
|
|
addr = int(addr_text, 0)
|
|
|
|
if addr in syms:
|
|
|
|
print("Duplicate address: " + addr_text)
|
|
|
|
sys.exit(55)
|
|
|
|
syms[addr] = line
|
2020-11-01 23:36:59 +01:00
|
|
|
|
2021-02-22 10:21:23 +01:00
|
|
|
with open(file_path, newline="\n", mode="w") as f:
|
|
|
|
for addr in sorted(syms):
|
|
|
|
f.write(syms[addr])
|