"""DIMENSION 5 -- query 5. Does CardsDLL have an SBC/objectives HUB TILE case or a
feature gate for them? Grep the full hub tile builder + look for GOTO_/DESTINATION
strings mentioning SBC/challenge/manager-task, and any 'enableSquadBuildingSets'-style
gate. Also enumerate the dispatch table around 0x180226fc0 (what handler group it is).
"""
import traceback
try:
    d = dec(0x1800b2680)
    import re
    print("=== hub builder: lines mentioning SBC/CHALLENGE/TASK/GOTO_/DESTINATION/SQUAD_BUILD ===")
    for ln in d.splitlines():
        if re.search(r"SBC|CHALLENGE|MANAGER_TASK|MANAGERTASK|GOTO_|DESTINATION|SQUAD_BUILD|OBJECTIVE|QUEST", ln, re.I):
            print("  " + ln.strip()[:140])

    print("\n=== all quoted string literals in hub builder (tile destinations) ===")
    seen = set()
    for m in re.findall(r'"([^"]{2,60})"', d):
        if m not in seen:
            seen.add(m)
            print("   ", m)

    print("\n=== dispatch table @0x180226fc0 (handler group containing 0x180154990) ===")
    for i in range(-6, 16):
        p = 0x180226fc0 + i*8
        v = qword(p)
        nm = fname(v) if 0x180000000 <= v < 0x181000000 else ""
        print("   [%#x] %#x %s" % (p, v, nm))

    print("\n=== xrefs_to dispatch table base region (who indexes 0x180226fc0) ===")
    for base in (0x180226fc0, 0x180226fb0, 0x180226fb8):
        xs = xrefs_to(base)
        if xs:
            print("  refs to %#x:" % base)
            for frm, typ, fn, ent in xs:
                print("    %#x %s in %s(%#x)" % (frm, typ, fn, ent))
except Exception:
    traceback.print_exc()
