"""D3: the FutGetUserMassInfoServerResponse constructor FUN_180173a50 -- what is
the DEFAULT of +0x17c, the byte that vetoes tradingEnabled?

Also: is there a SEPARATE "/settings" request descriptor whose completion path
skips that veto? Slot +0x08 of descriptor vtable 0x18022d000 is
FUN_180173d60 -> route literal "/userMassInfo", so descriptors carry their route
as a plain string; find the one carrying "/settings" and walk its vtable the same
way.

CONTROL: the "/userMassInfo" literal must resolve back to FUN_180173d60 through
the same machinery used to find "/settings". If it does not, an absence for
"/settings" proves nothing.
"""
import traceback

try:
    print("### FUN_180173a50  response ctor")
    src = dec(0x180173A50)
    print("len(src)=%d" % len(src))
    print(src)

    print()
    print("#" * 78)
    print("### route literals")
    for lit in (b"/userMassInfo\x00", b"/settings\x00", b"/settings?", b"settings"):
        hits = find_all(lit, blocks=(".rdata", ".data"))
        print("--- %r  %d hits: %s" % (lit, len(hits), [hex(h) for h in hits[:20]]))
        for h in hits[:20]:
            for frm, typ, fn, ent in xrefs_to(h):
                print("      ref from %#x %s in %s (%#x)" % (frm, typ, fn, ent))

    print()
    print("#" * 78)
    print("### every RS4: response class name mentioning Settings or MassInfo")
    for h in find_all(b"RS4:Fut", blocks=(".rdata", ".data")):
        s = rd_str(h, 80)
        if "etting" in s or "assInfo" in s:
            print("   %#x  %s" % (h, s))
            for frm, typ, fn, ent in xrefs_to(h):
                print("      ref from %#x %s in %s (%#x)" % (frm, typ, fn, ent))
except Exception:
    traceback.print_exc()
