mirror of
https://github.com/pret/ds_disassembly_tools.git
synced 2026-03-21 18:04:11 -05:00
13 lines
372 B
Python
13 lines
372 B
Python
import re
|
|
import collections
|
|
|
|
data = collections.defaultdict(list)
|
|
pat = re.compile(r'(ov\d+_[0-9A-F]{8}): ; (0x[0-9A-F]{8})')
|
|
with open('tmp.s') as fp:
|
|
for line in fp:
|
|
if (m := pat.match(line)) is not None:
|
|
data[int(m[2], 0)].append(m[1])
|
|
for addr, labels in data.items():
|
|
if len(labels) == 1:
|
|
print(f's/sub_{addr:08X}/{labels[0]}/g')
|