"""Q1: WHERE DOES THE DISPLAYED RATING COME FROM? HYPOTHESIS: the card face is painted from an "attribute publisher" that reads the 0x180-stride parsed item record and pushes named ATTRIB_* keys to the UI layer. CARD_SYSTEM.md already names one such function, FUN_1800e5940, which reads record+0xe3 and publishes ATTRIB_CONTRACT_NEGOTIATION. If that function also publishes a rating key, and it reads it from the record (offset 0xb4 per the live field map) rather than re-querying the local players table, then the displayed rating is OURS. CONTROL (same syntactic form): the publisher must also emit the six attribute keys from +0x98..+0xac. Those are KNOWN-OURS -- CARD_SYSTEM.md records invented attributes rendering on screen (SILVA 72/44/58/60/62/61). If my read of the publisher shows the attributes coming from somewhere OTHER than the record, my read of the publisher is wrong, not the doc, and every rating conclusion in this file is void. Also enumerate every ATTRIB_* literal in .rdata with its xrefs, which is the raw material for the Q2 "ours vs client's" table. """ import traceback try: print("=== A: every ATTRIB_ literal in .rdata ===") hits = find_all(b"ATTRIB_") print("n=%d" % len(hits)) seen = {} for h in hits: s = rd_str(h, 96) seen.setdefault(s, []).append(h) for s in sorted(seen): print(" %-46s %s" % (s, " ".join("%#x" % a for a in seen[s]))) print() print("=== B: xrefs to each ATTRIB_ literal ===") for s in sorted(seen): for a in seen[s]: xs = xrefs_to(a) if not xs: continue print(" %-46s @%#x" % (s, a)) for frm, typ, fn, ent in xs: print(" from %#x %-12s %s(%#x)" % (frm, typ, fn, ent)) print() print("=== C: FUN_1800e5940 in full ===") src = dec(0x1800E5940) print("len=%d" % len(src)) print(src) except Exception: traceback.print_exc()