Files
OpenFUT/fifa17-recon/tools/ghidra_queries/q_pack_content_7.py
T
funman300 afdbb364ca fifa17-recon: pack opening reversed end to end, and there is no pack-inventory endpoint
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>
2026-08-05 19:24:37 -07:00

102 lines
3.9 KiB
Python

"""D3 run 7: the RPC descriptor row's handler, and the end of the pack-record trail.
FOUND IN RUN 6: a descriptor table in .data at ~0x1802cb800 with 0x30-byte rows
[display-name ptr, 0x1b, COMMAND-token ptr, 0, 0, function ptr]
0x1802cb860 "PurchaseItems" "PURCHASEITEMS" -> 0x180124240
0x1802cb890 "StorePackTypes" "STOREPACKTYPES" -> 0x180124810
0x1802cb8c0 "StorePackQuantities" "STOREPACKQUANTITIES" -> ?
Also a factory table at 0x18021ddf8 holding 0x180123480.
CardsDLL exports only PlugInitialize_ / PlugDeinitialize_ / entry, so everything the
packed exe can see comes through interfaces those hand out.
THIS RUN
1. Walk the descriptor table rows around 0x1802cb800 +/- 0x300 and print each row.
2. Decompile the StorePackTypes handler 0x180124810 and the CreatePack handler,
then follow their callees/callers, looking for anything that touches the
response object's vector at +0x28.
3. Same for the CreatePack response: who reads numberItems at obj+0x28 or the
itemList vector at obj+0x30/0x38, i.e. what sizes the reveal.
CONTROL: 0x180124810 must decompile to something that mentions the store response
factory 0x180123480 or the vtable 0x18021dd68 or the path string "store"; if it
looks unrelated the table row reading is wrong.
"""
import traceback, sys, os
OUT = "/tmp/claude-1000/-home-alex-Documents-OpenFUT/8e521ca1-ca3e-4138-bb96-df1744dd1d30/scratchpad/packres/"
os.makedirs(OUT, exist_ok=True)
def dump(tag, va, path, echo=True):
src = dec(va)
hdr = "%s %#x fname=%s len(src)=%d (FULL, NOT TRUNCATED)" % (
tag, va, fname(va), len(src))
if echo:
print("=" * 78)
print(hdr)
print("=" * 78)
print(src)
with open(path, "w") as fh:
fh.write("// " + hdr + "\n" + src)
return src
def sstr(q):
if 0x1801e5000 <= q < 0x1802e0000:
try:
s = rd_str(q, 64)
if s and all(32 <= ord(c) < 127 for c in s):
return s
except Exception:
pass
return None
try:
print("### 1. DESCRIPTOR TABLE WALK")
base = 0x1802cb500
for row in range(0, 0x600, 0x30):
a = base + row
try:
qs = [qword(a + i * 8) for i in range(6)]
except Exception:
continue
n0, n2 = sstr(qs[0]), sstr(qs[2])
if not (n0 and n2):
continue
fn = qs[5]
print(" %#x %-24s %-24s flags=%#x fn=%#x %s"
% (a, n0, n2, qs[1], fn, fname(fn) if fn else ""))
print("\n### 2. HANDLERS")
seen = set()
for va, tag in ((0x180124810, "StorePackTypes handler"),
(0x180124240, "PurchaseItems handler")):
dump(tag, va, OUT + "d3_h_%x.txt" % va, echo=True)
print(" callees:")
for a, n in callees(va):
print(" %#x %s" % (a, n))
print(" callers:")
for a, n in callers(va):
print(" %#x %s" % (a, n))
seen.add(va)
print("\n### 3. WHO ELSE MENTIONS THE STORE FACTORY / VTABLE / FACTORY TABLE SLOT")
for tgt in (0x18021ddf8, 0x18021dd68, 0x180123480, 0x1801234e0, 0x180123030):
print(" xrefs to %#x:" % tgt)
for frm, typ, fn, ent in xrefs_to(tgt):
print(" %#x %s %s" % (frm, typ, fn))
print("\n### 4. CREATEPACK RESPONSE CONSUMERS")
dump("FutCreatePack ctor", 0x180162420, OUT + "d3_cp_ctor.txt", echo=True)
print(" callers of ctor: %s" % [(hex(a), n) for a, n in callers(0x180162420)])
dump("FutCreatePack factory 0x180162770", 0x180162770, OUT + "d3_cp_factory.txt",
echo=True)
print(" callers of factory: %s" % [(hex(a), n) for a, n in callers(0x180162770)])
for tgt in (0x180162770, 0x180162880, 0x180228260):
pat = tgt.to_bytes(8, "little")
for h in find_all(pat, blocks=(".rdata", ".data")):
print(" %#x embedded at %#x" % (tgt, h))
except Exception:
traceback.print_exc()
sys.stdout.flush()