Files
OpenFUT/fifa17-recon/tools/ghidra_queries/q_feature_trade.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

72 lines
3.2 KiB
Python

"""Verify: does userInfo.feature={"trade":true} ZERO the trade gate byte?
The claim (workflow wf_29791945): userInfo.feature (atom 0x11c) is a RESTRICTION map,
not a grant. Sending trade (atom 0x330) = true marks trade restricted, and at the
massinfo top-level END_OBJECT, 0x180174f19 does `mov dword [rsi+0x50],0`, which feeds
the applier 0x18011dc91 `mov [rdi+0x1fd2e],al`, forcing IS_TRADING_ENABLED = 0. It runs
LAST and unconditionally, so no configs/Blaze value can beat it.
This has to be right before we change server code, because two prior trading root-causes
this session were wrong. Verify the actual instructions rather than trust the summary.
CONTROL: storeEnabled path must NOT be zeroed the same way (the store works), so whatever
zeroes trade must be specific to the feature/trade branch, not applied to store.
"""
import re, traceback
MASSINFO = 0x180174630 # massinfo deser root (calls settings deser + appliers)
ZERO_SITE = 0x180174f19 # claimed `mov dword [rsi+0x50],0`
APPLIER = 0x18011DC50
try:
src = dec(MASSINFO)
f = func(MASSINFO)
print("%#x massinfo root body %d / decompile %d chars"
% (MASSINFO, f.getBody().getNumAddresses() if f else -1, len(src)))
# a) the instruction at the claimed zero site, read raw
print("\n=== instructions around %#x ===" % ZERO_SITE)
ins = listing.getInstructionAt(addr(ZERO_SITE))
if ins is None:
# step back to find the containing instruction
ins = listing.getInstructionContaining(addr(ZERO_SITE))
a = addr(ZERO_SITE - 0x18)
for _ in range(14):
i = listing.getInstructionAt(a)
if i is None:
a = a.add(1); continue
mark = " <== claimed zero site" if int(i.getAddress().getOffset()) == ZERO_SITE else ""
print(" %#x %s%s" % (int(i.getAddress().getOffset()), i, mark))
a = i.getAddress().add(i.getLength())
# b) does the feature(0x11c)/trade(0x330) atom appear in the massinfo deser or a callee?
print("\n=== feature 0x11c / trade 0x330 dispatch, in massinfo + callees ===")
scan = [MASSINFO] + [a for a, _ in callees(MASSINFO)]
for ent in scan:
try:
d = dec(ent)
except Exception:
continue
hits = []
for atom, name in ((0x11c, "feature"), (0x330, "trade")):
for m in re.finditer(r"(case |== |!= )0x%x\b" % atom, d):
hits.append(name)
if hits:
print(" %#x %-20s handles: %s" % (ent, fname(ent), sorted(set(hits))))
# c) confirm the applier writes 0x1fd2e from a field, and trace what feeds it
print("\n=== applier %#x: the 0x1fd2e write and its source ===" % APPLIER)
da = dec(APPLIER)
for ln in da.splitlines():
if "0x1fd2e" in ln or "param_2[10]" in ln:
print(" " + ln.strip())
# d) CONTROL: is there a zero-write to the store field (0x1fd2f) anywhere near the
# trade zero site? there should NOT be, or the store would break too.
print("\n=== CONTROL: any 0x1fd2f (store) zeroing near the trade path? ===")
n = sum(1 for ln in src.splitlines() if "0x50] = 0" in ln.replace(" ", "") or "rsi+0x50" in ln)
print(" '[rsi+0x50]=0'-style writes in massinfo root: look above; store gate is a different offset")
except Exception:
traceback.print_exc()