mirror of
https://github.com/pmret/papermario.git
synced 2024-11-10 04:52:34 +01:00
27 lines
587 B
Python
27 lines
587 B
Python
|
#!/usr/bin/python3
|
||
|
|
||
|
from collections import OrderedDict
|
||
|
import os
|
||
|
import sys
|
||
|
|
||
|
script_dir = os.path.dirname(os.path.realpath(__file__))
|
||
|
|
||
|
syms = {}
|
||
|
|
||
|
file_path = os.path.join(script_dir, "symbol_addrs.txt")
|
||
|
|
||
|
with open(file_path) as f:
|
||
|
symbol_lines = f.readlines()
|
||
|
|
||
|
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
|
||
|
|
||
|
with open("test.txt", newline="\n", mode="w") as f:
|
||
|
for addr in sorted(syms):
|
||
|
f.write(syms[addr])
|