Files
WoW-Hybrid-gateway/ops/engine_death_release_observation.py
praxisandClaude Fable 5.2 8a24c445b0 Content pipeline and operator tools
367 files, from working commit b1a079a.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-19 01:32:48 +02:00

67 lines
3.2 KiB
Python

"""Observe one ORIGINAL death-release consumer invocation; never call it.
70334 core case47017F at1408E879C constructs the fixed16-byte message at
RBP+4890, calls wrapper140819420 (tail-jump through145E6FB60) and resumes at
1408E87C1. Constructor140819440 sets the packet vtable144D0A030 and stores
MapID/XYZ at+28. All identities come from captured original executable code.
Only after this complete live call/stack/type contract matches may the bounded
non-authentication game payload be read. No arbitrary arguments or heap follow.
"""
import hashlib
import math
import os
from pathlib import Path
import struct
ENTRY=0x142517540
SLOT=0x145e6fb60
RETURN=0x1408e87c1
VTABLE=0x144d0a030
PREFIX=b''
OBSERVE_NATURAL_FIRST_USE=True
def inspect_context(read,executable,r):
if r.rip!=ENTRY or struct.unpack('<Q',read(SLOT,8))[0]!=ENTRY:
raise ValueError('Original consumer identity changed')
if struct.unpack('<Q',read(r.rsp,8))[0]!=RETURN:
raise ValueError('Original decoder caller changed')
if r.rcx!=r.rbp+0x4890 or not 0<r.rcx-r.rsp<65536:
raise ValueError('Original packet stack ownership changed')
if struct.unpack('<Q',read(r.rcx,8))[0]!=VTABLE:
raise ValueError('Original parsed message type changed')
if not executable(ENTRY,1):raise ValueError('Consumer not naturally executable')
raw=read(r.rcx+0x28,16);map_id,x,y,z=struct.unpack('<i3f',raw)
if not -1<=map_id<=8191 or not all(math.isfinite(v)for v in(x,y,z))or(map_id==-1 and (x,y,z)!=(0,0,0)):
raise ValueError('Original death-release payload contract changed')
return dict(kind='original-death-release-consumer-observed',decoder_caller_verified=True,
original_packet_stack_and_type_verified=True,consumer=hex(ENTRY),map=map_id,
position=[x,y,z],engine_calls_made=False,authentication_buffers_read=False,
protection_changes=False,code_modified=False)
def capture(pid,registers):
intervals=[]
for line in Path(f'/proc/{pid}/maps').read_text().splitlines():
p=line.split();lo,hi=(int(v,16)for v in p[0].split('-'));intervals.append((lo,hi,p[1]))
def mapped(a,n,execute=False):
return any(lo<=a and a+n<=hi and 'r'in flags and(not execute or 'x'in flags)for lo,hi,flags in intervals)
fd=os.open(f'/proc/{pid}/mem',os.O_RDONLY)
try:
def read(a,n):
if not 0<n<=512 or not mapped(a,n):raise ValueError('Fixed observation read unavailable')
raw=os.pread(fd,n,a)
if len(raw)!=n:raise ValueError('Incomplete fixed observation read')
return raw
report=inspect_context(read,lambda a,n:mapped(a,n,True),registers)
page=ENTRY&~4095
if mapped(page,4096,True):
code=b''.join(read(page+i,512)for i in range(0,4096,512))
if struct.unpack('<Q',read(SLOT,8))[0]!=ENTRY:raise ValueError('Consumer changed during capture')
digest=hashlib.sha256(code).hexdigest();root=Path(__file__).resolve().parents[1]
out=root/'runtime/native-handler-code'/f'{page:x}-death-consumer-{digest[:12]}.bin'
if not out.exists():out.write_bytes(code);out.chmod(0o600)
report['code_page']=dict(page=hex(page),sha256=digest,file=out.name)
return report
finally:os.close(fd)