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

97 lines
3.7 KiB
Python

"""D4 Q1e: many FutDataManagerImpl accessors are 8-byte leaf stubs that Ghidra never
turned into functions, so dec() returned nothing for them in q_pack_reveal_4. Decode
their bytes directly instead: `0f b6 81 <disp32> c3` = movzx eax,byte ptr [rcx+disp32].
Goal: the full slot -> gate-byte map for vtable 0x18021c2a0, and specifically which
slot (if any) returns byte 0x1fd45, the byte written from settings field [0x1d], which
is the packOpeningAnimationEnabled arm.
CONTROL: slot +0x2b0 must decode to 0x1fd3a and slot +0x2c8 to 0x1fd3d, because
FUN_18006cc60 calls exactly those two slots to publish IS_FRIENDLY_SEASON_ENABLED and
IS_DRAFT_MODE_ENABLED, and FUN_18011dc50 writes those two bytes from fields [0x16] and
[0x17], the two documented worked examples.
Then: xrefs to whichever stub returns 0x1fd45.
"""
import traceback, struct
OUT = "/tmp/claude-1000/-home-alex-Documents-OpenFUT/8e521ca1-ca3e-4138-bb96-df1744dd1d30/scratchpad/packres/"
BUF = []
def p(*a):
s = " ".join(str(x) for x in a)
print(s)
BUF.append(s)
def stub_offset(t):
"""decode a leaf accessor stub -> (kind, byte offset) or (None, raw hex)."""
b = read_bytes(t, 24)
h = b.hex()
# movzx eax, byte ptr [rcx+disp32] ; ret
if b[0:3] == b"\x0f\xb6\x81" and b[7:8] == b"\xc3":
return ("movzx byte", struct.unpack("<I", b[3:7])[0], h)
# mov eax, dword ptr [rcx+disp32] ; ret
if b[0:2] == b"\x8b\x81" and b[6:7] == b"\xc3":
return ("mov dword", struct.unpack("<I", b[2:6])[0], h)
# lea rax,[rcx+disp32] ; ret
if b[0:3] == b"\x48\x8d\x81" and b[7:8] == b"\xc3":
return ("lea", struct.unpack("<I", b[3:7])[0], h)
# movzx eax, byte [rcx+disp8]
if b[0:3] == b"\x0f\xb6\x41" and b[4:5] == b"\xc3":
return ("movzx byte8", b[3], h)
return (None, -1, h)
try:
VT = 0x18021C2A0
found = {}
for off in range(0x00, 0x400, 8):
try:
t = qword(VT + off)
except Exception:
continue
if not (0x180001000 <= t < 0x1801E5000):
continue
kind, o, h = stub_offset(t)
if kind:
p(" +%#05x -> %#x %-12s field_byte=%#x" % (off, t, kind, o))
found[off] = (t, kind, o)
else:
fn = fm.getFunctionAt(addr(t))
p(" +%#05x -> %#x NOT-A-STUB %s bytes=%s" % (off, t, fn.getName() if fn else "?", h[:32]))
p("=== CONTROL CHECK ===")
for slot, want, name in ((0x2B0, 0x1FD3A, "IS_FRIENDLY_SEASON_ENABLED"),
(0x2C8, 0x1FD3D, "IS_DRAFT_MODE_ENABLED")):
got = found.get(slot, (0, "?", -1))[2]
p(" slot %#x expect %#x got %#x %s %s" %
(slot, want, got, "PASS" if got == want else "FAIL", name))
p("=== slots returning the settings gate bytes 0x1fd2c..0x1fd48 ===")
for off, (t, kind, o) in sorted(found.items()):
if 0x1FD00 <= o <= 0x1FD70:
p(" slot +%#05x stub %#x byte %#x" % (off, t, o))
p("=== who reads 0x1fd45 ? ===")
hits = [(off, t) for off, (t, k, o) in found.items() if o == 0x1FD45]
p(" stubs returning 0x1fd45: %s" % [(hex(a), hex(b)) for a, b in hits])
for off, t in hits:
xs = xrefs_to(t)
p(" xrefs to stub %#x : %d" % (t, len(xs)))
for frm, typ, fn, ent in xs:
p(" from %#x %s in %s @ %#x" % (frm, typ, fn, ent))
# also: xrefs to the vtable slot address itself (indirect call sites are in the
# packed exe, so expect few/none)
for off, t in hits:
xs = xrefs_to(VT + off)
p(" xrefs to vtable slot %#x : %d -> %s" % (VT + off, len(xs), xs[:10]))
except Exception:
traceback.print_exc()
finally:
with open(OUT + "d4_fdm_stubs.txt", "w") as f:
f.write("\n".join(BUF))
print("WROTE d4_fdm_stubs.txt")