Files
OpenFUT/fifa17-recon/tools/ghidra_queries/q_mk_online_4.py
T
funman300 43557989f5 fifa17-recon: the transfer market works -- listed a card end to end, no freeze
The subsystem that was fully greyed-out this morning now lists a card on the transfer
market: price screen, Submit, "your item is now up for trade", TRANSFER LIST 0/100,
auctionCount 1, and STORE.listings() holds the auction. Every step verified at the
instruction level first, then confirmed live. Three fixes, all behind flags, all off by
default until this run proved them.

1. WE WERE BANNING OUR OWN TRADING. userInfo.feature (atom 0x11c) is a RESTRICTION map,
   not a grant; we sent feature={"trade":true}, which is a trade BAN. Verified in
   q_feature_trade.py: FUN_18013ec10 parses feature/trade into userInfo+0x17c, and at
   the massinfo END_OBJECT the client runs
     cmp byte [rsi+0x17c],0 / jz skip / mov dword [rsi+0x50],0
   feeding applier 0x18011dc91 -> IS_TRADING_ENABLED (model+0x1fd2e) = 0. It runs LAST
   and unconditionally, which is why the gate read 0 all day regardless of /settings or
   the Blaze config store. FUT_TRADING sends feature={} instead. Live: gate flipped
   0 -> 1 on UT re-entry (model rebuilt, pointer changed, byte read 1).

2. TRANSFER LIST CAPACITY 0/0. pileSizeClientData (massinfo atom 0x227, parser
   0x18013adb0) is the capacity, NOT the "MY CLUB counter" the old comment claimed.
   Verified in q_pilesize_keys.py: exactly two storing arms, key 2 -> model+0x1fd1c
   (TRADE_PILE_SIZE) and key 4 -> +0x1fd20 (watch list), every other key SKIP'd. The old
   code would have sprayed the 246 club count into the capacity. FUT_PILESIZES sends
   key 2 = 100, key 4 = 50. Live: capacity read 0 -> 100, header showed 0/100.

3. THE PRICE SCREEN FROZE THE CLIENT. GET marketdata/pricelimits was answered with an
   OBJECT {minPrice,maxPrice}; the deser 0x180163ee0 reads a BARE TOP-LEVEL ARRAY
   (root loop while tok != 0xd), so object-where-array desynced the SAX reader into the
   0x1801c7f1a busy loop (confirmed live: utime climbing 227 ticks/s, core pinned).
   Verified in q_pricelimits.py: element fields defId 0xcf, maxPrice 0x1c2, minPrice
   0x1ca, all scalar ints. marketdata_route now returns a bare array, one element per
   requested defId. Live: price screen opened and Submit succeeded.

Corrected along the way, all now in the code: two prior "trading root causes" from
earlier today were wrong (the Blaze IS_TRADING_ENABLED keys are output-only names, and
the applier is a virtual method at vtable+0x988, not unreachable). Those refutations are
recorded in blaze_responder_v3b.py and the doc.

Also lands the transfer-market recon doc (plan-2026-08-06-transfer-market.md) and the
market Ghidra query set.

Server-authoritative economy note: the 5% transfer fee and the price bands (currently a
150..15000 placeholder per defId) are not yet real; that is refinement, not a freeze.
The live-auction market SCREEN ("List on Transfer Market" browse) is a separate surface
still to do (P4 auction-counts route, P5 empty market bodies).

Live: 439 contract checks pass. Card listed and persisted, auctionCount 1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-06 14:33:10 -07:00

69 lines
2.6 KiB
Python

"""HYPOTHESIS (Q3): the market refusal and the Seasons refusal are both taken BEFORE any
request is built, so the gate must sit in a caller of the request builder. Walking up
from the route literal "/transfermarket?..." and from the seasons route literals should
expose the predicate, and if the two chains share a callee that predicate is the shared
term.
CONTROL: the SAME walk is run for routes we KNOW the client does issue this session
(/item, /squad/). If the walk produces a plausible-looking "gate" for a route that
demonstrably fires, the walk proves nothing and I say so.
Form-independent: Ghidra refs AND a raw rip-relative disp32 scan over all of .text.
"""
import struct, traceback
try:
ts = te = None
for b in mem.getBlocks():
if str(b.getName()) == ".text":
ts, te = int(b.getStart().getOffset()), int(b.getEnd().getOffset())
text = b""
a = ts
while a <= te:
n = min(1 << 20, te - a + 1)
text += read_bytes(a, n)
a += n
print("len(.text)=%d base=%#x" % (len(text), ts))
def rip_refs(va):
out = []
for i in range(0, len(text) - 4):
d = struct.unpack_from("<i", text, i)[0]
if ts + i + 4 + d == va:
out.append(ts + i)
return out
ROUTES = [
("MARKET", b"/transfermarket?type=%s&start=%d&num=%d\x00"),
("TRADEPILE", b"/tradepile\x00"),
("WATCHLIST", b"/watchlist\x00"),
("SEASONS_HIST", b"/season/user/history?type=online\x00"),
("CONTROL_ITEM", b"/item\x00"),
]
for name, lit in ROUTES:
print("\n" + "=" * 70)
print("### ROUTE %s %r" % (name, lit))
vas = find_all(lit, blocks=(".rdata", ".data"))
print(" literal occurrences:", [hex(v) for v in vas])
for v in vas:
gx = xrefs_to(v)
rr = rip_refs(v)
print(" %#x ghidra_xrefs=%s" % (v, [(hex(x[0]), x[1], x[2]) for x in gx]))
print(" %#x rip_disp_sites=%s" % (v, [hex(x) for x in rr[:12]]))
fns = set()
for site in rr:
f = fm.getFunctionContaining(addr(site))
if f:
fns.add((f.getName(), int(f.getEntryPoint().getOffset())))
for fn, ent in sorted(fns):
print(" in %s %#x" % (fn, ent))
try:
cs = callers(ent)
except Exception as e:
cs = []
print(" callers() err", e)
for c in cs[:20]:
print(" <- ", c)
except Exception:
traceback.print_exc()