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

79 lines
3.7 KiB
Python

"""D3 run 8: what actually sizes the pack reveal.
FOUND IN RUN 7: the CreatePack deserializer 0x180162880 push_backs EVERY parsed item
TWICE, once into the response object's own vector (obj+0x30/0x38/0x40) and once into
a singleton's vector reached as
mgr = FUN_18011a830() -> vtbl[0x160](mgr) (call it PACKMGR)
PACKMGR+0x30 / +0x38 / +0x40 item vector, 0x18-byte elements
PACKMGR+0x28 byte set to 1 after the whole body is parsed ("contents ready")
vtbl[0x10](PACKMGR) called BEFORE parsing (presumably clear)
numberItems (atom 0x1dd) is written to the RESPONSE at obj+0x28 and is never used to
size either vector: both grow one element per item actually present in itemList.
THIS RUN
1. Resolve FUN_18011a830 and the vtbl+0x160 accessor so PACKMGR's class is named.
2. Decompile vtbl+0x10 (the pre-parse call) to confirm it is a clear.
3. Find readers of PACKMGR's vector and of the +0x28 ready flag: that is the reveal.
4. Disassemble the unanalysed RPC handler thunks 0x180124810 (StorePackTypes),
0x180124800 (StorePackQuantities), 0x180124250 (PurchasePack) -- Ghidra created
no functions there, so read the bytes directly.
CONTROL: FUN_18011a830 must resolve to a singleton getter (a DAT_ load or a
create-on-first-use), and slot 0x160 must be a plain accessor. If either
decompiles to something unrelated the chain is misread.
"""
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
try:
print("### 1. SINGLETON CHAIN")
dump("FUN_18011a830", 0x18011a830, OUT + "d3_mgr_getter.txt", echo=True)
print(" callers of 0x18011a830: %d" % len(callers(0x18011a830)))
print("\n### 4. RPC HANDLER THUNK BYTES")
for va, nm in ((0x180124810, "STOREPACKTYPES"), (0x180124800, "STOREPACKQUANTITIES"),
(0x180124250, "PURCHASEPACK"), (0x180124260, "PURCHASEDITEMS"),
(0x180124240, "PURCHASEITEMS")):
b = read_bytes(va, 32)
print(" %#x %-22s %s" % (va, nm, b.hex()))
f = fm.getFunctionContaining(addr(va))
print(" containing function: %s" % (f.getName() if f else "NONE"))
ins = listing.getInstructionContaining(addr(va))
print(" instruction: %s" % (str(ins) if ins else "NONE (undisassembled)"))
# decode a rel32 jmp/call if present
if b[0] == 0xE9:
t = va + 5 + int.from_bytes(b[1:5], "little", signed=True)
print(" JMP rel32 -> %#x %s" % (t, fname(t)))
if b[0] == 0x48 and b[1] == 0xFF and b[2] == 0x25:
t = va + 7 + int.from_bytes(b[3:7], "little", signed=True)
print(" JMP [rip+..] -> slot %#x = %#x" % (t, qword(t)))
print("\n### 5. READERS OF THE RESPONSE-SIDE numberItems obj+0x28")
# obj+0x28 is disp8-encodable so a byte scan is useless; instead enumerate
# everything that can hold a FutCreatePackServerResponse: only its ctor names the
# vtable, and the factory has no callers, so the object is dispatched generically.
for tgt in (0x180228260, 0x1802282f0, 0x180228268):
print(" xrefs to %#x: %s" % (tgt, [(hex(f), t, n) for f, t, n, e in xrefs_to(tgt)]))
print("\n### 6. duplicateItemIdList sub-parser 0x180138e10")
dump("dupe id list parser", 0x180138e10, OUT + "d3_dupe_parser.txt", echo=True)
except Exception:
traceback.print_exc()
sys.stdout.flush()