42 lines
3.0 KiB
Python
42 lines
3.0 KiB
Python
"""Content step on 2076e57c (2026-11-25): our own client version in-game + login (owner: "reflect our own version of the game"),
|
|
and the Ulduar rifle (firearm_2h_rifle_ulduar_d_01, FDID 145489 + skin 8811807) re-converted with its type-1 slot as the item slot
|
|
(it drew a white sphere). Lua: make_inputs.py. Rifle: item-displays-20261123/build8r.py."""
|
|
import json, hashlib, struct, sys
|
|
from pathlib import Path
|
|
H = Path(__file__).resolve().parent; sys.path.insert(0, str(H))
|
|
import frozen_store as fs
|
|
md5 = lambda b: hashlib.md5(b).hexdigest(); sha = lambda b: hashlib.sha256(b).hexdigest()
|
|
I = H / 'inputs'; D8 = Path('/mnt/Games/@project/gateway/runtime/continuation-20261113/claude-lane/item-displays-20261123')
|
|
R = json.load(open(D8 / 'add8r-models.json'))['art']
|
|
FILES = [(6234512, 'interface/addons/blizzard_sharedxmlbase/compat.lua', I / '6234512.after.lua', 'Our own client version: GetBuildInfo returns the Octo version/build/date'),
|
|
(5612756, 'interface/addons/blizzard_gluexml/mainline/accountlogin.lua', I / '5612756.after.lua', 'Login screen shows GetBuildInfo (our version)')] + \
|
|
[(a['file_data_id'], a['path'], Path(a['file']), 'Ulduar rifle type-1 slot retyped to the item slot (was a white sphere)') for a in R]
|
|
store = fs.Store(); root = store.root; lay = store.layout; assert lay['root_md5'] == fs.ROOT
|
|
patched = bytearray(root); pins = []
|
|
for fid, name, out, why in FILES:
|
|
cells = []
|
|
for g in lay['groups']:
|
|
f = 0
|
|
for i, (d,) in enumerate(struct.iter_unpack('<I', memoryview(root)[g['ids_offset']:g['ckeys_offset']])):
|
|
f += d
|
|
if f == fid: cells.append((g, g['ckeys_offset'] + i * 16))
|
|
f += 1
|
|
en = [(g, at) for g, at in cells if g['locale'] & 2 and not g.get('flags1')]
|
|
if len(en) == 1: kind, sel = 'wdc_enus', {}
|
|
else:
|
|
assert len(cells) == 1, (fid, len(cells)); en = cells; kind = 'root_selector'
|
|
sel = {k: v for k, v in cells[0][0].items() if k in ('locale', 'flags1', 'flags2', 'content_flags')}
|
|
g, at = en[0]; ck = root[at:at + 16].hex(); old = store.read(ck)[2]
|
|
new = out.read_bytes()
|
|
if new == old: print(fid, "unchanged, skipped"); continue
|
|
patched[at:at + 16] = bytes.fromhex(md5(new))
|
|
d = H / 'pins' / str(fid); d.mkdir(parents=True, exist_ok=True)
|
|
(d / 'before.bin').write_bytes(old); (d / 'after.bin').write_bytes(new)
|
|
pin = dict(fdid=fid, table=name, parent_root=fs.ROOT, selected_group=sel, original_decoded=dict(file='before.bin', md5=ck, sha256=sha(old)),
|
|
encrypted_original=False, after_decoded=dict(file='after.bin', md5=md5(new), sha256=sha(new)), reason=why)
|
|
(d / 'pin.json').write_text(json.dumps(pin, indent=1) + '\n')
|
|
pins.append(dict(file=str(d / 'pin.json'), sha256=sha((d / 'pin.json').read_bytes()), type=kind)); print(fid, kind, sel)
|
|
(H / 'components.json').write_text(json.dumps(pins, indent=2) + '\n')
|
|
(H / 'selected-root.json').write_text(json.dumps(dict(parent_build=fs.BUILD, parent_root=fs.ROOT, decoded_root_sha256=sha(bytes(patched)), parent_root_sha256=sha(root)), indent=2) + '\n')
|
|
print('pins', len(pins))
|