"""Dump runtime A0/B0/C0 tables from DuckStation and search for VSync/registrar/init in each.""" import socket, json, time HOST='127.0.0.1'; PORT=4371 def send(cmd, timeout=3.0): s=socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.settimeout(timeout) s.connect((HOST,PORT)) s.sendall((json.dumps(cmd)+'\n').encode()) buf=b'' deadline = time.time()+timeout while time.time() len(d): break w = int.from_bytes(d[i:i+4],'little') annot = TARGETS.get(w, '') if not annot and w != 0 and (w & 0xFFFFFFF0) in {t & 0xFFFFFFF0 for t in TARGETS}: for t,n in TARGETS.items(): if (w & 0xFFFFFFF0) == (t & 0xFFFFFFF0): annot = f'{n}+{w-t:+d}' break print(f' +0x{i:03X}: 0x{w:08X}' + (f' <-- {annot}' if annot else '')) send({"cmd":"pause"}) time.sleep(0.3) # A0 table = {ptr=0x00008648, size=0x2C0 = 704 bytes = 176 entries} table_dump('A0 TABLE', 0x00008648, 0x2C0) # B0 table = {ptr=0x00006EE0, size=0x320 = 800 bytes = 200 entries} table_dump('B0 TABLE', 0x00006EE0, 0x320) send({"cmd":"continue"})