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

96 lines
3.2 KiB
Python

"""Q3: find the common FUT request-dispatch path and any precondition that can make the
client refuse to send. Market builder FUN_180162c90 sits at 0x180214dd8 and seasons
builder FUN_180175bd0 at 0x18022d748; both are vtable members. Identify each vtable
(start + RS4 class name nearby), decode enough slots to see the shape, and find the
call sites of the slot index they occupy.
CONTROL: the model vtable 0x18021c2a0 with slot +0x988 = FUN_18011dc50 is a KNOWN,
already-verified vtable/slot pair. The same routine is applied to it, and it must
reproduce +0x988; otherwise the vtable-start detection is wrong.
"""
import struct, traceback
try:
blocks = {}
for b in mem.getBlocks():
blocks[str(b.getName())] = (int(b.getStart().getOffset()), int(b.getEnd().getOffset()))
def blk(name):
s, e = blocks[name]
out = b""
a = s
while a <= e:
n = min(1 << 20, e - a + 1)
out += read_bytes(a, n)
a += n
return s, out
ts, text = blk(".text")
rs, rdata = blk(".rdata")
def is_code(v):
return 0x180001000 <= v < 0x1801e5000
def vtable_start(ptr_site):
"""Walk back while the preceding qword is also a .text pointer."""
a = ptr_site
while a - 8 >= rs:
v = struct.unpack_from("<Q", rdata, a - 8 - rs)[0]
if not is_code(v):
break
a -= 8
return a
def vtable_len(start):
n = 0
a = start
while a - rs + 8 <= len(rdata):
v = struct.unpack_from("<Q", rdata, a - rs)[0]
if not is_code(v):
break
n += 1
a += 8
return n
def rtti_name_near(start):
"""The qword right before a vtable is usually the RTTI/type descriptor
pointer; also try the EA 'RS4:' literal convention nearby."""
out = []
for back in (8, 16):
a = start - back
if a - rs < 0:
continue
v = struct.unpack_from("<Q", rdata, a - rs)[0]
out.append((back, hex(v)))
return out
CASES = [
("CONTROL model applier", 0x18021cc28, 0x18011dc50),
("market builder", 0x180214dd8, 0x180162c90),
("seasons builder", 0x18022d748, 0x180175bd0),
]
for lbl, site, fn in CASES:
st = vtable_start(site)
ln = vtable_len(st)
print("\n### %s ptr_site=%#x fn=%#x" % (lbl, site, fn))
print(" vtable start=%#x slots=%d slot_of_fn=+%#x" % (st, ln, site - st))
print(" preceding qwords:", rtti_name_near(st))
# print slots
for i in range(min(ln, 40)):
v = struct.unpack_from("<Q", rdata, st - rs + i * 8)[0]
f = fm.getFunctionAt(addr(v))
print(" +%#05x %#x %s" % (i * 8, v, f.getName() if f else ""))
if ln > 40:
print(" ... (%d more)" % (ln - 40))
print("\n\n### decompile market builder FUN_180162c90")
s = dec(0x180162c90)
print("len=%d" % len(s))
print(s)
print("\n\n### decompile seasons builder FUN_180175bd0")
s = dec(0x180175bd0)
print("len=%d" % len(s))
print(s)
except Exception:
traceback.print_exc()