367 files, from working commit b1a079a. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
35 lines
1.9 KiB
Python
35 lines
1.9 KiB
Python
"""Read public parser code at a source-confirmed natural purchase execution.
|
|
|
|
The crash returnPC81831D identifies the five-byte CALL at818318. Validate it
|
|
against the observed GUID reader144631350 at the actual hardware stop. No
|
|
argument/payload/heap data, engine invocation, software patch or protection edit.
|
|
"""
|
|
import hashlib,os,struct
|
|
from pathlib import Path
|
|
ENTRY=0x140818318
|
|
GUID_READER=0x144631350
|
|
PREFIX=b''
|
|
OBSERVE_NATURAL_FIRST_USE=True
|
|
PAGES=(0x140818000,0x1408e8000,0x144631000,0x144632000,0x144633000)
|
|
|
|
def capture(pid,registers):
|
|
if registers.rip!=ENTRY:return {'available':False,'reason':'different-entry'}
|
|
intervals=[]
|
|
for row in Path(f'/proc/{pid}/maps').read_text().splitlines():
|
|
parts=row.split();lo,hi=(int(x,16) for x in parts[0].split('-'));intervals.append((lo,hi,parts[1]))
|
|
fd=os.open(f'/proc/{pid}/mem',os.O_RDONLY)
|
|
try:
|
|
call=os.pread(fd,5,ENTRY)
|
|
if len(call)!=5 or call[0]!=0xe8 or ENTRY+5+struct.unpack('<i',call[1:])[0]!=GUID_READER:return {'available':False,'reason':'crash-call-contract-differs'}
|
|
pages=[];root=Path(__file__).resolve().parents[1]/'runtime/native-handler-code'
|
|
for page in PAGES:
|
|
if not any(lo<=page and page+4096<=hi and 'r' in flags and 'x' in flags for lo,hi,flags in intervals):continue
|
|
code=os.pread(fd,4096,page)
|
|
if len(code)!=4096:continue
|
|
sha=hashlib.sha256(code).hexdigest();path=root/f'{page:x}-purchase-{sha[:12]}.bin'
|
|
if not path.exists():path.write_bytes(code);path.chmod(0o600)
|
|
pages.append(dict(page=hex(page),sha256=sha,file=path.name))
|
|
return dict(kind='natural-purchase-parser-code-only',available=True,entry=hex(ENTRY),verified_call_target=hex(GUID_READER),pages=pages,
|
|
argument_or_authentication_buffers_read=False,engine_calls_made=False,memory_protection_changed=False)
|
|
finally:os.close(fd)
|