"""DIM4 Q1/Q3. Hypothesis: each row of the client action table 0x1802caa20 holds a
FACTORY fn at +0x28 that constructs the request object; from it we can read the
request class vtable (serializer) and the response class name. Also decode the two
enum converters 0x180166380 (str->bidState) and 0x180166bd0 (str->tradeState).

CONTROL: SaveSquad factory 0x1801245f0 -- a KNOWN-GOOD op whose request body
(PUT /squad/<id> with a squad object) is already proven live. If the method that
works for SaveSquad also works for the IS ops, the form matches.
"""
import traceback
try:
    FACT = [
        ("ISSearch",            0x180124110),
        ("ISOfferTrade",        0x1801240e0),
        ("ISStart",             0x180124120),
        ("RelistAll",           0x1801245b0),
        ("ISRemoveWatch",       0x180124100),
        ("ISWatchTrade",        0x180124150),
        ("ISWatchList",         0x180124140),
        ("ISViewTrade",         0x180124130),
        ("GetTradePile",        0x180124060),
        ("GetAuctionCount",     0x180123d60),
        ("ISRemoveTrade",       0x1801240f0),
        ("GetSuggestedPricing", 0x180124050),
        ("SaveSquad(CONTROL)",  0x1801245f0),
    ]
    for nm, a in FACT:
        print("\n########## FACTORY %s @ %#x ##########" % (nm, a))
        s = dec(a)
        print("len(src)=%d" % len(s))
        print(s)
    for nm, a in [("str->bidState", 0x180166380), ("str->tradeState", 0x180166bd0)]:
        print("\n########## ENUM %s @ %#x ##########" % (nm, a))
        s = dec(a)
        print("len(src)=%d" % len(s))
        print(s)
except Exception:
    traceback.print_exc()
