afdbb364ca
A twelve-agent pass over the parts of pack opening we did not understand, run against
the live client (CardsDLL slide proven, not assumed) plus static CardsDLL. Findings
below survived an adversarial verification round that corrected several of them; where
a verifier and a finder disagreed, the verifier won.
THE HEADLINE IS A NEGATIVE, and it deletes work rather than creating it. There is no
pack-inventory endpoint in FIFA 17 and there never was. Proven three independent ways:
the 48-entry UTAS route template array at 0x18021df80, a regex for "ut/" over the whole
PE, and the 125-row client action table at 0x1802caa20, which is the complete set of
requests the client can originate. "Serve the pack inventory" comes off the backlog.
The unclaimed-pack tile and My Packs are two fields on responses we already build.
Corrections to ENDPOINT_MAP.md, both freeze-risky as written:
* duplicateItemIdList is an array of OBJECTS (element parser 0x180138e10: itemId
0x16d, duplicateItemId 0xeb, itemLoans 0x16f, duplicateItemLoans 0xed), not the
int list documented at :1095 and :218. Control that this is not a misread:
dreamSquads 0xe9 in FutMoveCard genuinely is a bare int array and parses with no
inner object loop. We serve [], so this is a docs bug today and a live freeze the
moment somebody implements it from the map as written.
* FutDiscardCardServerResponse is {"items":[{"id":N}],"totalCredits":N}. There is no
top-level id. :968-971 is wrong twice over.
packContentInfo is DECORATIVE. It is read only into a store-tile view model, and
nothing compares the declared counts against the delivered itemList, so open_pack()
does not have to honour the distribution.
The reveal is entirely CLIENT-SIDE. Walkout, tiering, colours and ordering are
arithmetic over fields we already send. Genuine outstanding server work reduces to
three items: duplicates, quick-sell credit, unopenedPacks.
Perishable intel captured: the real FIFA 17 retail pack catalogue, 41 SKUs with Origin
offer ids, recovered from the client heap as a parsed copy of data/store/storecfg.xml.
It is in no file on disk, only in a running process.
futmem/ is a standalone read-only Rust crate for this kind of work (maps, find,
strings, read). Read-only by construction: it opens /proc/<pid>/mem with File::open
and there is no code path in it that can write to another process, because a live game
session depends on that. Its own [workspace] table keeps it out of the parent
workspace. Chunked scanning overlaps by pattern_len-1 so a match spanning a chunk
boundary is still found.
utas_server.py gains FUT_PORT/FUT_LOG so a throwaway instance can be started without
bouncing the one the live client is using. Defaults unchanged (8099, /tmp/utas_server.log).
Noted for the record: this edit came from a research agent that had been told not to
touch server code. It is benign and useful, but it was out of scope.
Not committed: the doc proposes ENDPOINT_MAP.md changes as pasteable text rather than
applying them, and every proposed server change defaults off per the house rule.
Nothing in this commit changes a response the client sees.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
161 lines
6.4 KiB
Python
161 lines
6.4 KiB
Python
"""D5 Q3/Q4/Q5: who READS the pack availability fields and the currency funds,
|
|
what the two store ServerCall vtables look like, and what the HTTP error path does.
|
|
|
|
HYPOTHESES
|
|
H4 (sold out): the pack record fields state(+0xB0), start(+0xB4), end(+0xB8),
|
|
quantity(+0xBC), purchaseLimit(+0xC0), purchaseCount(+0xC4), saleType(+0xC8)
|
|
are read together by one availability predicate in the store UI.
|
|
Offsets derived from the stack layout of FUN_18013af30 (base local_268, size 0x158).
|
|
H5 (error path): FUN_18016c060 is the generic HTTP-status -> FUT-error mapper and
|
|
FUN_1801267b0 only special-cases 409 + "User already has a transaction" -> 0x70.
|
|
|
|
CONTROL: the same offset-scan run for offset 0x28 (a control offset that appears
|
|
everywhere) must return far more functions than the pack offsets, proving the scan
|
|
is not silently returning nothing. Also dec(0x180171a60) printed as a live control.
|
|
"""
|
|
import traceback, os, struct
|
|
|
|
OUT = "/tmp/claude-1000/-home-alex-Documents-OpenFUT/8e521ca1-ca3e-4138-bb96-df1744dd1d30/scratchpad/packres"
|
|
|
|
def w(name, text):
|
|
p = os.path.join(OUT, name)
|
|
with open(p, "w") as f:
|
|
f.write(text)
|
|
print("WROTE %s (%d bytes)" % (p, len(text)))
|
|
|
|
try:
|
|
buf = []
|
|
def P(*a):
|
|
s = " ".join(str(x) for x in a)
|
|
print(s); buf.append(s)
|
|
|
|
s = dec(0x180171a60)
|
|
P("CONTROL dec(0x180171a60) len=%d sax=%s" % (len(s), "FUN_1801c7f10" in s))
|
|
|
|
# ---------- A. vtable dumps ----------
|
|
def dumpvt(lo, hi, tag):
|
|
P("")
|
|
P("=== %s %#x..%#x ===" % (tag, lo, hi))
|
|
a = lo
|
|
while a < hi:
|
|
try:
|
|
q = qword(a)
|
|
except Exception as e:
|
|
P(" %#x ERR %s" % (a, e)); a += 8; continue
|
|
f = fm.getFunctionAt(addr(q)) if 0x180000000 <= q < 0x181000000 else None
|
|
extra = ""
|
|
if f is None:
|
|
try:
|
|
raw = read_bytes(a, 8)
|
|
if all(32 <= b < 127 or b == 0 for b in raw) and raw[0] != 0:
|
|
extra = "inline-ascii %r" % raw
|
|
except Exception:
|
|
pass
|
|
if 0x180000000 <= q < 0x181000000:
|
|
try:
|
|
t = rd_str(q, 50)
|
|
if t and all(32 <= ord(c) < 127 for c in t):
|
|
extra += " ->str %r" % t
|
|
except Exception:
|
|
pass
|
|
P(" +%03x %#x -> %#x %s %s" % (a - lo, a, q, f.getName() if f else "", extra))
|
|
a += 8
|
|
|
|
dumpvt(0x1802202f0, 0x1802203a8, "PurchaseItems ServerCall region")
|
|
dumpvt(0x180228250, 0x180228330, "CreatePack ServerCall region")
|
|
dumpvt(0x1801f0440, 0x1801f04b0, "first-party CARDPACK descriptor")
|
|
dumpvt(0x18021dd40, 0x18021de30, "StoreGetPackTypes region")
|
|
|
|
# ---------- B. service / viewmodel strings ----------
|
|
P("")
|
|
for va, nm in ((0x1802345d8, "FutComponentServicesImpl::FutStoreServiceImpl"),
|
|
(0x1801ee8d8, "futstoreviewmodel"),
|
|
(0x1801f4e48, "PurchasePack"),
|
|
(0x180205560, "PURCHASE_FAILED"),
|
|
(0x180205678, "PURCHASE_SUCCESS"),
|
|
(0x1802150e8, "PACK_EXISTS_IN_PURCHASED_PILE"),
|
|
(0x180215108, "PACK_PURCHASE_FAILED")):
|
|
try:
|
|
xs = xrefs_to(va)
|
|
except Exception as e:
|
|
P("XREF %s ERR %s" % (nm, e)); continue
|
|
P("XREFS %-46s %#x : %s" % (nm, va, [("%#x" % f, n, "%#x" % e2) for f, t, n, e2 in xs]))
|
|
|
|
# ---------- C. who constructs the two ServerCalls ----------
|
|
P("")
|
|
for vt, tag in ((0x180228270, "CreatePack call vtable"),
|
|
(0x1802202f8, "PurchaseItems call vtable"),
|
|
(0x18021dd90, "packtypes?"),):
|
|
pat = struct.pack("<Q", vt)
|
|
P("=== code refs to vtable ptr %#x (%s) ===" % (vt, tag))
|
|
for frm, typ, fn, ent in xrefs_to(vt):
|
|
P(" from %#x %-12s %s @ %#x" % (frm, typ, fn, ent))
|
|
|
|
for callee, tag in ((0x180162530, "createpack_req_ser"),
|
|
(0x180126440, "purchaseitems_req_ser"),
|
|
(0x180162770, "createpack_resp_factory"),
|
|
(0x180126820, "purchaseitems_resp_factory"),
|
|
(0x18016c060, "http_status_mapper"),
|
|
(0x180166a30, "state_enum_to_str")):
|
|
try:
|
|
cs = callers(callee)
|
|
except Exception as e:
|
|
P("CALLERS %s ERR %s" % (tag, e)); continue
|
|
P("CALLERS of %-28s %#x : %s" % (tag, callee, cs))
|
|
|
|
# ---------- D. offset scan for pack-record readers ----------
|
|
P("")
|
|
P("=== disp32 offset scan in .text ===")
|
|
def scan(off):
|
|
pat = struct.pack("<I", off)
|
|
hits = find_all(pat, (".text",))
|
|
fs = {}
|
|
for h in hits:
|
|
f = fm.getFunctionContaining(addr(h))
|
|
if f:
|
|
fs.setdefault(int(f.getEntryPoint().getOffset()), 0)
|
|
fs[int(f.getEntryPoint().getOffset())] += 1
|
|
return fs
|
|
|
|
packoffs = [0xB0, 0xB4, 0xB8, 0xBC, 0xC0, 0xC4, 0xC8, 0x158]
|
|
tables = {}
|
|
for o in packoffs + [0x28]:
|
|
tables[o] = scan(o)
|
|
P(" offset %#05x -> %d funcs" % (o, len(tables[o])))
|
|
|
|
score = {}
|
|
for o in (0xB0, 0xBC, 0xC0, 0xC4, 0xC8):
|
|
for e in tables[o]:
|
|
score.setdefault(e, set()).add(o)
|
|
cands = sorted((e for e, s2 in score.items() if len(s2) >= 3),
|
|
key=lambda e: -len(score[e]))
|
|
P(" candidates with >=3 of {B0,BC,C0,C4,C8}: %d" % len(cands))
|
|
for e in cands[:40]:
|
|
P(" %#x %-30s offs=%s" % (e, fname(e), sorted("%#x" % x for x in score[e])))
|
|
|
|
w("d5_q3_notes.txt", "\n".join(buf) + "\n")
|
|
|
|
# ---------- E. decompiles ----------
|
|
TG = {"http_status_mapper_18016c060": 0x18016c060,
|
|
"state_enum_to_str_180166a30": 0x180166a30,
|
|
"createpack_req_ser_180162530": 0x180162530,
|
|
"purchaseitems_req_ser_180126440": 0x180126440}
|
|
for tag, va in sorted(TG.items()):
|
|
try:
|
|
src = dec(va)
|
|
except Exception as e:
|
|
src = "// ERR %s" % e
|
|
w("d5_q3_dec_%s.txt" % tag, "// %s %#x len=%d\n" % (tag, va, len(src)) + src)
|
|
|
|
txt = []
|
|
for e in cands[:14]:
|
|
src = dec(e)
|
|
txt.append("// ===== %#x %s offs=%s len=%d\n%s"
|
|
% (e, fname(e), sorted("%#x" % x for x in score[e]), len(src), src))
|
|
w("d5_q3_packreaders.txt", "\n".join(txt))
|
|
|
|
w("d5_q3_notes.txt", "\n".join(buf) + "\n")
|
|
print("DONE")
|
|
except Exception:
|
|
traceback.print_exc()
|