367 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
35 lines
1.6 KiB
Python
35 lines
1.6 KiB
Python
"""Passive observation of the genuine ResumeComms channel activation boundary.
|
|
|
|
The incoming core decoder at1408dc14d..246 selects callback145e70518.
|
|
This observes its naturally invoked context; it never constructs or calls one.
|
|
"""
|
|
import os
|
|
import struct
|
|
from engine_channel_state import inspect,NETCLIENT
|
|
ENTRY=0x141e48de0
|
|
PREFIX=bytes.fromhex('405556415441564157')
|
|
|
|
def inspect_resume(read,registers):
|
|
if registers.rip!=ENTRY or read(ENTRY,len(PREFIX))!=PREFIX:raise ValueError('Resume boundary identity differs')
|
|
context=registers.rcx
|
|
if registers.rsp%16!=8 or not context:raise ValueError('Resume context ABI differs')
|
|
owner,connection=struct.unpack('<2Q',read(context+8,16))
|
|
if not owner or struct.unpack('<Q',read(NETCLIENT,8))[0]!=owner:raise ValueError('Resume owner differs')
|
|
slots=struct.unpack('<4Q',read(owner+0x1a0,32))
|
|
if not connection or connection not in slots:raise ValueError('Resume connection ownership differs')
|
|
report=inspect(read,owner)
|
|
report.update(kind='genuine-resume-comms-channel-activation',resumed_route=slots.index(connection),
|
|
code_bytes_modified=False,registers_changed=False,context_constructed=False)
|
|
return report
|
|
|
|
def capture(pid,registers):
|
|
fd=os.open(f'/proc/{pid}/mem',os.O_RDONLY)
|
|
try:
|
|
def read(address,size):
|
|
if not 0<size<=32:raise ValueError('Fixed channel metadata bound')
|
|
result=os.pread(fd,size,address)
|
|
if len(result)!=size:raise ValueError('Incomplete channel metadata')
|
|
return result
|
|
return inspect_resume(read,registers)
|
|
finally:os.close(fd)
|